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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8 Windows x86-64

metawards-1.4.0-cp38-cp38-manylinux1_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.8

metawards-1.4.0-cp38-cp38-macosx_10_14_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

metawards-1.4.0-cp37-cp37m-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.7m Windows x86-64

metawards-1.4.0-cp37-cp37m-manylinux1_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.7m

metawards-1.4.0-cp37-cp37m-macosx_10_14_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: metawards-1.4.0.tar.gz
  • Upload date:
  • Size: 2.3 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.4.0.tar.gz
Algorithm Hash digest
SHA256 09563b9978a1ab9a2128859151a6e6d1c1cb080beec8b95def2ed1cdc6a9f7c4
MD5 28d2f782aaeb399606243a31d73b9d95
BLAKE2b-256 2fa8891c28e555bedf6ea1ec6527174b46568329df301c50247a5a5ca71f8b59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-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.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 89b40af861a0eef160f537a8b584fa327d261f2f674cee88f777d5c829f0bee1
MD5 cb7908c126f33828167a52503cc88a60
BLAKE2b-256 886b83b942913d641ddf1274aab5583baff50ecaf5a32492532e87b9ffaa2a79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.8 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.4.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d56209b60ac8b1a8dd17e444b8a9f2dc4c5bdce8022763bac53978133ad0731c
MD5 e30e99e54f8dfceaddda02c1afec7f39
BLAKE2b-256 406bea53e1d6440e5dcea1ef559e25f576d37418cd2b2833261072f741ddef7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.0 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.4.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 13e479e561a55b66003b255dedaea8e42cdce2a6ae9e6927f684c555bd8734da
MD5 a92737f4c24964bb9b98ea802bc5ad8a
BLAKE2b-256 af8c8b0f4f304f04b1d9855beb481f7cf004d1887af7b272d1fc667dd9f9250c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.8 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.4.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6e808dca21c82784b2206174a834ea1bd0d7b8447b26eeaabd10f25ee4a7c8a0
MD5 e34ab09c2d9df53c5f745ca360f0f238
BLAKE2b-256 5648c8ef417208c407061b7d88e95858113eaa5b74bad96729e0fbe8aaf5258b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.4 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.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2431dd2ac44b773d405225f3e0337ee1c3ce450ad95fd6889664e12cf5594242
MD5 6e78c2af06bffc0fe41114536dadb687
BLAKE2b-256 b09f4b92473db40fa350a58bd00c6fed2d83f632cc31e901e53965cda6b453a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.4.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 2.0 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.4.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c03bfd0501f2c66a88ab0c64ff742eb25088a143ad28024df82e3e9acae5c6d8
MD5 ddb830ee7767c406ddd2a890314a761b
BLAKE2b-256 c246512f6d85c4c32b610610bcb7896a0f6792041f1487eecef3b32937ddbcb7

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