vivarium-public-health 2.1.1__py3-none-any.whl → 2.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vivarium_public_health/_version.py +1 -1
- vivarium_public_health/disease/state.py +59 -0
- vivarium_public_health/population/mortality.py +40 -0
- vivarium_public_health/risks/effect.py +28 -0
- vivarium_public_health/treatment/scale_up.py +31 -0
- {vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/METADATA +1 -1
- {vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/RECORD +10 -10
- {vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/WHEEL +1 -1
- {vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/LICENSE.txt +0 -0
- {vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
__version__ = "2.1.
|
1
|
+
__version__ = "2.1.2"
|
@@ -373,6 +373,20 @@ class DiseaseState(BaseDiseaseState):
|
|
373
373
|
def get_prevalence(
|
374
374
|
self, builder: Builder, prevalence_data: LookupTableData
|
375
375
|
) -> LookupTable:
|
376
|
+
"""Builds a LookupTable for the prevalence of this state.
|
377
|
+
|
378
|
+
Parameters
|
379
|
+
----------
|
380
|
+
builder
|
381
|
+
Interface to access simulation managers.
|
382
|
+
prevalence_data
|
383
|
+
The data to use to build the LookupTable.
|
384
|
+
|
385
|
+
Returns
|
386
|
+
-------
|
387
|
+
LookupTable
|
388
|
+
The LookupTable for the prevalence of this state.
|
389
|
+
"""
|
376
390
|
return builder.lookup.build_table(
|
377
391
|
prevalence_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
378
392
|
)
|
@@ -386,6 +400,21 @@ class DiseaseState(BaseDiseaseState):
|
|
386
400
|
def get_birth_prevalence(
|
387
401
|
self, builder: Builder, birth_prevalence_data: LookupTableData
|
388
402
|
) -> LookupTable:
|
403
|
+
"""
|
404
|
+
Builds a LookupTable for the birth prevalence of this state.
|
405
|
+
|
406
|
+
Parameters
|
407
|
+
----------
|
408
|
+
builder
|
409
|
+
Interface to access simulation managers.
|
410
|
+
birth_prevalence_data
|
411
|
+
The data to use to build the LookupTable.
|
412
|
+
|
413
|
+
Returns
|
414
|
+
-------
|
415
|
+
LookupTable
|
416
|
+
The LookupTable for the birth prevalence of this state.
|
417
|
+
"""
|
389
418
|
return builder.lookup.build_table(
|
390
419
|
birth_prevalence_data, key_columns=["sex"], parameter_columns=["year"]
|
391
420
|
)
|
@@ -434,6 +463,21 @@ class DiseaseState(BaseDiseaseState):
|
|
434
463
|
def get_base_disability_weight(
|
435
464
|
self, builder: Builder, disability_weight_data: LookupTableData
|
436
465
|
) -> LookupTable:
|
466
|
+
"""
|
467
|
+
Builds a LookupTable for the base disability weight of this state.
|
468
|
+
|
469
|
+
Parameters
|
470
|
+
----------
|
471
|
+
builder
|
472
|
+
Interface to access simulation managers.
|
473
|
+
disability_weight_data
|
474
|
+
The data to use to build the LookupTable.
|
475
|
+
|
476
|
+
Returns
|
477
|
+
-------
|
478
|
+
LookupTable
|
479
|
+
The LookupTable for the disability weight of this state.
|
480
|
+
"""
|
437
481
|
return builder.lookup.build_table(
|
438
482
|
disability_weight_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
439
483
|
)
|
@@ -458,6 +502,21 @@ class DiseaseState(BaseDiseaseState):
|
|
458
502
|
def get_base_excess_mortality_rate(
|
459
503
|
self, builder: Builder, excess_mortality_data: LookupTableData
|
460
504
|
) -> LookupTable:
|
505
|
+
"""
|
506
|
+
Builds a LookupTable for the base excess mortality rate of this state.
|
507
|
+
|
508
|
+
Parameters
|
509
|
+
----------
|
510
|
+
builder
|
511
|
+
Interface to access simulation managers.
|
512
|
+
excess_mortality_data
|
513
|
+
The data to use to build the LookupTable.
|
514
|
+
|
515
|
+
Returns
|
516
|
+
-------
|
517
|
+
LookupTable
|
518
|
+
The LookupTable for the base excess mortality rate of this state.
|
519
|
+
"""
|
461
520
|
return builder.lookup.build_table(
|
462
521
|
excess_mortality_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
463
522
|
)
|
@@ -128,6 +128,19 @@ class Mortality(Component):
|
|
128
128
|
|
129
129
|
# noinspection PyMethodMayBeStatic
|
130
130
|
def get_all_cause_mortality_rate(self, builder: Builder) -> Union[LookupTable, Pipeline]:
|
131
|
+
"""
|
132
|
+
Load all cause mortality rate data and build a lookup table or pipeline.
|
133
|
+
|
134
|
+
Parameters
|
135
|
+
----------
|
136
|
+
builder
|
137
|
+
Interface to access simulation managers.
|
138
|
+
|
139
|
+
Returns
|
140
|
+
-------
|
141
|
+
Union[LookupTable, Pipeline]
|
142
|
+
A lookup table or pipeline returning the all cause mortality rate.
|
143
|
+
"""
|
131
144
|
acmr_data = builder.data.load("cause.all_causes.cause_specific_mortality_rate")
|
132
145
|
return builder.lookup.build_table(
|
133
146
|
acmr_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
@@ -135,6 +148,19 @@ class Mortality(Component):
|
|
135
148
|
|
136
149
|
# noinspection PyMethodMayBeStatic
|
137
150
|
def get_life_expectancy(self, builder: Builder) -> Union[LookupTable, Pipeline]:
|
151
|
+
"""
|
152
|
+
Load life expectancy data and build a lookup table or pipeline.
|
153
|
+
|
154
|
+
Parameters
|
155
|
+
----------
|
156
|
+
builder
|
157
|
+
Interface to access simulation managers.
|
158
|
+
|
159
|
+
Returns
|
160
|
+
-------
|
161
|
+
Union[LookupTable, Pipeline]
|
162
|
+
A lookup table or pipeline returning the life expectancy.
|
163
|
+
"""
|
138
164
|
life_expectancy_data = builder.data.load(
|
139
165
|
"population.theoretical_minimum_risk_life_expectancy"
|
140
166
|
)
|
@@ -142,6 +168,20 @@ class Mortality(Component):
|
|
142
168
|
|
143
169
|
# noinspection PyMethodMayBeStatic
|
144
170
|
def get_raw_unmodeled_csmr(self, builder: Builder) -> Union[LookupTable, Pipeline]:
|
171
|
+
"""
|
172
|
+
Load unmodeled cause specific mortality rate data and build a lookup
|
173
|
+
table or pipeline.
|
174
|
+
|
175
|
+
Parameters
|
176
|
+
----------
|
177
|
+
builder
|
178
|
+
Interface to access simulation managers.
|
179
|
+
|
180
|
+
Returns
|
181
|
+
-------
|
182
|
+
Union[LookupTable, Pipeline]
|
183
|
+
A lookup table or pipeline returning the unmodeled csmr.
|
184
|
+
"""
|
145
185
|
unmodeled_causes = builder.configuration.unmodeled_causes
|
146
186
|
raw_csmr = 0.0
|
147
187
|
for idx, cause in enumerate(unmodeled_causes):
|
@@ -121,12 +121,40 @@ class RiskEffect(Component):
|
|
121
121
|
return builder.value.get_value(self.exposure_pipeline_name)
|
122
122
|
|
123
123
|
def get_relative_risk_source(self, builder: Builder) -> LookupTable:
|
124
|
+
"""
|
125
|
+
Get the relative risk source for this risk effect model.
|
126
|
+
|
127
|
+
Parameters
|
128
|
+
----------
|
129
|
+
builder
|
130
|
+
Interface to access simulation managers.
|
131
|
+
|
132
|
+
Returns
|
133
|
+
-------
|
134
|
+
LookupTable
|
135
|
+
A lookup table containing the relative risk data for this risk
|
136
|
+
effect model.
|
137
|
+
"""
|
124
138
|
relative_risk_data = get_relative_risk_data(builder, self.risk, self.target)
|
125
139
|
return builder.lookup.build_table(
|
126
140
|
relative_risk_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
127
141
|
)
|
128
142
|
|
129
143
|
def get_population_attributable_fraction_source(self, builder: Builder) -> LookupTable:
|
144
|
+
"""
|
145
|
+
Get the population attributable fraction source for this risk effect model.
|
146
|
+
|
147
|
+
Parameters
|
148
|
+
----------
|
149
|
+
builder
|
150
|
+
Interface to access simulation managers.
|
151
|
+
|
152
|
+
Returns
|
153
|
+
-------
|
154
|
+
LookupTable
|
155
|
+
A lookup table containing the population attributable fraction data
|
156
|
+
for this risk effect model.
|
157
|
+
"""
|
130
158
|
paf_data = get_population_attributable_fraction_data(builder, self.risk, self.target)
|
131
159
|
return builder.lookup.build_table(
|
132
160
|
paf_data, key_columns=["sex"], parameter_columns=["age", "year"]
|
@@ -127,6 +127,20 @@ class LinearScaleUp(Component):
|
|
127
127
|
return get_endpoint("start"), get_endpoint("end")
|
128
128
|
|
129
129
|
def get_scale_up_values(self, builder: Builder) -> Tuple[LookupTable, LookupTable]:
|
130
|
+
"""
|
131
|
+
Get the values at the start and end of the scale-up period.
|
132
|
+
|
133
|
+
Parameters
|
134
|
+
----------
|
135
|
+
builder
|
136
|
+
Interface to access simulation managers.
|
137
|
+
|
138
|
+
Returns
|
139
|
+
-------
|
140
|
+
LookupTable
|
141
|
+
A tuple of lookup tables returning the values at the start and end
|
142
|
+
of the scale-up period.
|
143
|
+
"""
|
130
144
|
scale_up_config = builder.configuration[self.configuration_key]["value"]
|
131
145
|
|
132
146
|
def get_endpoint_value(endpoint_type: str) -> LookupTable:
|
@@ -172,6 +186,23 @@ class LinearScaleUp(Component):
|
|
172
186
|
def get_endpoint_value_from_data(
|
173
187
|
self, builder: Builder, endpoint_type: str
|
174
188
|
) -> LookupTable:
|
189
|
+
"""
|
190
|
+
Get the value at the start or end of the scale-up period from data.
|
191
|
+
|
192
|
+
Parameters
|
193
|
+
----------
|
194
|
+
builder
|
195
|
+
Interface to access simulation managers.
|
196
|
+
endpoint_type
|
197
|
+
The type of endpoint to get the value for. Allowed values are
|
198
|
+
"start" and "end".
|
199
|
+
|
200
|
+
Returns
|
201
|
+
-------
|
202
|
+
LookupTable
|
203
|
+
A lookup table returning the value at the start or end of the
|
204
|
+
scale-up period.
|
205
|
+
"""
|
175
206
|
if endpoint_type == "start":
|
176
207
|
endpoint_data = builder.data.load(f"{self.treatment}.exposure")
|
177
208
|
elif endpoint_type == "end":
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium-public-health
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.2
|
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,12 +1,12 @@
|
|
1
1
|
vivarium_public_health/__about__.py,sha256=RgWycPypKZS80TpSX7o41cREnG8PfguNHDHLuLyl820,487
|
2
2
|
vivarium_public_health/__init__.py,sha256=tomMOl3PI7O8GdxDWGBiBjT0Bwd31GpyQTYTzwIv108,361
|
3
|
-
vivarium_public_health/_version.py,sha256=
|
3
|
+
vivarium_public_health/_version.py,sha256=UiuBcRXPtXxPUBDdp0ZDvWl0U9Db1kMNfT3oAfhxqLg,22
|
4
4
|
vivarium_public_health/utilities.py,sha256=_X9sZQ7flsi2sVWQ9zrf8GJw8QwZsPZm3NUjx1gu7bM,2555
|
5
5
|
vivarium_public_health/disease/__init__.py,sha256=RuuiRcvAJfX9WQGt_WZZjxN7Cu3E5rMTmuaRS-UaFPM,419
|
6
6
|
vivarium_public_health/disease/model.py,sha256=7xFGo6JqPjQjm2VUZ3u3ThXWSzmitTOCZ8N9PTTL6MU,8253
|
7
7
|
vivarium_public_health/disease/models.py,sha256=uiB2qUlxBsPPPmHJ8Cgot_T1ItZ8RYSNVOBtxtn93Y0,3478
|
8
8
|
vivarium_public_health/disease/special_disease.py,sha256=gl8aK0z6afCxiCZxgJafLe4xmbR91zk3079hsi2pUAw,14751
|
9
|
-
vivarium_public_health/disease/state.py,sha256=
|
9
|
+
vivarium_public_health/disease/state.py,sha256=TBbUQ8zALN5BdpJM2WPUYYhlZ4xcu-UXKc3rOZUj72Y,24403
|
10
10
|
vivarium_public_health/disease/transition.py,sha256=Or5nucRzeGG-UuE_CGkPZ9qE35-Ed9I9LWHj4rjknCc,5334
|
11
11
|
vivarium_public_health/metrics/__init__.py,sha256=bWAvvdCm_7RPIazo12qFohA2x5-_EV6ceV8IhKS37sk,209
|
12
12
|
vivarium_public_health/metrics/disability.py,sha256=zm0vAG00wj44CHjYGdT2_pebgARa3XXIerrR06t80rc,3984
|
@@ -25,12 +25,12 @@ vivarium_public_health/population/__init__.py,sha256=17rtbcNVK5LtCCxAex7P7Q_vYpw
|
|
25
25
|
vivarium_public_health/population/add_new_birth_cohorts.py,sha256=qNsZjvaJ7Et8_Kw7JNyRshHHRA3pEQMM4TSqCp48Gr4,9092
|
26
26
|
vivarium_public_health/population/base_population.py,sha256=U9FibBoPuYWvUqPFCUIVwjBxQVuhTb58cUy-2EJSzio,15345
|
27
27
|
vivarium_public_health/population/data_transformations.py,sha256=M1qZlDyWGQsVR33LtrKW2ts1OIXOT2TYoQEtjzXQ_1k,21804
|
28
|
-
vivarium_public_health/population/mortality.py,sha256=
|
28
|
+
vivarium_public_health/population/mortality.py,sha256=w1Oxb958LjUkNwxJ0vdA3TZndpeNiaH3d7RukLas_oQ,10085
|
29
29
|
vivarium_public_health/risks/__init__.py,sha256=XvX12RgD0iF5PBoc2StsOhxJmK1FP-RaAYrjIT9MfDs,232
|
30
30
|
vivarium_public_health/risks/base_risk.py,sha256=6D7YlxQOdQm-Kw5_vjpQmFqU7spF-lTy14WEEefRQlA,6494
|
31
31
|
vivarium_public_health/risks/data_transformations.py,sha256=-nEbytxaQEB1zaAacA46A3WATeKle2FvrnePx-NPCeg,19602
|
32
32
|
vivarium_public_health/risks/distributions.py,sha256=EYMjhOmci4O7orU2-qQ55uOzqplqByn4GokbKgcZgfQ,10800
|
33
|
-
vivarium_public_health/risks/effect.py,sha256=
|
33
|
+
vivarium_public_health/risks/effect.py,sha256=GH_n5j6RQY-DdV0hSH-_Qo10lXVZRdMyANh6wfrLtiI,7295
|
34
34
|
vivarium_public_health/risks/implementations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
35
35
|
vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py,sha256=G8-KMklSwd2Sl29oMX8WFPKKv1tBtRUOqLuAmoxOos0,18027
|
36
36
|
vivarium_public_health/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -38,10 +38,10 @@ vivarium_public_health/testing/mock_artifact.py,sha256=T6Fw0rSEGfDr7Lqq-YxcJBmZt
|
|
38
38
|
vivarium_public_health/testing/utils.py,sha256=bbAEGw5kRzVB_80uc5u5mp47NMj2xD6Nw7vlEsT_-Wg,2199
|
39
39
|
vivarium_public_health/treatment/__init__.py,sha256=wONElu9aJbBYwpYIovYPYaN_GYfVhPXtTeFWSdQMgA0,222
|
40
40
|
vivarium_public_health/treatment/magic_wand.py,sha256=iPKFN3VjfiMy_XvN94UqM-FUrGuI0ULwmOdAGdOepYQ,1979
|
41
|
-
vivarium_public_health/treatment/scale_up.py,sha256=
|
41
|
+
vivarium_public_health/treatment/scale_up.py,sha256=7QKBgAII4dwkds9gdbQ5d6oDaD02iwcQCVcYRN-B4Mg,7573
|
42
42
|
vivarium_public_health/treatment/therapeutic_inertia.py,sha256=VwZ7t90zzfGoBusduIvcE4lDe5zTvzmHiUNB3u2I52Y,2339
|
43
|
-
vivarium_public_health-2.1.
|
44
|
-
vivarium_public_health-2.1.
|
45
|
-
vivarium_public_health-2.1.
|
46
|
-
vivarium_public_health-2.1.
|
47
|
-
vivarium_public_health-2.1.
|
43
|
+
vivarium_public_health-2.1.2.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
|
44
|
+
vivarium_public_health-2.1.2.dist-info/METADATA,sha256=3LZgXExgpesqC24nJKzasGyEaGqiS9NVAmbuVUNMEAM,3430
|
45
|
+
vivarium_public_health-2.1.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
46
|
+
vivarium_public_health-2.1.2.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
|
47
|
+
vivarium_public_health-2.1.2.dist-info/RECORD,,
|
{vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/LICENSE.txt
RENAMED
File without changes
|
{vivarium_public_health-2.1.1.dist-info → vivarium_public_health-2.1.2.dist-info}/top_level.txt
RENAMED
File without changes
|