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.5.1.tar.gz (2.4 MB view details)

Uploaded Source

Built Distributions

metawards-1.5.1-cp39-cp39-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

metawards-1.5.1-cp39-cp39-manylinux1_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.9

metawards-1.5.1-cp39-cp39-macosx_10_14_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

metawards-1.5.1-cp38-cp38-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

metawards-1.5.1-cp38-cp38-manylinux1_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.8

metawards-1.5.1-cp38-cp38-macosx_10_14_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

metawards-1.5.1-cp37-cp37m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.7m Windows x86-64

metawards-1.5.1-cp37-cp37m-manylinux1_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.7m

metawards-1.5.1-cp37-cp37m-macosx_10_14_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: metawards-1.5.1.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1.tar.gz
Algorithm Hash digest
SHA256 e9ae8bac47f4469fe26ead6b46d05de7cf043d3a86c01d4b802036d2ff33ec9e
MD5 8903035f43277198550df211e1966eac
BLAKE2b-256 f75eb34b92f5cb30d9de147b431a59cc4f9f611bbcfde16ed78022cae8fcc726

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bc71dbb398e1b4a12dfc69befb50806ccefeeaea6da4c8243f0ed8f86d130906
MD5 492afdda681b57a4b49ddc5687ea4d45
BLAKE2b-256 7d8e9aeb790442ba6770855d219993f64a0f688d1065f710868d0e6c75556733

See more details on using hashes here.

File details

Details for the file metawards-1.5.1-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: metawards-1.5.1-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.5 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 77c4119a9bd48632f77742635504cdf15b97fd619300338f0ad8b54a24f216e8
MD5 dc59444df36d14bba091f8428e4e04c7
BLAKE2b-256 8ab0d18f65981a5b4f9055562c0c99c351a500c72c823e852985d6aafd181818

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a37e12acf35a26ef51fb8e8141904e5c97483b51650d19b6d7b0cd1a312cf80a
MD5 b6b2f7a591166e2bd356257e6e0dd837
BLAKE2b-256 1ccd6a5f52918b111e51cb74077f739418a61f7c2edf660f599a319acf30608c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6dafdc10726a15599f98a326b4c900ce010c4a82306abf6d2529e79292cbcf6f
MD5 a52e3fd8ad79f811f65ec3472e0ccf3a
BLAKE2b-256 e354144d60d021d484c3ff13830a1537083673749e004bd13f267810cbbc6e30

See more details on using hashes here.

File details

Details for the file metawards-1.5.1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: metawards-1.5.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a21472a1d5b085967cdde175cc6914d411a6677dcb4e7c14e65912216b5247b1
MD5 817865ef909f210d1b237812c283b608
BLAKE2b-256 a9dea4c562bf38b333332f32905c7edb4fd555d1aeb1c9a012930091955dbd5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7f560f51ea8278c0a00b18308ea83fc07cbdd92f64eaa047fec128c66881e526
MD5 6970809f612b4adf3829588742384c2d
BLAKE2b-256 cb8c9391723455ef0600cacb03c4496db72bc19e887d7adf5532c20f1809b54c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4347cabe7eb0546da2c042aa08b5c3b12d853881d800bd5950b75e2ffebf2b24
MD5 f8f0871ea8ec23b86197eaea0916c718
BLAKE2b-256 cbf9944fb5008d74caf47a986e42e4cee102e780d433cd36b134911917d87add

See more details on using hashes here.

File details

Details for the file metawards-1.5.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: metawards-1.5.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 70dc91fab4b0024fbf9e78e01164e3589f2b55b3cea6039f9df53e06422c126d
MD5 08d805ac2a7dfacf792c106424c1cf63
BLAKE2b-256 c43a1ab0a522f338543a4c21b9c356b1afbceb3df107391cf2c3f305a16215a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.1-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for metawards-1.5.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b9923290cc6b964ecbb2a2d7db2184c6b99d9e04b1a9ccf2c4ee1b4d4add2aec
MD5 0299ad7f861bfb0f4118636d81910199
BLAKE2b-256 c7b4ab73ab17b3a0558df1196261f1436573cf36f436fa3756e9b62d37bb7a3b

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