vivarium-public-health 3.0.11__tar.gz → 3.1.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.github/workflows/build.yml +1 -1
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/CHANGELOG.rst +9 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/PKG-INFO +2 -2
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/nitpick-exceptions +1 -1
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/setup.py +1 -1
- vivarium_public_health-3.1.1/src/vivarium_public_health/_version.py +1 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/model.py +29 -9
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/special_disease.py +2 -3
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/state.py +5 -5
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/transition.py +2 -2
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/plugins/parser.py +39 -11
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/population/mortality.py +1 -1
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/PKG-INFO +2 -2
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/requires.txt +1 -1
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/plugins/test_parser.py +2 -3
- vivarium_public_health-3.0.11/src/vivarium_public_health/_version.py +0 -1
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.bandit +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.flake8 +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.gitattributes +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.github/CODEOWNERS +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.github/pull_request_template.md +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.github/workflows/deploy.yml +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.gitignore +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.pylintrc +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.readthedocs.yml +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.zenodo.json +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/CODE_OF_CONDUCT.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/CONTRIBUTING.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/Jenkinsfile +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/LICENSE.txt +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/MANIFEST.in +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/Makefile +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/README.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/Makefile +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/_static/style.css +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/_templates/layout.html +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/model.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/models.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/special_disease.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/state.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/disease/transition.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/delay.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/disease.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/intervention.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/magic_wand_components.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/observer.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/mslt/population.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/plugins/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/plugins/parser.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/population/add_new_birth_cohorts.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/population/base_population.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/population/data_transformations.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/population/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/population/mortality.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/disability.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/disease.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/mortality.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/observer.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/risk.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/simple_cause.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/results/stratification.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/base_risk.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/data_transformations.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/distributions.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/effect.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/implementations/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/implementations/low_birth_weight_and_short_gestation.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/risks/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/treatment/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/treatment/magic_wand.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/treatment/scale_up.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/treatment/therapeutic_inertia.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/utilities.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/conf.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/tutorials/index.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/tutorials/risk_exposure.rst +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/pyproject.toml +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/setup.cfg +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/__about__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/disease/models.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/delay.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/disease.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/intervention.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/magic_wand_components.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/mslt/population.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/plugins/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/population/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/population/add_new_birth_cohorts.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/population/base_population.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/population/data_transformations.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/columns.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/disability.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/disease.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/mortality.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/risk.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/simple_cause.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/results/stratification.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/base_risk.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/data_transformations.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/distributions.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/effect.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/implementations/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/treatment/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/treatment/magic_wand.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/treatment/scale_up.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/treatment/therapeutic_inertia.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health/utilities.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/SOURCES.txt +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/dependency_links.txt +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/not-zip-safe +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/src/vivarium_public_health.egg-info/top_level.txt +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/conftest.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/disease/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/disease/test_disease.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/disease/test_special_disease.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/mock_artifact.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/plugins/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/conftest.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/test_add_new_birth_cohort.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/test_base_population.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/test_data_transformations.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/test_mortality.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_categorical_risk_observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_disability.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_disability_observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_disease_observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_mortality_observer.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_stratification.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/conftest.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_base_risk.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_data_transformations.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_distributions.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_effect.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_low_birth_weight_and_short_gestation.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/test_utilities.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/treatment/__init__.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/treatment/test_scale_up.py +0 -0
- {vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tox.ini +0 -0
@@ -1,3 +1,12 @@
|
|
1
|
+
**3.1.1 - 11/12/24**
|
2
|
+
|
3
|
+
- Feature: Rename DiseaseModel initial_state to residual_state
|
4
|
+
- Refactor: Use callables rather than strings to define lookup table builders
|
5
|
+
|
6
|
+
**3.1.0 - 11/07/24**
|
7
|
+
|
8
|
+
- Drop support for python 3.9
|
9
|
+
|
1
10
|
**3.0.11 - 11/07/24**
|
2
11
|
|
3
12
|
- Add ScaledPopulation component to population package
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium_public_health
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.1.1
|
4
4
|
Summary: Components for modelling diseases, risks, and interventions with ``vivarium``
|
5
5
|
Home-page: https://github.com/ihmeuw/vivarium_public_health
|
6
6
|
Author: The vivarium developers
|
@@ -26,7 +26,7 @@ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
26
26
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
27
27
|
Classifier: Topic :: Software Development :: Libraries
|
28
28
|
License-File: LICENSE.txt
|
29
|
-
Requires-Dist: vivarium>=3.0
|
29
|
+
Requires-Dist: vivarium>=3.2.0
|
30
30
|
Requires-Dist: layered_config_tree>=1.0.1
|
31
31
|
Requires-Dist: loguru
|
32
32
|
Requires-Dist: numpy<2.0.0
|
@@ -11,6 +11,7 @@ py:class pandas.core.series.Series
|
|
11
11
|
py:class pandas.core.generic.PandasObject
|
12
12
|
# layered-config-tree
|
13
13
|
py:class layered_config_tree.main.LayeredConfigTree
|
14
|
+
py:class vivarium.framework.values.pipeline.Pipeline
|
14
15
|
|
15
16
|
# TODO: Need to revisit this. Nitpicking here to avoid failing builds on 3.9 in LBWSGRisk
|
16
17
|
py:class PopulationView
|
@@ -22,4 +23,3 @@ py:class Builder
|
|
22
23
|
py:class SimulantData
|
23
24
|
py:class Event
|
24
25
|
py:class LookupTable
|
25
|
-
py:class Pipeline
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "3.1.1"
|
@@ -8,7 +8,8 @@ function is to provide coordination across a set of disease states and
|
|
8
8
|
transitions at simulation initialization and during transitions.
|
9
9
|
|
10
10
|
"""
|
11
|
-
|
11
|
+
import warnings
|
12
|
+
from collections.abc import Iterable
|
12
13
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
13
14
|
|
14
15
|
import numpy as np
|
@@ -38,7 +39,7 @@ class DiseaseModel(Machine):
|
|
38
39
|
return {
|
39
40
|
f"{self.name}": {
|
40
41
|
"data_sources": {
|
41
|
-
"cause_specific_mortality_rate":
|
42
|
+
"cause_specific_mortality_rate": self.load_cause_specific_mortality_rate,
|
42
43
|
},
|
43
44
|
},
|
44
45
|
}
|
@@ -79,16 +80,35 @@ class DiseaseModel(Machine):
|
|
79
80
|
initial_state: Optional[BaseDiseaseState] = None,
|
80
81
|
get_data_functions: Optional[Dict[str, Callable]] = None,
|
81
82
|
cause_type: str = "cause",
|
83
|
+
states: Iterable[BaseDiseaseState] = (),
|
84
|
+
residual_state: BaseDiseaseState | None = None,
|
82
85
|
**kwargs,
|
83
86
|
):
|
84
|
-
super().__init__(cause, **kwargs)
|
87
|
+
super().__init__(cause, states=states, **kwargs)
|
85
88
|
self.cause = cause
|
86
89
|
self.cause_type = cause_type
|
87
90
|
|
88
91
|
if initial_state is not None:
|
89
|
-
|
92
|
+
warnings.warn(
|
93
|
+
"In the future, the 'initial_state' argument to DiseaseModel"
|
94
|
+
" will be used to initialize all simulants into that state. To"
|
95
|
+
" retain the current behavior of defining a residual state, use"
|
96
|
+
" the 'residual_state' argument.",
|
97
|
+
DeprecationWarning,
|
98
|
+
stacklevel=2,
|
99
|
+
)
|
100
|
+
|
101
|
+
if residual_state:
|
102
|
+
raise DiseaseModelError(
|
103
|
+
"A DiseaseModel cannot be initialized with both"
|
104
|
+
" 'initial_state and 'residual_state'."
|
105
|
+
)
|
106
|
+
|
107
|
+
self.residual_state = initial_state.state_id
|
108
|
+
elif residual_state is not None:
|
109
|
+
self.residual_state = residual_state.state_id
|
90
110
|
else:
|
91
|
-
self.
|
111
|
+
self.residual_state = self._get_default_residual_state()
|
92
112
|
|
93
113
|
self._get_data_functions = (
|
94
114
|
get_data_functions if get_data_functions is not None else {}
|
@@ -135,7 +155,7 @@ class DiseaseModel(Machine):
|
|
135
155
|
def on_initialize_simulants(self, pop_data: SimulantData) -> None:
|
136
156
|
population = self.population_view.subview(["age", "sex"]).get(pop_data.index)
|
137
157
|
|
138
|
-
assert self.
|
158
|
+
assert self.residual_state in {s.state_id for s in self.states}
|
139
159
|
|
140
160
|
if pop_data.user_data["sim_state"] == "setup": # simulation start
|
141
161
|
if self.configuration_age_start != self.configuration_age_end != 0:
|
@@ -176,7 +196,7 @@ class DiseaseModel(Machine):
|
|
176
196
|
)
|
177
197
|
else:
|
178
198
|
condition_column = pd.Series(
|
179
|
-
self.
|
199
|
+
self.residual_state, index=population.index, name=self.state_column
|
180
200
|
)
|
181
201
|
self.population_view.update(condition_column)
|
182
202
|
|
@@ -197,7 +217,7 @@ class DiseaseModel(Machine):
|
|
197
217
|
# Helper functions #
|
198
218
|
####################
|
199
219
|
|
200
|
-
def
|
220
|
+
def _get_default_residual_state(self):
|
201
221
|
susceptible_states = [s for s in self.states if isinstance(s, SusceptibleState)]
|
202
222
|
if len(susceptible_states) != 1:
|
203
223
|
raise DiseaseModelError("Disease model must have exactly one SusceptibleState.")
|
@@ -219,7 +239,7 @@ class DiseaseModel(Machine):
|
|
219
239
|
weights = np.array(weights).T
|
220
240
|
weights_bins = np.cumsum(weights, axis=1)
|
221
241
|
|
222
|
-
state_names = [s.state_id for s in states] + [self.
|
242
|
+
state_names = [s.state_id for s in states] + [self.residual_state]
|
223
243
|
|
224
244
|
return state_names, weights_bins
|
225
245
|
|
@@ -14,7 +14,6 @@ from typing import Any, Dict, List, Optional
|
|
14
14
|
|
15
15
|
import pandas as pd
|
16
16
|
from vivarium import Component
|
17
|
-
from vivarium.framework.engine import Builder
|
18
17
|
from vivarium.framework.event import Event
|
19
18
|
from vivarium.framework.population import SimulantData
|
20
19
|
from vivarium.framework.values import list_combiner, union_post_processor
|
@@ -101,8 +100,8 @@ class RiskAttributableDisease(Component):
|
|
101
100
|
self.name: {
|
102
101
|
"data_sources": {
|
103
102
|
"raw_disability_weight": f"{self.cause}.disability_weight",
|
104
|
-
"cause_specific_mortality_rate":
|
105
|
-
"excess_mortality_rate":
|
103
|
+
"cause_specific_mortality_rate": self.load_cause_specific_mortality_rate_data,
|
104
|
+
"excess_mortality_rate": self.load_excess_mortality_rate_data,
|
106
105
|
"population_attributable_fraction": 0,
|
107
106
|
},
|
108
107
|
"threshold": None,
|
@@ -282,11 +282,11 @@ class DiseaseState(BaseDiseaseState):
|
|
282
282
|
return {
|
283
283
|
f"{self.name}": {
|
284
284
|
"data_sources": {
|
285
|
-
"prevalence":
|
286
|
-
"birth_prevalence":
|
287
|
-
"dwell_time":
|
288
|
-
"disability_weight":
|
289
|
-
"excess_mortality_rate":
|
285
|
+
"prevalence": self.load_prevalence,
|
286
|
+
"birth_prevalence": self.load_birth_prevalence,
|
287
|
+
"dwell_time": self.load_dwell_time,
|
288
|
+
"disability_weight": self.load_disability_weight,
|
289
|
+
"excess_mortality_rate": self.load_excess_mortality_rate,
|
290
290
|
},
|
291
291
|
},
|
292
292
|
}
|
@@ -43,7 +43,7 @@ class RateTransition(Transition):
|
|
43
43
|
return {
|
44
44
|
f"{self.name}": {
|
45
45
|
"data_sources": {
|
46
|
-
"transition_rate":
|
46
|
+
"transition_rate": self.load_transition_rate,
|
47
47
|
},
|
48
48
|
},
|
49
49
|
}
|
@@ -156,7 +156,7 @@ class ProportionTransition(Transition):
|
|
156
156
|
return {
|
157
157
|
f"{self.name}": {
|
158
158
|
"data_sources": {
|
159
|
-
"proportion":
|
159
|
+
"proportion": self.load_proportion,
|
160
160
|
},
|
161
161
|
},
|
162
162
|
}
|
@@ -9,7 +9,7 @@ that can parse configurations of components specific to the Vivarium Public
|
|
9
9
|
Health package.
|
10
10
|
|
11
11
|
"""
|
12
|
-
|
12
|
+
import warnings
|
13
13
|
from importlib import import_module
|
14
14
|
from typing import Any, Callable, Dict, List, Optional, Union
|
15
15
|
|
@@ -56,11 +56,13 @@ class CausesConfigurationParser(ComponentConfigurationParser):
|
|
56
56
|
DEFAULT_MODEL_CONFIG = {
|
57
57
|
"model_type": f"{DiseaseModel.__module__}.{DiseaseModel.__name__}",
|
58
58
|
"initial_state": None,
|
59
|
+
"residual_state": None,
|
59
60
|
}
|
60
61
|
"""Default cause model configuration if it's not explicitly specified.
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
Initial state and residual state cannot both be provided. If neither initial
|
64
|
+
state nor residual state has been specified, the cause model must have a
|
65
|
+
state named 'susceptible'.
|
64
66
|
"""
|
65
67
|
|
66
68
|
DEFAULT_STATE_CONFIG = {
|
@@ -104,7 +106,7 @@ class CausesConfigurationParser(ComponentConfigurationParser):
|
|
104
106
|
causes:
|
105
107
|
cause_1:
|
106
108
|
model_type: vivarium_public_health.disease.DiseaseModel
|
107
|
-
|
109
|
+
residual_state: susceptible
|
108
110
|
states:
|
109
111
|
susceptible:
|
110
112
|
cause_type: cause
|
@@ -247,11 +249,13 @@ class CausesConfigurationParser(ComponentConfigurationParser):
|
|
247
249
|
)
|
248
250
|
|
249
251
|
model_type = import_by_path(cause_config.model_type)
|
250
|
-
|
252
|
+
residual_state = states.get(
|
253
|
+
cause_config.residual_state, states.get(cause_config.initial_state, None)
|
254
|
+
)
|
251
255
|
model = model_type(
|
252
256
|
cause_name,
|
253
|
-
initial_state=initial_state,
|
254
257
|
states=list(states.values()),
|
258
|
+
residual_state=residual_state,
|
255
259
|
get_data_functions=data_sources,
|
256
260
|
)
|
257
261
|
cause_models.append(model)
|
@@ -403,7 +407,14 @@ class CausesConfigurationParser(ComponentConfigurationParser):
|
|
403
407
|
# Validation methods #
|
404
408
|
######################
|
405
409
|
|
406
|
-
_CAUSE_KEYS = {
|
410
|
+
_CAUSE_KEYS = {
|
411
|
+
"model_type",
|
412
|
+
"initial_state",
|
413
|
+
"states",
|
414
|
+
"transitions",
|
415
|
+
"data_sources",
|
416
|
+
"residual_state",
|
417
|
+
}
|
407
418
|
_STATE_KEYS = {
|
408
419
|
"state_type",
|
409
420
|
"cause_type",
|
@@ -535,11 +546,28 @@ class CausesConfigurationParser(ComponentConfigurationParser):
|
|
535
546
|
)
|
536
547
|
else:
|
537
548
|
initial_state = cause_config.get("initial_state", None)
|
538
|
-
|
549
|
+
residual_state = cause_config.get("residual_state", None)
|
550
|
+
if initial_state is not None:
|
551
|
+
warnings.warn(
|
552
|
+
"In the future, the 'initial_state' cause configuration will"
|
553
|
+
" be used to initialize all simulants into that state. To"
|
554
|
+
" retain the current behavior of defining a residual state,"
|
555
|
+
" use the 'residual_state' cause configuration.",
|
556
|
+
DeprecationWarning,
|
557
|
+
stacklevel=2,
|
558
|
+
)
|
559
|
+
if residual_state is None:
|
560
|
+
residual_state = initial_state
|
561
|
+
else:
|
562
|
+
error_messages.append(
|
563
|
+
"A cause may not have both 'initial_state and"
|
564
|
+
" 'residual_state' configurations."
|
565
|
+
)
|
566
|
+
|
567
|
+
if residual_state is not None and residual_state not in states_config:
|
539
568
|
error_messages.append(
|
540
|
-
f"
|
541
|
-
f"
|
542
|
-
f"'{cause_name}."
|
569
|
+
f"Residual state '{residual_state}' for cause '{cause_name}'"
|
570
|
+
f" must be present in the states for cause '{cause_name}."
|
543
571
|
)
|
544
572
|
for state_name, state_config in states_config.items():
|
545
573
|
error_messages += self._validate_state(cause_name, state_name, state_config)
|
@@ -105,7 +105,7 @@ class Mortality(Component):
|
|
105
105
|
"mortality": {
|
106
106
|
"data_sources": {
|
107
107
|
"all_cause_mortality_rate": "cause.all_causes.cause_specific_mortality_rate",
|
108
|
-
"unmodeled_cause_specific_mortality_rate":
|
108
|
+
"unmodeled_cause_specific_mortality_rate": self.load_unmodeled_csmr,
|
109
109
|
"life_expectancy": "population.theoretical_minimum_risk_life_expectancy",
|
110
110
|
},
|
111
111
|
"unmodeled_causes": [],
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium_public_health
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.1.1
|
4
4
|
Summary: Components for modelling diseases, risks, and interventions with ``vivarium``
|
5
5
|
Home-page: https://github.com/ihmeuw/vivarium_public_health
|
6
6
|
Author: The vivarium developers
|
@@ -26,7 +26,7 @@ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
26
26
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
27
27
|
Classifier: Topic :: Software Development :: Libraries
|
28
28
|
License-File: LICENSE.txt
|
29
|
-
Requires-Dist: vivarium>=3.0
|
29
|
+
Requires-Dist: vivarium>=3.2.0
|
30
30
|
Requires-Dist: layered_config_tree>=1.0.1
|
31
31
|
Requires-Dist: loguru
|
32
32
|
Requires-Dist: numpy<2.0.0
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import dataclasses
|
2
2
|
from typing import Any, Dict, List, NamedTuple, Tuple, Type
|
3
3
|
|
4
|
-
import numpy as np
|
5
4
|
import pytest
|
6
5
|
import yaml
|
7
6
|
from layered_config_tree import LayeredConfigTree
|
@@ -259,7 +258,7 @@ SIR_MODEL_CONFIG = {
|
|
259
258
|
COMPLEX_MODEL_CONFIG = {
|
260
259
|
COMPLEX_MODEL: {
|
261
260
|
"model_type": "tests.plugins.test_parser.ComplexModel",
|
262
|
-
"
|
261
|
+
"residual_state": STATES.COMPLEX_INFECTED_1.name,
|
263
262
|
"data_sources": {"cause_specific_mortality_rate": COMPLEX_MODEL_CSMR},
|
264
263
|
"states": {
|
265
264
|
STATES.COMPLEX_INFECTED_1.name: {
|
@@ -541,7 +540,7 @@ def test_disease_model(
|
|
541
540
|
):
|
542
541
|
model = sim_components[model_name]
|
543
542
|
assert isinstance(model, expected_model_type)
|
544
|
-
assert model.
|
543
|
+
assert model.residual_state == expected_initial_state
|
545
544
|
|
546
545
|
assert model.lookup_tables["cause_specific_mortality_rate"].data == expected_csmr
|
547
546
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "3.0.11"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/.github/pull_request_template.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/_static/style.css
RENAMED
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/_templates/layout.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/api_reference/index.rst
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/docs/source/tutorials/index.rst
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/disease/test_disease.py
RENAMED
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/disease/test_special_disease.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/population/test_mortality.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_disability.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/results/test_stratification.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_base_risk.py
RENAMED
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/risks/test_distributions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-3.0.11 → vivarium_public_health-3.1.1}/tests/treatment/test_scale_up.py
RENAMED
File without changes
|
File without changes
|