Skip to main content

MetaWards disease metapopulation modelling

Project description

MetaWards

Build status PyPI version PyPI Downloads GitHub commit activity License

For the most accurate and up to date information please visit the project website.

This is a Python port of the MetaWards package originally written by Leon Danon. The port is kept in sync with the original C code, with checks in place to ensure that the two codes give identical results. This improves the robustness of both codes, as it minimises the footprint to bugs that can evade both C and Python.

The aim of this port is to make it easier for others to contribute to the program, to improve robustness by adding in unit and integration test, and to also open up scope for further optimisation and parallelisation.

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.

Data

The data and input parameters needed to use this package are stored in the MetaWardsData repository. Please make sure that you clone this repository to your computer and supply the full path to that repository to the program when it runs. There are three ways to do this;

  1. Set the METAWARDSDATA environment variable to point to this directory, e.g. export METAWARDSDATA=$HOME/GitHub/MetaWards

  2. Pass the repository variable to the input data classes Disease, InputFiles and Parameters

  3. Or simply make sure you clone into the directory $HOME/GitHub/MetaWardsData as this is the default path.

References

These are the references behind the original C code are;

  • "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

  • "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

Dependencies

The code requires Python 3.7 or above, and requires no other dependencies to install. For development you will need cython to build the code, plus pytest for running the tests.

Installation

Full installation instructions are here.

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

To do that, type;

git clone https://github.com/metawards/MetaWards
cd MetaWards
pip install -r requirements-dev.txt
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

You can generate the docs using

make docs

Running

Full usage instructions are here

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. For example;

metawards --input tests/data/ncovparams.csv --seed 15324 --nsteps 30 --nthreads 1

This will duplicate the run of the MetaWards C program that is bundled in this repository that was run using;

./original/metawards 15324 tests/data/ncovparams.csv 0 1.0

The original C code, command line and expected output are in the original directory that is bundled in this repo.

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.

Full instructions for running on a cluster are here

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

Uploaded Source

Built Distributions

metawards-1.0.0-cp38-cp38-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

metawards-1.0.0-cp38-cp38-manylinux1_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.8

metawards-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

metawards-1.0.0-cp37-cp37m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.7m Windows x86-64

metawards-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.7m

metawards-1.0.0-cp37-cp37m-macosx_10_14_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: metawards-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bbdd59350f90e7f2c90fd5291ee1e488f7793c6ae80002481b4100b892bc4f68
MD5 ba8405e21c8138ef69f027ae87fa05bf
BLAKE2b-256 38f59edcdc926b4c7d0f8552abe1c1ddca4ecb3ea296138f93ca903ad7e5ea57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 32362c6bc754659fb558ba67b704528c41a445014909570e46ca1bf9e505ddcb
MD5 4a1487c4f4088094c958c4ab5dec3a78
BLAKE2b-256 30b8b59271ce06d4ba00c74b292ec0411704a8c603b5fd66da2e1f2a4481625f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f921763ffc503680b177d0ab2966e79068ee0d7cfe254ebf5aeee97b89f7b65c
MD5 720a777c7decc98868426a6d21da90b8
BLAKE2b-256 542bb88b82c2e9ae8531fa178ef3a356effbd8bd45cae6a35737745a23035201

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.8 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.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6f5a6a653aa070f798869cf566816df6ccd9f0ce568cdcd45c5cf5671303b072
MD5 139fe01726f252eac1caa1b694263970
BLAKE2b-256 6c8d978acefd25a677a39dbac6106957742f506df1179bf44fe44f2dfc16109b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a33370b7ea07bbaad431a842ed377663fa096af3ce2c4904221a2ca2267cad6a
MD5 4516cc4d76a86c35b05fab4794d780ae
BLAKE2b-256 4ff65905d2f2b4192f01045d1cf510c6d9acde11395bcadcd867aafc447f1453

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.8 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f63d958501d98bff00af4b9efa56dd49b710e97c609252be95f4858e20ffda4c
MD5 fba4aaddd96fc7ae82ee22506646d911
BLAKE2b-256 df03f810aa3750153a9ace32fa7a9cd1e4a275b90ca235a4c444f348c5df0e28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.0.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 1.8 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.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for metawards-1.0.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9a0a4a8c3cb1854962e76800abc6d4ad744cc358429be1fc7135f0afcdcd1f70
MD5 62187039cdfc768665c9335d703535f7
BLAKE2b-256 a910cb9077d5672dba44489760c4c83ea394558f0c32906c155b9029e3a1a99b

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