vivarium-public-health 2.2.0__py3-none-any.whl → 2.2.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/population/data_transformations.py +14 -0
- vivarium_public_health/treatment/scale_up.py +7 -22
- {vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/METADATA +1 -1
- {vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/RECORD +8 -8
- {vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/LICENSE.txt +0 -0
- {vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/WHEEL +0 -0
- {vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
__version__ = "2.2.
|
1
|
+
__version__ = "2.2.2"
|
@@ -138,7 +138,21 @@ def rescale_binned_proportions(
|
|
138
138
|
pop_data.loc[padding_bin.index, columns_to_scale] += remainder
|
139
139
|
|
140
140
|
pop_data.loc[min_bin.index, "age_start"] = age_start
|
141
|
+
pop_data.loc[min_bin.index, "age"] = float(
|
142
|
+
(
|
143
|
+
pop_data.loc[min_bin.index, "age_start"].iloc[0]
|
144
|
+
+ pop_data.loc[min_bin.index, "age_end"].iloc[0]
|
145
|
+
)
|
146
|
+
/ 2
|
147
|
+
)
|
141
148
|
pop_data.loc[padding_bin.index, "age_end"] = age_start
|
149
|
+
pop_data.loc[padding_bin.index, "age"] = float(
|
150
|
+
(
|
151
|
+
pop_data.loc[padding_bin.index, "age_start"].iloc[0]
|
152
|
+
+ pop_data.loc[padding_bin.index, "age_end"].iloc[0]
|
153
|
+
)
|
154
|
+
/ 2
|
155
|
+
)
|
142
156
|
|
143
157
|
max_bin = sub_pop[(sub_pop["age_end"] > age_end) & (age_end >= sub_pop["age_start"])]
|
144
158
|
padding_bin = sub_pop[sub_pop["age_start"] == float(max_bin["age_end"].iloc[0])]
|
@@ -6,14 +6,13 @@ Linear Scale-Up Model
|
|
6
6
|
This module contains tools for applying a linear scale-up to an intervention
|
7
7
|
|
8
8
|
"""
|
9
|
-
from datetime import datetime
|
10
9
|
from typing import Any, Callable, Dict, Tuple
|
11
10
|
|
12
11
|
import pandas as pd
|
13
12
|
from vivarium import Component
|
14
13
|
from vivarium.framework.engine import Builder
|
15
14
|
from vivarium.framework.lookup import LookupTable
|
16
|
-
from vivarium.framework.time import Time
|
15
|
+
from vivarium.framework.time import Time
|
17
16
|
from vivarium.framework.values import Pipeline
|
18
17
|
|
19
18
|
from vivarium_public_health.utilities import EntityString
|
@@ -36,16 +35,10 @@ class LinearScaleUp(Component):
|
|
36
35
|
configuration:
|
37
36
|
treatment_scale_up:
|
38
37
|
start:
|
39
|
-
date:
|
40
|
-
year: 2020
|
41
|
-
month: 1
|
42
|
-
day: 1
|
38
|
+
date: "2020-01-01"
|
43
39
|
value: 0.0
|
44
40
|
end:
|
45
|
-
date:
|
46
|
-
year: 2020
|
47
|
-
month: 12
|
48
|
-
day: 31
|
41
|
+
date: "2020-12-31"
|
49
42
|
value: 0.9
|
50
43
|
|
51
44
|
"""
|
@@ -53,8 +46,8 @@ class LinearScaleUp(Component):
|
|
53
46
|
CONFIGURATION_DEFAULTS = {
|
54
47
|
"treatment": {
|
55
48
|
"date": {
|
56
|
-
"start": "
|
57
|
-
"end": "
|
49
|
+
"start": "2020-01-01",
|
50
|
+
"end": "2020-12-31",
|
58
51
|
},
|
59
52
|
"value": {
|
60
53
|
"start": "data",
|
@@ -114,17 +107,9 @@ class LinearScaleUp(Component):
|
|
114
107
|
return builder.time.clock()
|
115
108
|
|
116
109
|
# noinspection PyMethodMayBeStatic
|
117
|
-
def get_scale_up_dates(self, builder: Builder) -> Tuple[
|
110
|
+
def get_scale_up_dates(self, builder: Builder) -> Tuple[pd.Timestamp, pd.Timestamp]:
|
118
111
|
scale_up_config = builder.configuration[self.configuration_key]["date"]
|
119
|
-
|
120
|
-
def get_endpoint(endpoint_type: str) -> datetime:
|
121
|
-
if scale_up_config[endpoint_type] == endpoint_type:
|
122
|
-
endpoint = get_time_stamp(builder.configuration.time[endpoint_type])
|
123
|
-
else:
|
124
|
-
endpoint = get_time_stamp(scale_up_config[endpoint_type])
|
125
|
-
return endpoint
|
126
|
-
|
127
|
-
return get_endpoint("start"), get_endpoint("end")
|
112
|
+
return pd.Timestamp(scale_up_config["start"]), pd.Timestamp(scale_up_config["end"])
|
128
113
|
|
129
114
|
def get_scale_up_values(self, builder: Builder) -> Tuple[LookupTable, LookupTable]:
|
130
115
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vivarium_public_health
|
3
|
-
Version: 2.2.
|
3
|
+
Version: 2.2.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,6 +1,6 @@
|
|
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=toAYzE_ok1SiBE0AqAVdW0O8YCXCwcx0w4JATYQuJOg,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
|
@@ -26,7 +26,7 @@ vivarium_public_health/plugins/parser.py,sha256=uhBw5t-Lmb8YDN2GvVG93l50ZuCIsg4V
|
|
26
26
|
vivarium_public_health/population/__init__.py,sha256=17rtbcNVK5LtCCxAex7P7Q_vYpwbeTepyf3nazS90Yc,225
|
27
27
|
vivarium_public_health/population/add_new_birth_cohorts.py,sha256=qNsZjvaJ7Et8_Kw7JNyRshHHRA3pEQMM4TSqCp48Gr4,9092
|
28
28
|
vivarium_public_health/population/base_population.py,sha256=U9FibBoPuYWvUqPFCUIVwjBxQVuhTb58cUy-2EJSzio,15345
|
29
|
-
vivarium_public_health/population/data_transformations.py,sha256=
|
29
|
+
vivarium_public_health/population/data_transformations.py,sha256=PsvE1-S-Q_K4viBgF2Ss0DaaoH0WyhRX26ZJYwJ0O84,22322
|
30
30
|
vivarium_public_health/population/mortality.py,sha256=w1Oxb958LjUkNwxJ0vdA3TZndpeNiaH3d7RukLas_oQ,10085
|
31
31
|
vivarium_public_health/risks/__init__.py,sha256=XvX12RgD0iF5PBoc2StsOhxJmK1FP-RaAYrjIT9MfDs,232
|
32
32
|
vivarium_public_health/risks/base_risk.py,sha256=6D7YlxQOdQm-Kw5_vjpQmFqU7spF-lTy14WEEefRQlA,6494
|
@@ -40,10 +40,10 @@ vivarium_public_health/testing/mock_artifact.py,sha256=T6Fw0rSEGfDr7Lqq-YxcJBmZt
|
|
40
40
|
vivarium_public_health/testing/utils.py,sha256=bbAEGw5kRzVB_80uc5u5mp47NMj2xD6Nw7vlEsT_-Wg,2199
|
41
41
|
vivarium_public_health/treatment/__init__.py,sha256=wONElu9aJbBYwpYIovYPYaN_GYfVhPXtTeFWSdQMgA0,222
|
42
42
|
vivarium_public_health/treatment/magic_wand.py,sha256=iPKFN3VjfiMy_XvN94UqM-FUrGuI0ULwmOdAGdOepYQ,1979
|
43
|
-
vivarium_public_health/treatment/scale_up.py,sha256=
|
43
|
+
vivarium_public_health/treatment/scale_up.py,sha256=EkuEAmKaW7AvPWDqDa9WJ2Iy_yiKFytsJu8HVli5Lrg,7078
|
44
44
|
vivarium_public_health/treatment/therapeutic_inertia.py,sha256=VwZ7t90zzfGoBusduIvcE4lDe5zTvzmHiUNB3u2I52Y,2339
|
45
|
-
vivarium_public_health-2.2.
|
46
|
-
vivarium_public_health-2.2.
|
47
|
-
vivarium_public_health-2.2.
|
48
|
-
vivarium_public_health-2.2.
|
49
|
-
vivarium_public_health-2.2.
|
45
|
+
vivarium_public_health-2.2.2.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
|
46
|
+
vivarium_public_health-2.2.2.dist-info/METADATA,sha256=df-s-fZYuzBiLipOvirDKpAXcGzljkDaWgcDxHxIzBc,3531
|
47
|
+
vivarium_public_health-2.2.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
48
|
+
vivarium_public_health-2.2.2.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
|
49
|
+
vivarium_public_health-2.2.2.dist-info/RECORD,,
|
{vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/LICENSE.txt
RENAMED
File without changes
|
File without changes
|
{vivarium_public_health-2.2.0.dist-info → vivarium_public_health-2.2.2.dist-info}/top_level.txt
RENAMED
File without changes
|