metawards.Disease¶
-
class
metawards.
Disease
(beta: List[float] = None, progress: List[float] = None, too_ill_to_move: List[float] = None, contrib_foi: List[float] = None, start_symptom: int = None, _name: str = None, _version: str = None, _authors: str = None, _contacts: str = None, _references: str = None, _filename: str = None, _repository: str = None, _repository_version: str = None, _repository_branch: str = None)[source]¶ This class holds the parameters about a single disease
A disease is characterised as a serious of stages, each with their own values of the beta, progress, too_ill_to_move and contrib_foi parameters. To load a disease use the Disease.load function, e.g.
Examples
>>> disease = Disease.load("ncov") >>> print(disease) Disease ncov repository: https://github.com/metawards/MetaWardsData repository_branch: master repository_version: 0.2.0 beta = [0.0, 0.0, 0.95, 0.95, 0.0] progress = [1.0, 0.1923, 0.909091, 0.909091, 0.0] too_ill_to_move = [0.0, 0.0, 0.0, 0.0, 0.0] contrib_foi = [1.0, 1.0, 1.0, 1.0, 0.0]
-
__init__
(beta: List[float] = None, progress: List[float] = None, too_ill_to_move: List[float] = None, contrib_foi: List[float] = None, start_symptom: int = None, _name: str = None, _version: str = None, _authors: str = None, _contacts: str = None, _references: str = None, _filename: str = None, _repository: str = None, _repository_version: str = None, _repository_branch: str = None) → None¶
Methods
N_INF_CLASSES
()Return the number of stages of the disease __init__
(beta, progress, too_ill_to_move, …)load
(disease, repository, folder, filename)Load the disease parameters for the specified disease. Attributes
beta
Beta parameter for each stage of the disease contrib_foi
Contribution to the Force of Infection (FOI) parameter for each stage of the disease progress
Progress parameter for each stage of the disease start_symptom
Index of the first symptomatic stage too_ill_to_move
TooIllToMove parameter for each stage of the disease -
beta
= None¶ Beta parameter for each stage of the disease
-
contrib_foi
= None¶ Contribution to the Force of Infection (FOI) parameter for each stage of the disease
-
static
load
(disease: str = 'ncov', repository: str = None, folder: str = 'diseases', filename: str = None)[source]¶ Load the disease parameters for the specified disease. This will look for a file called f”{disease}.json” in the directory f”{repository}/{disease}/{disease}.ncon”
By default this will load the ncov (SARS-Cov-2) parameters from $HOME/GitHub/model_data/2011Data/diseases/ncov.json
Alternatively you can provide the full path to the json file via the “filename” argument
Parameters: - disease (str) – The name of the disease to load. This is the name that will be searched for in the METAWARDSDATA diseases directory
- repository (str) – The location of the cloned METAWARDSDATA repository
- folder (str) – The name of the folder within the METAWARDSDATA repository that contains the diseases
- filename (str) – The name of the file to load the disease from - this directly loads this file without searching through the METAWARDSDATA repository
Returns: disease – The constructed and validated disease
Return type:
-
progress
= None¶ Progress parameter for each stage of the disease
-
start_symptom
= None¶ Index of the first symptomatic stage
-
too_ill_to_move
= None¶ TooIllToMove parameter for each stage of the disease
-