simpar (SIMulate PAndemic Response) simulates the spread of a disease through a
heterogeneous population using an SIR model.
The groups module can be used to manage a heterogeneous population comprised
of "meta-groups" with varying contact levels. The tool focuses on providing
functionality for assessing pandemic response strategies such as isolation
protocols, testing regimes (with varying tests), and vaccination requirements.
The Strategy class is used to define a potential strategy. The Scenario
class is used to manage the parameters pertaining to a scenario under which a
disease is spreading. This consists of a population, environment parameters
(e.g. outside rate of infection), and disease parameters (e.g. symptomatic
rate). Lastly, the Trajectory class offers methods to compute metrics on a
simulation of some strategy applied to a scenario. For more details,
see the Documentation.
Installation
The quickest way to get started is with a pip install.
pip install simpar
Usage
# imports
import yaml
import numpy as np
from simpar.scenario import Scenario
from simpar.strategy import strategies_from_dictionary
from simpar.trajectory import Trajectory
import matplotlib.pyplot as plt
# load scenario and strategy
with open("dev_scenario.yaml", "r") as f:
yaml_file = yaml.safe_load(f)
scenario = Scenario.from_dictionary(yaml_file)
with open("dev_strategy.yaml", "r") as f:
yaml_file = yaml.safe_load(f)
strategy = strategies_from_dictionary(yaml_file, scenario.tests)["dev"]
# simulate and create trajectory
sim = scenario.simulate_strategy(strategy)
trajectory = Trajectory(scenario, strategy, sim)
License
Licensed under the MIT License
Metadata
Release files for simpar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simpar-0.1.0.tar.gz | 20.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simpar-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.1 kB
Release files / simpar-0.1.0.tar.gz
| Download URL | simpar-0.1.0.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f58023761306423ee54ad37b90f2c4cb60aab4b0494c251b35124df70bee0425
|
|
BLAKE2b-256 checksum How to use checksums |
55f5d5d719e80ac21c1c14f5b828a0fecdb3c17444305cb8c687d6a4c344f31d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|
Release files / simpar-0.1.0-py3-none-any.whl
| Download URL | simpar-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46262978a3cd5411c0029cd295227cff0e945a557026e1de3c7e9cb12da7dced
|
|
BLAKE2b-256 checksum How to use checksums |
37652d74360ebb409a4fddf24246659e3f082eb8eb8b8d702ebadcb9e64a56e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8
|