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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

metawards-1.6.1-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.1-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.1-cp38-cp38-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

metawards-1.6.1-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.1-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.1-cp37-cp37m-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

metawards-1.6.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: metawards-1.6.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 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.1.tar.gz
Algorithm Hash digest
SHA256 01e9a1248ddc10529df6aeb2569ab3c5883ca240a7ebbc0358f4e35c4789dd41
MD5 19d5a0072b0e1bc2589be14b633946f4
BLAKE2b-256 02178fc69e4cbad97061908bba230124e4c5eb2c3937661c798da0647eaea92f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 26846b0170678bf727cbd9c10522c699b5f1ecc32519672b66eaf3cdaa4c9c04
MD5 93d2dd8ccf8aa57004cdc9d5e5141131
BLAKE2b-256 a4a83d8dafdb8519e021c04b1243e1c5ccdbe03eb43ffc01113b6707f3d99c29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for metawards-1.6.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1e608fda72f82858495442485ae3bc4f12da6aed8e0c724099484f8958bd384c
MD5 164762dfcf63ddaa966131d4e4ef5420
BLAKE2b-256 2c408f0a15e9ac4d1b1337e0a3f3d8643deeea43373e8a4431716ee69e1de7fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 325934239b5b1cbc8fa60dc3c192446c4dfc2e0af79e0a283f84fcc5871b03e2
MD5 bbcd82f0800f6756f3aaef723befb82e
BLAKE2b-256 5de0eedf1e2cf61fc482ebadb012498c87d192bf71adb2b688a399887d579747

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 42a67dab788f691f92923c64bffc80b002c3642f2764e83d21b680257e983f86
MD5 65daef9fce11fdc2138357bffff6bbcc
BLAKE2b-256 5e68c09665e9f233746ce55243935c7b460b894deaee0c9e793c332b09835c75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for metawards-1.6.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f59c67b1ed05783c02b5bffd8f9295f745ded47a6b689f8831364fd621aab12a
MD5 3d28caeac89bb7281bbdd1fa883e1b1c
BLAKE2b-256 419df5aedb91081fe65bbfbf0c1f77d183dd61cab37dbde57f2e1819197f9fd4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a8e57c47a489004334df5a2bbe217b48e36bc4be1576327a12322973d04f7d5f
MD5 14a1e94bf0bc0dad34ff7679eb4b5e8f
BLAKE2b-256 c8b634367c32b732fc6ccd1353110ecdf42f94287366a38dfabcf7e738f925e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 95efa5deb029015dddc5f549d50359001bf596c098fbdca11f7ba7a750874bc1
MD5 b217ca78e27519df79c1d10f9aa75d12
BLAKE2b-256 85778b1de94138d2e236e1e391a86f3fa7047dc08bee1555995218000833f490

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for metawards-1.6.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 18b420362e22962c87ca07f4f8e08644fe83af64d146f6779c31454c4db04727
MD5 38cfa1358af22ded73c3726d02ceeb9b
BLAKE2b-256 7bf1deb9590ea613152f40589cdec79f4be21349e1e8b485fa7ecda643871800

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.6.1-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.2 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.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0ff4d7b75da3931da32bdf3e61eea7295c7c51e7afd13a1430ff56144359dd03
MD5 5e1e888a7e10695b44eac6e251a8b90d
BLAKE2b-256 85929775cc26bc504fa178fc3f67bfd9168fd6e1118df6803a35c4e86e6f2d9c

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