Skip to main content

MetaWards disease metapopulation modelling

Project description

MetaWards

Build status PyPI version PyPI Downloads License

Scientific Background

MetaWards implements a stochastic metapopulation model of disease transmission. It can scale from modelling local transmission up to full national- or international-scale metapopulation models.

Please follow the quick start guide to see how to quickly get up and running using MetaWards to model your own custom disease or metapopulation model.

It is was originally developed to support modelling of disease transmission in Great Britain. The complete model description and the original C code are described here;

  • "The role of routine versus random movements on the spread of disease in Great Britain", Leon Danon, Thomas House, Matt J. Keeling, Epidemics, December 2009, 1 (4), 250-258; DOI:10.1016/j.epidem.2009.11.002

  • "Individual identity and movement networks for disease metapopulations", Matt J. Keeling, Leon Danon, Matthew C. Vernon, Thomas A. House Proceedings of the National Academy of Sciences, May 2010, 107 (19) 8866-8870; DOI:10.1073/pnas.1000416107

In this model, the population is divided into electoral wards. Disease transmission between wards occurs via the daily movement of individuals. For each ward, individuals contribute to the force of infection (FOI) in their home ward during the night, and their work ward during the day.

This model was recently adapted to model CoVID-19 transmission in England and Wales, with result of the original C code published (pre-print) here;

  • "A spatial model of CoVID-19 transmission in England and Wales: early spread and peak timing", Leon Danon, Ellen Brooks-Pollock, Mick Bailey, Matt J Keeling, medRxiv 2020 02.12.20022566; DOI:10.1101/2020.02.12.20022566

This Python code is a port which can identically reproduce the outputs from the original C code as used in that work. This Python code has been optimised and parallelised, with additional testing added to ensure that development and scale-up of MetaWards has been robustly and efficiently conducted.

Program Info

The package makes heavy use of cython which is used with OpenMP to compile bottleneck parts of the code to parallelised C. This enables this Python port to run at approximately the same speed as the original C program on one core, and to run several times faster across multiple cores.

The program compiles on any system that has a working C compiler that supports OpenMP, and a working Python >= 3.7. This include X86-64 and ARM64 servers.

The software supports running over a cluster using MPI (via mpi4py) or via simple networking (via scoop).

Full instructions on how to use the program, plus example job submission scripts can be found on the project website.

Installation

Full installation instructions are here.

Binary packages are uploaded to pypi for Windows, OS X and Linux (manylinux). The easiest way to install is to type in the console:

pip install metawards

(this assumes that you have pip installed and are using Python 3.7 or above - if this doesn't work please follow the full installation instructions).

Alternatively, you can also install from within R (or RStudio) by typing;

library(devtools)
install_github("metawards/rpkg")
metawards::py_install_metawards()

But, as you are here, I guess you want to install the latest code from GitHub ;-)

To do that, first clone and install the requirements;

git clone https://github.com/metawards/MetaWards
cd MetaWards
pip install -r requirements.txt
pip install -r requirements-dev.txt

Next, you can make using the standard Python setup.py script route.

CYTHONIZE=1 python setup.py build
CYTHONIZE=1 python setup.py install

Alternatively, you can also use the makefile, e.g.

make
make install

(assuming that python is version 3.7 or above)

You can run tests using pytest, e.g.

METAWARDSDATA="/path/to/MetaWardsData" pytest tests

or you can type

make test

You can generate the docs using

make doc

Running

You can either load and use the Python classes directly, or you can run the metawards front-end command line program that is automatically installed.

metawards --help

will print out all of the help for the program.

Running an ensemble

This program supports parallel running of an ensemble of jobs using multiprocessing for single-node jobs, and mpi4py or scoop for multi-node cluster jobs.

Note that mpi4py and scoop are not installed by default, so you will need to install them before you run on a cluster (e.g. pip install mpi4py or pip install scoop).

Full instructions for running on a cluster are here

History

This is a Python port of the MetaWards package originally written by Leon Danon. This port has been performed with Leon's support by the Bristol Research Software Engineering Group.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metawards-1.6.0.tar.gz (2.7 MB view details)

Uploaded Source

Built Distributions

metawards-1.6.0-cp39-cp39-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.9 Windows x86-64

metawards-1.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

metawards-1.6.0-cp39-cp39-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

metawards-1.6.0-cp38-cp38-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

metawards-1.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

metawards-1.6.0-cp38-cp38-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

metawards-1.6.0-cp37-cp37m-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

metawards-1.6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

metawards-1.6.0-cp37-cp37m-macosx_10_14_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

Details for the file metawards-1.6.0.tar.gz.

File metadata

  • Download URL: metawards-1.6.0.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0.tar.gz
Algorithm Hash digest
SHA256 0cac1e0f67305e0dc20bf8d4375bf0957d262ad4207a88e1f0ec7e88f78ca653
MD5 45e76fc92c71b181331d43a7d306e90a
BLAKE2b-256 ea2e2336138bad5c5f7e54462c47ba077a406d665549b47bfca90258aecedf28

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5967361a688be9dd7ca56af04c99c032308ad29bf4507594f2f99b12e36ffdaf
MD5 15cdc6568f3157a2a0b37b880a6992c7
BLAKE2b-256 5702efe9ba2efd6edec2c8c0ee1b03e25132f647035a5b4de4ffd72915e582e2

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for metawards-1.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8fd5f4132dd6b77786fbea15caa1e42f39139ec784b44606b3c0d5824fee2965
MD5 5d6d96a0d316d5deaacf7873aaec0b1a
BLAKE2b-256 7e192722b8285b96066bb69a669faf32e9a50a8d88eabb8885d69b519b036c25

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 27259eeca4935aca5b1840ca1094cf6b957b871cfe36f25a2b45d8cf9bcd0f80
MD5 ebd63b245dbbc94f9549f3c19f4e4bc4
BLAKE2b-256 f05cfb079a43cd4d4f0f564fa03c0a16f238cd3e324b2032feba86cc234819f1

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a206066edf2bf5b1dc7b7a4338c7d8bca8295362fbb8c15fc272739b98e0bec4
MD5 7da8bb09ed777a7849f954d908eb72fc
BLAKE2b-256 6ac64a4d45cd3fb899e0cef98e457c9c9c2b7345250412706bc3397be68d6889

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for metawards-1.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 91c97b05106f7e92e5a3df089b2a9c73ce1f623cc839202da4833affc8a3602b
MD5 4e94a34a0a66d76a01db68a76fab9c86
BLAKE2b-256 fc6cd729c38149212fd4d3ae852df293dd725673039f0afc5243e37ccf669931

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6aa83d21f23258def2387b52a6672b00e0f0d9bb67fb147eecd1c38f64558da2
MD5 b7b085a88e896fcc97a02ea0e09ce687
BLAKE2b-256 19d0446ff6ddb62919f6751a019de79702956d1ecaec9ebee04f49980ddc053d

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 9cbdeccaa64124fa2a4474f4be8ec4114be7f730552acff9012e70f5c7a53540
MD5 de86b6c13e021a7227babdab7482edde
BLAKE2b-256 48824a57cc8ddb4bde409ca7a39a77a55e187cbbfc8ce5b368d63f4b0b3bc8dc

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for metawards-1.6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3c26e5dd1d7c991470fb2d708bfc7abf2c2f76a197b391285f42106400e15b58
MD5 b7158e64b3fc67fb9c484ce0ba1aa441
BLAKE2b-256 e72d7a71d75f91052acc187a6d541fae6bfe3efe4b43eb2cd82e9b99c85ba72c

See more details on using hashes here.

File details

Details for the file metawards-1.6.0-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: metawards-1.6.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for metawards-1.6.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 88f5b9bcc635c68602abd7735be70f72fd8f5ac848d99b0306936b31fc34e3f4
MD5 7314e3f2ae22b635a1d05531686b52fa
BLAKE2b-256 7777822831a4045898e07b8e5d39b609b136c81eb1301d66502ff5531f3885c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page