vivarium-public-health 2.0.2__tar.gz → 2.1.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.github/workflows/build.yml +1 -1
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/CHANGELOG.rst +4 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/PKG-INFO +1 -1
- vivarium_public_health-2.1.1/src/vivarium_public_health/_version.py +1 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/state.py +83 -40
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/PKG-INFO +1 -1
- vivarium_public_health-2.0.2/src/vivarium_public_health/_version.py +0 -1
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.gitattributes +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.github/CODEOWNERS +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.github/pull_request_template.md +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.github/workflows/deploy.yml +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.gitignore +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.pylintrc +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.readthedocs.yml +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/.zenodo.json +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/CODE_OF_CONDUCT.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/CONTRIBUTING.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/LICENSE.txt +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/MANIFEST.in +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/README.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/Makefile +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/nitpick-exceptions +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/_static/style.css +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/_templates/layout.html +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/model.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/models.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/special_disease.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/state.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/disease/transition.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/disability.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/disease.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/mortality.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/risk.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/metrics/stratification.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/delay.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/disease.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/intervention.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/magic_wand_components.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/observer.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/mslt/population.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/population/add_new_birth_cohorts.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/population/base_population.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/population/data_transformations.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/population/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/population/mortality.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/base_risk.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/data_transformations.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/distributions.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/effect.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/implementations/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/implementations/low_birth_weight_and_short_gestation.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/risks/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/testing/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/testing/mock_artifact.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/testing/utils.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/treatment/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/treatment/magic_wand.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/treatment/scale_up.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/treatment/therapeutic_inertia.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/api_reference/utilities.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/conf.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/tutorials/index.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/docs/source/tutorials/risk_exposure.rst +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/pyproject.toml +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/setup.cfg +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/setup.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/__about__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/model.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/models.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/special_disease.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/disease/transition.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/disability.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/disease.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/mortality.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/risk.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/metrics/stratification.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/delay.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/disease.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/intervention.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/magic_wand_components.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/observer.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/mslt/population.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/population/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/population/add_new_birth_cohorts.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/population/base_population.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/population/data_transformations.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/population/mortality.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/base_risk.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/data_transformations.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/distributions.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/effect.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/implementations/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/testing/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/testing/mock_artifact.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/testing/utils.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/treatment/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/treatment/magic_wand.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/treatment/scale_up.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/treatment/therapeutic_inertia.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/utilities.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/SOURCES.txt +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/dependency_links.txt +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/not-zip-safe +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/requires.txt +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health.egg-info/top_level.txt +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/conftest.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/disease/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/disease/test_disease.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/disease/test_special_disease.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_categorical_risk_observer.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_disability.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_disability_observer.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_disease_observer.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_mortality_observer.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_stratification.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/population/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/population/conftest.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/population/test_add_new_birth_cohort.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/population/test_base_population.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/population/test_data_transformations.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/conftest.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/test_base_risk.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/test_data_transformations.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/test_distributions.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/test_effect.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/test_utilities.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/treatment/__init__.py +0 -0
- {vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium_public_health
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.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
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "2.1.1"
|
@@ -11,10 +11,11 @@ from typing import Callable, Dict, List, Optional
|
|
11
11
|
import numpy as np
|
12
12
|
import pandas as pd
|
13
13
|
from vivarium.framework.engine import Builder
|
14
|
-
from vivarium.framework.lookup import LookupTableData
|
14
|
+
from vivarium.framework.lookup import LookupTable, LookupTableData
|
15
15
|
from vivarium.framework.population import PopulationView, SimulantData
|
16
|
+
from vivarium.framework.randomness import RandomnessStream
|
16
17
|
from vivarium.framework.state_machine import State, Transient, Transition, Trigger
|
17
|
-
from vivarium.framework.values import list_combiner, union_post_processor
|
18
|
+
from vivarium.framework.values import Pipeline, list_combiner, union_post_processor
|
18
19
|
|
19
20
|
from vivarium_public_health.disease.transition import (
|
20
21
|
ProportionTransition,
|
@@ -323,65 +324,41 @@ class DiseaseState(BaseDiseaseState):
|
|
323
324
|
self.clock = builder.time.clock()
|
324
325
|
|
325
326
|
prevalence_data = self.load_prevalence_data(builder)
|
326
|
-
self.prevalence =
|
327
|
-
prevalence_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
328
|
-
)
|
327
|
+
self.prevalence = self.get_prevalence(builder, prevalence_data)
|
329
328
|
|
330
329
|
birth_prevalence_data = self.load_birth_prevalence_data(builder)
|
331
|
-
self.birth_prevalence =
|
332
|
-
birth_prevalence_data, key_columns=["sex"], parameter_columns=["year"]
|
333
|
-
)
|
330
|
+
self.birth_prevalence = self.get_birth_prevalence(builder, birth_prevalence_data)
|
334
331
|
|
335
332
|
dwell_time_data = self.load_dwell_time_data(builder)
|
336
|
-
self.dwell_time =
|
337
|
-
f"{self.state_id}.dwell_time",
|
338
|
-
source=builder.lookup.build_table(
|
339
|
-
dwell_time_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
340
|
-
),
|
341
|
-
requires_columns=["age", "sex"],
|
342
|
-
)
|
333
|
+
self.dwell_time = self.get_dwell_time_pipeline(builder, dwell_time_data)
|
343
334
|
|
344
335
|
disability_weight_data = self.load_disability_weight_data(builder)
|
345
336
|
self.has_disability = is_non_zero(disability_weight_data)
|
346
|
-
self.base_disability_weight =
|
347
|
-
|
348
|
-
)
|
349
|
-
self.disability_weight = builder.value.register_value_producer(
|
350
|
-
f"{self.state_id}.disability_weight",
|
351
|
-
source=self.compute_disability_weight,
|
352
|
-
requires_columns=["age", "sex", "alive", self.model],
|
337
|
+
self.base_disability_weight = self.get_base_disability_weight(
|
338
|
+
builder, disability_weight_data
|
353
339
|
)
|
340
|
+
|
341
|
+
self.disability_weight = self.get_disability_weight_pipeline(builder)
|
342
|
+
|
354
343
|
builder.value.register_value_modifier(
|
355
344
|
"disability_weight", modifier=self.disability_weight
|
356
345
|
)
|
357
346
|
|
358
347
|
excess_mortality_data = self.load_excess_mortality_rate_data(builder)
|
359
348
|
self.has_excess_mortality = is_non_zero(excess_mortality_data)
|
360
|
-
self.base_excess_mortality_rate =
|
361
|
-
|
362
|
-
)
|
363
|
-
self.excess_mortality_rate = builder.value.register_rate_producer(
|
364
|
-
self.excess_mortality_rate_pipeline_name,
|
365
|
-
source=self.compute_excess_mortality_rate,
|
366
|
-
requires_columns=["age", "sex", "alive", self.model],
|
367
|
-
requires_values=[self.excess_mortality_rate_paf_pipeline_name],
|
368
|
-
)
|
369
|
-
paf = builder.lookup.build_table(0)
|
370
|
-
self.joint_paf = builder.value.register_value_producer(
|
371
|
-
self.excess_mortality_rate_paf_pipeline_name,
|
372
|
-
source=lambda idx: [paf(idx)],
|
373
|
-
preferred_combiner=list_combiner,
|
374
|
-
preferred_post_processor=union_post_processor,
|
349
|
+
self.base_excess_mortality_rate = self.get_base_excess_mortality_rate(
|
350
|
+
builder, excess_mortality_data
|
375
351
|
)
|
352
|
+
self.excess_mortality_rate = self.get_excess_mortality_rate_pipeline(builder)
|
353
|
+
self.joint_paf = self.get_joint_paf(builder)
|
354
|
+
|
376
355
|
builder.value.register_value_modifier(
|
377
356
|
"mortality_rate",
|
378
357
|
modifier=self.adjust_mortality_rate,
|
379
358
|
requires_values=[self.excess_mortality_rate_pipeline_name],
|
380
359
|
)
|
381
360
|
|
382
|
-
self.randomness_prevalence =
|
383
|
-
f"{self.state_id}_prevalent_cases"
|
384
|
-
)
|
361
|
+
self.randomness_prevalence = self.get_randomness_prevalence(builder)
|
385
362
|
|
386
363
|
#################
|
387
364
|
# Setup methods #
|
@@ -393,12 +370,26 @@ class DiseaseState(BaseDiseaseState):
|
|
393
370
|
else:
|
394
371
|
return builder.data.load(f"{self.cause_type}.{self.state_id}.prevalence")
|
395
372
|
|
373
|
+
def get_prevalence(
|
374
|
+
self, builder: Builder, prevalence_data: LookupTableData
|
375
|
+
) -> LookupTable:
|
376
|
+
return builder.lookup.build_table(
|
377
|
+
prevalence_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
378
|
+
)
|
379
|
+
|
396
380
|
def load_birth_prevalence_data(self, builder: Builder) -> LookupTableData:
|
397
381
|
if "birth_prevalence" in self._get_data_functions:
|
398
382
|
return self._get_data_functions["birth_prevalence"](builder, self.state_id)
|
399
383
|
else:
|
400
384
|
return 0
|
401
385
|
|
386
|
+
def get_birth_prevalence(
|
387
|
+
self, builder: Builder, birth_prevalence_data: LookupTableData
|
388
|
+
) -> LookupTable:
|
389
|
+
return builder.lookup.build_table(
|
390
|
+
birth_prevalence_data, key_columns=["sex"], parameter_columns=["year"]
|
391
|
+
)
|
392
|
+
|
402
393
|
def load_dwell_time_data(self, builder: Builder) -> LookupTableData:
|
403
394
|
if "dwell_time" in self._get_data_functions:
|
404
395
|
dwell_time = self._get_data_functions["dwell_time"](builder, self.state_id)
|
@@ -414,6 +405,17 @@ class DiseaseState(BaseDiseaseState):
|
|
414
405
|
|
415
406
|
return dwell_time
|
416
407
|
|
408
|
+
def get_dwell_time_pipeline(
|
409
|
+
self, builder: Builder, dwell_time_data: LookupTableData
|
410
|
+
) -> Pipeline:
|
411
|
+
return builder.value.register_value_producer(
|
412
|
+
f"{self.state_id}.dwell_time",
|
413
|
+
source=builder.lookup.build_table(
|
414
|
+
dwell_time_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
415
|
+
),
|
416
|
+
requires_columns=["age", "sex"],
|
417
|
+
)
|
418
|
+
|
417
419
|
def load_disability_weight_data(self, builder: Builder) -> LookupTableData:
|
418
420
|
if "disability_weight" in self._get_data_functions:
|
419
421
|
disability_weight = self._get_data_functions["disability_weight"](
|
@@ -429,6 +431,20 @@ class DiseaseState(BaseDiseaseState):
|
|
429
431
|
|
430
432
|
return disability_weight
|
431
433
|
|
434
|
+
def get_base_disability_weight(
|
435
|
+
self, builder: Builder, disability_weight_data: LookupTableData
|
436
|
+
) -> LookupTable:
|
437
|
+
return builder.lookup.build_table(
|
438
|
+
disability_weight_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
439
|
+
)
|
440
|
+
|
441
|
+
def get_disability_weight_pipeline(self, builder: Builder) -> Pipeline:
|
442
|
+
return builder.value.register_value_producer(
|
443
|
+
f"{self.state_id}.disability_weight",
|
444
|
+
source=self.compute_disability_weight,
|
445
|
+
requires_columns=["age", "sex", "alive", self.model],
|
446
|
+
)
|
447
|
+
|
432
448
|
def load_excess_mortality_rate_data(self, builder: Builder) -> LookupTableData:
|
433
449
|
if "excess_mortality_rate" in self._get_data_functions:
|
434
450
|
return self._get_data_functions["excess_mortality_rate"](builder, self.state_id)
|
@@ -439,6 +455,33 @@ class DiseaseState(BaseDiseaseState):
|
|
439
455
|
f"{self.cause_type}.{self.state_id}.excess_mortality_rate"
|
440
456
|
)
|
441
457
|
|
458
|
+
def get_base_excess_mortality_rate(
|
459
|
+
self, builder: Builder, excess_mortality_data: LookupTableData
|
460
|
+
) -> LookupTable:
|
461
|
+
return builder.lookup.build_table(
|
462
|
+
excess_mortality_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
463
|
+
)
|
464
|
+
|
465
|
+
def get_excess_mortality_rate_pipeline(self, builder: Builder) -> Pipeline:
|
466
|
+
return builder.value.register_rate_producer(
|
467
|
+
self.excess_mortality_rate_pipeline_name,
|
468
|
+
source=self.compute_excess_mortality_rate,
|
469
|
+
requires_columns=["age", "sex", "alive", self.model],
|
470
|
+
requires_values=[self.excess_mortality_rate_paf_pipeline_name],
|
471
|
+
)
|
472
|
+
|
473
|
+
def get_joint_paf(self, builder: Builder) -> Pipeline:
|
474
|
+
paf = builder.lookup.build_table(0)
|
475
|
+
return builder.value.register_value_producer(
|
476
|
+
self.excess_mortality_rate_paf_pipeline_name,
|
477
|
+
source=lambda idx: [paf(idx)],
|
478
|
+
preferred_combiner=list_combiner,
|
479
|
+
preferred_post_processor=union_post_processor,
|
480
|
+
)
|
481
|
+
|
482
|
+
def get_randomness_prevalence(self, builder: Builder) -> RandomnessStream:
|
483
|
+
return builder.randomness.get_stream(f"{self.state_id}_prevalent_cases")
|
484
|
+
|
442
485
|
##################
|
443
486
|
# Public methods #
|
444
487
|
##################
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium-public-health
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.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
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "2.0.2"
|
File without changes
|
File without changes
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.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-2.0.2 → vivarium_public_health-2.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-2.0.2 → vivarium_public_health-2.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
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.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
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/src/vivarium_public_health/__init__.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
|
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-2.0.2 → vivarium_public_health-2.1.1}/tests/disease/test_special_disease.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_disability.py
RENAMED
File without changes
|
File without changes
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_disease_observer.py
RENAMED
File without changes
|
File without changes
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/metrics/test_stratification.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
|
File without changes
|
File without changes
|
{vivarium_public_health-2.0.2 → vivarium_public_health-2.1.1}/tests/risks/test_distributions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|