MetaWards disease metapopulation modelling
Project description
MetaWards
- For the most accurate and up to date information please visit the project website.
- For an overview of features please visit the features page.
- Please take a read of our Journal of Open Source Software paper
- Please cite according to the CITATION.cff file in this repo.
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 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, Philosophical Transactions of the Royal Society B, 376(1829); DOI:10.1098/rstb.2020.0272
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file metawards-1.6.2.tar.gz
.
File metadata
- Download URL: metawards-1.6.2.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e5ba67ce860816aad5f508fe66c00260f3c8d475d84fe904d7648d9d9b47bbb |
|
MD5 | 6d54ee8204c7ffe0d2493222037ab73f |
|
BLAKE2b-256 | 048d188278c5a19549c16765599f87e08d24eea311dcbea6e9b97a2dd9cdb30c |
File details
Details for the file metawards-1.6.2-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: metawards-1.6.2-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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50cb548fef267c9df4f3654d7082919818c003023842b4d985c5d5c2cde6b37a |
|
MD5 | 5fbd3db33e61a42d03fd2f268775ef29 |
|
BLAKE2b-256 | 8588107b5c9810f4105cd6bd42579a6d92e8fb9084f22f86d6362b6032b1d232 |
File details
Details for the file metawards-1.6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb1411cf555a00cd03a956da4a8d5f5691750e6af84cf6cbaf632e2480f851de |
|
MD5 | 5b5d39289b89038e7262eaca30f86fc0 |
|
BLAKE2b-256 | a50fb789d32b5e4c92857783ecb7d4717473fe49f1b1f5c56f00da934b32c5da |
File details
Details for the file metawards-1.6.2-cp39-cp39-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-cp39-cp39-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb632729e0682cdc7880ab9e7b2f6c1b140ab16fca0b02b76e5545150cea279d |
|
MD5 | eee17e711db57c17be6a037d7fb9970d |
|
BLAKE2b-256 | 0bfb9557a6f40ae4a4ebc9a4002b8f2cedc189d488d06b331a1ff811615dd03e |
File details
Details for the file metawards-1.6.2-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: metawards-1.6.2-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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85aabe84c27c542ebbf9a063ab17db1c50e7d4271858105d0eb1f78c9a009ac9 |
|
MD5 | e45f34287aa2d7798fe5d00e872fa530 |
|
BLAKE2b-256 | f9e3178c6a683cf953b6683290254b2dad754c18406b71af3d63f262694a98c8 |
File details
Details for the file metawards-1.6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 7.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cc12c924633d8f2de6c44074b5286394dd05c61e0712de896444d2c9d2accfd |
|
MD5 | 918f56271d7e2d5ca6e05d6be8586623 |
|
BLAKE2b-256 | 3c8bec2edadec156c5652a0c83cbcf1e7541a9edfc9b22ded36251569f712e30 |
File details
Details for the file metawards-1.6.2-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab7c5b5b281aa82d6b3d97459d015ce812e4485a8ea2967cba8c8ac6685e3d02 |
|
MD5 | de98c32a8ea5f14a203bcdb696785e98 |
|
BLAKE2b-256 | 756ab3d74081a97fd597a69162f98e13c7a30b31035347c459145dad5766de32 |
File details
Details for the file metawards-1.6.2-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: metawards-1.6.2-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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0880dba45fefa00c7fe6281a833bd23f21346bf37bd03c7ad029c95b5d8c313e |
|
MD5 | 84b7209ca2d3bfebd6e25386bf964b52 |
|
BLAKE2b-256 | 99a321593665cce79e762e90847e4da26ccaa3327cf98014dbd09cb9b956c52a |
File details
Details for the file metawards-1.6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 7.5 MB
- Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe5c20eff110287fb5f962bb9d096dec6704280d4490a34a7cf0266bd10b554f |
|
MD5 | 3c4a77c0f8338d8302770d95a51856a9 |
|
BLAKE2b-256 | 34f7c483d4996163ae0534ee3d4c6ee3f124447f1d492477afac59ac7e930560 |
File details
Details for the file metawards-1.6.2-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: metawards-1.6.2-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.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15a051aac8540a660b0bd6f7d8fd5bc3624bfe652ffa934609d263db3c1a35d |
|
MD5 | ce8ed34a8446c14b6ac08d66394591ef |
|
BLAKE2b-256 | 2171e0ec9f5aa3066d6b89150d3474230da642d95ab26dcef7ad8f416aa9f7c3 |