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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9

metawards-1.5.0-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.0-cp38-cp38-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

metawards-1.5.0-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.0-cp37-cp37m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

metawards-1.5.0-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.0.tar.gz.

File metadata

  • Download URL: metawards-1.5.0.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.0.tar.gz
Algorithm Hash digest
SHA256 273fe0e28c03da06ed7f028163dbba693ab6bbbe55c97e91212e5eeb80b2ebf2
MD5 a28acb8544ffe157aced2b7bd796b670
BLAKE2b-256 663a99069de215e3904f3216c513372bcc4fa4ec2b6961843c8d1053ca021455

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 11224c715c1472661570dc056fed4c5d2c3da5fd36aff8e5fc8e7fa77349ee9e
MD5 4b1ad53344df5b3b28099cfbf3cad381
BLAKE2b-256 a04017eed4734002c5427b21f30652fbcfd8e36c9cf4de31a3d554ce9683d31f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2aaa8b7f5a78f67660e7805296b0ad351c463115d74a49b697c34a89a7dc8c6c
MD5 82979fe92aec21687b62be39689f771e
BLAKE2b-256 0996d21be390588b8a1ad26f14afd61122978e2c039f399da3657d9f53f0cbae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a58a0c2b452b866697cee9b0a2ff0b27b33713d1979faa5db83024d6231d58c9
MD5 c1dce4ecc73da6ffefb9f67ec99ce89f
BLAKE2b-256 02898370848ad8f1baf525ea8e13c882ead1701066a729505ca57757717fc03f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.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.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4436cde9d5eb4f672ac712ef7f75ab8cab3f0f2f36bf504e0583466c5360815e
MD5 b05bab3f524aaba2720c1aa2340ec721
BLAKE2b-256 288bd5abb8e4f78d1141a67ce030dfc9c7a0f918819403c2364e7ce9bc0b40fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f052d6a1a0f63d911702a65749dbfc4893480b550b39302a95f608e43576accc
MD5 7120665f1188b38274dd7423516274e2
BLAKE2b-256 c59b115f056d6468819d567b42b6b693a76b4e7b695eb4c348e847277031b5be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6b1f8b9717d268339afb23b8f184e5078ba5d0236a6b3a99ed009a3d411daf6b
MD5 ce22fa4a26568fcb436ba0ef53fdd8a8
BLAKE2b-256 ecdb73fcf7b8621f78f32ecf8098cd6ae5706864c494ca06034745a5f440939d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0722632b4d0ebbeca9883cc85e7e5239c4be4b30f3241becdbcb62109ad20b7d
MD5 e9dfeb0e4173fc0ed49fdecab26eae25
BLAKE2b-256 78fc817250b7b5517b548e1afe22a5b62528ef39c76a2115f4af9b830536444b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b61f32d2807dfa18e122dceedbf011bcb426a647e0c7dd739e41b34e555836c1
MD5 394103eaa6779886e5dfafa2409f69d2
BLAKE2b-256 3e174182a10cb5e2c3ea984f02bd2b63a3da483b8cec9d597e86c9e962854bc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metawards-1.5.0-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.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 92f68dc70110c72b19158bb8d8df974b6b6f6c981dab6e821b809bdce5f288b5
MD5 2cfb1caa1f92c5c04ae4e7008c2a43f3
BLAKE2b-256 3a51f05d139b1da132b0934ecec4b0ad443aa60cb0fc07306490994cdf13ee81

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