vivarium-public-health 3.1.1__py3-none-any.whl → 3.1.3__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.
Files changed (34) hide show
  1. vivarium_public_health/_version.py +1 -1
  2. vivarium_public_health/disease/model.py +12 -20
  3. vivarium_public_health/disease/special_disease.py +5 -5
  4. vivarium_public_health/disease/state.py +18 -17
  5. vivarium_public_health/disease/transition.py +9 -8
  6. vivarium_public_health/mslt/delay.py +5 -5
  7. vivarium_public_health/mslt/disease.py +5 -5
  8. vivarium_public_health/mslt/intervention.py +8 -8
  9. vivarium_public_health/mslt/magic_wand_components.py +3 -3
  10. vivarium_public_health/mslt/observer.py +4 -6
  11. vivarium_public_health/mslt/population.py +4 -6
  12. vivarium_public_health/plugins/parser.py +18 -19
  13. vivarium_public_health/population/add_new_birth_cohorts.py +3 -5
  14. vivarium_public_health/population/base_population.py +8 -10
  15. vivarium_public_health/population/data_transformations.py +4 -5
  16. vivarium_public_health/population/mortality.py +6 -6
  17. vivarium_public_health/results/disability.py +1 -3
  18. vivarium_public_health/results/disease.py +5 -5
  19. vivarium_public_health/results/mortality.py +3 -3
  20. vivarium_public_health/results/observer.py +7 -7
  21. vivarium_public_health/results/risk.py +3 -3
  22. vivarium_public_health/risks/base_risk.py +4 -4
  23. vivarium_public_health/risks/distributions.py +15 -15
  24. vivarium_public_health/risks/effect.py +45 -33
  25. vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +20 -20
  26. vivarium_public_health/treatment/magic_wand.py +3 -3
  27. vivarium_public_health/treatment/scale_up.py +6 -5
  28. vivarium_public_health/utilities.py +4 -5
  29. {vivarium_public_health-3.1.1.dist-info → vivarium_public_health-3.1.3.dist-info}/METADATA +32 -32
  30. vivarium_public_health-3.1.3.dist-info/RECORD +49 -0
  31. {vivarium_public_health-3.1.1.dist-info → vivarium_public_health-3.1.3.dist-info}/WHEEL +1 -1
  32. vivarium_public_health-3.1.1.dist-info/RECORD +0 -49
  33. {vivarium_public_health-3.1.1.dist-info → vivarium_public_health-3.1.3.dist-info}/LICENSE.txt +0 -0
  34. {vivarium_public_health-3.1.1.dist-info → vivarium_public_health-3.1.3.dist-info}/top_level.txt +0 -0
@@ -7,9 +7,9 @@ This module contains tools for modeling the relationship between risk
7
7
  exposure models and disease models.
8
8
 
9
9
  """
10
-
10
+ from collections.abc import Callable
11
11
  from importlib import import_module
12
- from typing import Any, Callable, Dict, List, Tuple, Union
12
+ from typing import Any
13
13
 
14
14
  import numpy as np
15
15
  import pandas as pd
@@ -17,6 +17,7 @@ import scipy
17
17
  from layered_config_tree import ConfigurationError
18
18
  from vivarium import Component
19
19
  from vivarium.framework.engine import Builder
20
+ from vivarium.framework.values import Pipeline
20
21
 
21
22
  from vivarium_public_health.risks import Risk
22
23
  from vivarium_public_health.risks.data_transformations import (
@@ -58,7 +59,7 @@ class RiskEffect(Component):
58
59
  return f"risk_effect.{risk.name}_on_{target}"
59
60
 
60
61
  @property
61
- def configuration_defaults(self) -> Dict[str, Any]:
62
+ def configuration_defaults(self) -> dict[str, Any]:
62
63
  """Default values for any configurations managed by this component."""
63
64
  return {
64
65
  self.name: {
@@ -112,7 +113,8 @@ class RiskEffect(Component):
112
113
  def setup(self, builder: Builder) -> None:
113
114
  self.exposure = self.get_risk_exposure(builder)
114
115
 
115
- self.target_modifier = self.get_target_modifier(builder)
116
+ self._relative_risk_source = self.get_relative_risk_source(builder)
117
+ self.relative_risk = self.get_relative_risk(builder)
116
118
 
117
119
  self.register_target_modifier(builder)
118
120
  self.register_paf_modifier(builder)
@@ -124,7 +126,7 @@ class RiskEffect(Component):
124
126
  def build_all_lookup_tables(self, builder: Builder) -> None:
125
127
  self._exposure_distribution_type = self.get_distribution_type(builder)
126
128
 
127
- rr_data = self.get_relative_risk_data(builder)
129
+ rr_data = self.load_relative_risk(builder)
128
130
  rr_value_cols = None
129
131
  if self.is_exposure_categorical:
130
132
  rr_data, rr_value_cols = self.process_categorical_data(builder, rr_data)
@@ -146,11 +148,11 @@ class RiskEffect(Component):
146
148
  return risk_exposure_component.distribution_type
147
149
  return risk_exposure_component.get_distribution_type(builder)
148
150
 
149
- def get_relative_risk_data(
151
+ def load_relative_risk(
150
152
  self,
151
153
  builder: Builder,
152
154
  configuration=None,
153
- ) -> Union[str, float, pd.DataFrame]:
155
+ ) -> str | float | pd.DataFrame:
154
156
  if configuration is None:
155
157
  configuration = self.configuration
156
158
 
@@ -173,8 +175,8 @@ class RiskEffect(Component):
173
175
  return rr_data
174
176
 
175
177
  def get_filtered_data(
176
- self, builder: "Builder", data_source: Union[str, float, pd.DataFrame]
177
- ) -> Union[float, pd.DataFrame]:
178
+ self, builder: "Builder", data_source: str | float | pd.DataFrame
179
+ ) -> float | pd.DataFrame:
178
180
  data = super().get_data(builder, data_source)
179
181
 
180
182
  if isinstance(data, pd.DataFrame):
@@ -191,8 +193,8 @@ class RiskEffect(Component):
191
193
  return data
192
194
 
193
195
  def process_categorical_data(
194
- self, builder: Builder, rr_data: Union[str, float, pd.DataFrame]
195
- ) -> Tuple[Union[str, float, pd.DataFrame], List[str]]:
196
+ self, builder: Builder, rr_data: str | float | pd.DataFrame
197
+ ) -> tuple[str | float | pd.DataFrame, list[str]]:
196
198
  if not isinstance(rr_data, pd.DataFrame):
197
199
  cat1 = builder.data.load("population.demographic_dimensions")
198
200
  cat1["parameter"] = "cat1"
@@ -260,24 +262,27 @@ class RiskEffect(Component):
260
262
  def get_risk_exposure(self, builder: Builder) -> Callable[[pd.Index], pd.Series]:
261
263
  return builder.value.get_value(self.exposure_pipeline_name)
262
264
 
263
- def get_target_modifier(
264
- self, builder: Builder
265
- ) -> Callable[[pd.Index, pd.Series], pd.Series]:
265
+ def adjust_target(self, index: pd.Index, target: pd.Series) -> pd.Series:
266
+ relative_risk = self.relative_risk(index)
267
+ return target * relative_risk
268
+
269
+ def get_relative_risk_source(self, builder: Builder) -> Callable[[pd.Index], pd.Series]:
270
+
266
271
  if not self.is_exposure_categorical:
267
272
  tmred = builder.data.load(f"{self.risk}.tmred")
268
273
  tmrel = 0.5 * (tmred["min"] + tmred["max"])
269
274
  scale = builder.data.load(f"{self.risk}.relative_risk_scalar")
270
275
 
271
- def adjust_target(index: pd.Index, target: pd.Series) -> pd.Series:
276
+ def generate_relative_risk(index: pd.Index) -> pd.Series:
272
277
  rr = self.lookup_tables["relative_risk"](index)
273
278
  exposure = self.exposure(index)
274
279
  relative_risk = np.maximum(rr.values ** ((exposure - tmrel) / scale), 1)
275
- return target * relative_risk
280
+ return relative_risk
276
281
 
277
282
  else:
278
283
  index_columns = ["index", self.risk.name]
279
284
 
280
- def adjust_target(index: pd.Index, target: pd.Series) -> pd.Series:
285
+ def generate_relative_risk(index: pd.Index) -> pd.Series:
281
286
  rr = self.lookup_tables["relative_risk"](index)
282
287
  exposure = self.exposure(index).reset_index()
283
288
  exposure.columns = index_columns
@@ -288,16 +293,24 @@ class RiskEffect(Component):
288
293
  relative_risk = relative_risk.set_index(index_columns)
289
294
 
290
295
  effect = relative_risk.loc[exposure.index, "value"].droplevel(self.risk.name)
291
- affected_rates = target * effect
292
- return affected_rates
296
+ return effect
293
297
 
294
- return adjust_target
298
+ return generate_relative_risk
299
+
300
+ def get_relative_risk(self, builder: Builder) -> Pipeline:
301
+ return builder.value.register_value_producer(
302
+ f"{self.risk.name}_on_{self.target.name}.relative_risk",
303
+ self._relative_risk_source,
304
+ component=self,
305
+ required_resources=[self.exposure],
306
+ )
295
307
 
296
308
  def register_target_modifier(self, builder: Builder) -> None:
297
309
  builder.value.register_value_modifier(
298
310
  self.target_pipeline_name,
299
- modifier=self.target_modifier,
300
- requires_values=[f"{self.risk.name}.exposure"],
311
+ modifier=self.adjust_target,
312
+ component=self,
313
+ required_resources=[self.relative_risk],
301
314
  )
302
315
 
303
316
  def register_paf_modifier(self, builder: Builder) -> None:
@@ -307,7 +320,8 @@ class RiskEffect(Component):
307
320
  builder.value.register_value_modifier(
308
321
  self.target_paf_pipeline_name,
309
322
  modifier=self.lookup_tables["population_attributable_fraction"],
310
- requires_columns=required_columns,
323
+ component=self,
324
+ required_resources=required_columns,
311
325
  )
312
326
 
313
327
  ##################
@@ -347,7 +361,7 @@ class NonLogLinearRiskEffect(RiskEffect):
347
361
  ##############
348
362
 
349
363
  @property
350
- def configuration_defaults(self) -> Dict[str, Any]:
364
+ def configuration_defaults(self) -> dict[str, Any]:
351
365
  """Default values for any configurations managed by this component."""
352
366
  return {
353
367
  self.name: {
@@ -371,7 +385,7 @@ class NonLogLinearRiskEffect(RiskEffect):
371
385
  return f"non_log_linear_risk_effect.{risk.name}_on_{target}"
372
386
 
373
387
  def build_all_lookup_tables(self, builder: Builder) -> None:
374
- rr_data = self.get_relative_risk_data(builder)
388
+ rr_data = self.load_relative_risk(builder)
375
389
  self.validate_rr_data(rr_data)
376
390
 
377
391
  def define_rr_intervals(df: pd.DataFrame) -> pd.DataFrame:
@@ -415,11 +429,11 @@ class NonLogLinearRiskEffect(RiskEffect):
415
429
  builder, paf_data
416
430
  )
417
431
 
418
- def get_relative_risk_data(
432
+ def load_relative_risk(
419
433
  self,
420
434
  builder: Builder,
421
435
  configuration=None,
422
- ) -> Union[str, float, pd.DataFrame]:
436
+ ) -> str | float | pd.DataFrame:
423
437
  if configuration is None:
424
438
  configuration = self.configuration
425
439
 
@@ -472,10 +486,8 @@ class NonLogLinearRiskEffect(RiskEffect):
472
486
 
473
487
  return rr_data
474
488
 
475
- def get_target_modifier(
476
- self, builder: Builder
477
- ) -> Callable[[pd.Index, pd.Series], pd.Series]:
478
- def adjust_target(index: pd.Index, target: pd.Series) -> pd.Series:
489
+ def get_relative_risk_source(self, builder: Builder) -> Callable[[pd.Index], pd.Series]:
490
+ def generate_relative_risk(index: pd.Index) -> pd.Series:
479
491
  rr_intervals = self.lookup_tables["relative_risk"](index)
480
492
  exposure = self.population_view.get(index)[f"{self.risk.name}_exposure"]
481
493
  x1, x2 = (
@@ -486,9 +498,9 @@ class NonLogLinearRiskEffect(RiskEffect):
486
498
  m = (y2 - y1) / (x2 - x1)
487
499
  b = y1 - m * x1
488
500
  relative_risk = b + m * exposure
489
- return target * relative_risk
501
+ return relative_risk
490
502
 
491
- return adjust_target
503
+ return generate_relative_risk
492
504
 
493
505
  ##############
494
506
  # Validators #
@@ -9,7 +9,8 @@ implementation that has been used in several public health models.
9
9
  """
10
10
 
11
11
  import pickle
12
- from typing import Any, Callable, Dict, List, Optional, Tuple
12
+ from collections.abc import Callable
13
+ from typing import Any
13
14
 
14
15
  import numpy as np
15
16
  import pandas as pd
@@ -39,7 +40,7 @@ class LBWSGDistribution(PolytomousDistribution):
39
40
  super().setup(builder)
40
41
  self.category_intervals = self.get_category_intervals(builder)
41
42
 
42
- def get_category_intervals(self, builder: Builder) -> Dict[str, Dict[str, pd.Interval]]:
43
+ def get_category_intervals(self, builder: Builder) -> dict[str, dict[str, pd.Interval]]:
43
44
  """Gets the intervals for each category.
44
45
 
45
46
  Parameters
@@ -51,7 +52,7 @@ class LBWSGDistribution(PolytomousDistribution):
51
52
  -------
52
53
  The intervals for each category.
53
54
  """
54
- categories: Dict[str, str] = builder.data.load(f"{self.risk}.categories")
55
+ categories: dict[str, str] = builder.data.load(f"{self.risk}.categories")
55
56
  category_intervals = {
56
57
  axis: {
57
58
  category: self._parse_description(axis, description)
@@ -96,8 +97,8 @@ class LBWSGDistribution(PolytomousDistribution):
96
97
  self,
97
98
  axis: str,
98
99
  propensity: pd.Series,
99
- categorical_propensity: Optional[pd.Series] = None,
100
- categorical_exposure: Optional[pd.Series] = None,
100
+ categorical_propensity: pd.Series | None = None,
101
+ categorical_exposure: pd.Series | None = None,
101
102
  ) -> pd.Series:
102
103
  """Calculate continuous exposures from propensities for a single axis.
103
104
 
@@ -199,13 +200,13 @@ class LBWSGRisk(Risk):
199
200
  ##############
200
201
 
201
202
  @property
202
- def configuration_defaults(self) -> Dict[str, Any]:
203
+ def configuration_defaults(self) -> dict[str, Any]:
203
204
  configuration_defaults = super().configuration_defaults
204
205
  configuration_defaults[self.name]["distribution_type"] = "lbwsg"
205
206
  return configuration_defaults
206
207
 
207
208
  @property
208
- def columns_created(self) -> List[str]:
209
+ def columns_created(self) -> list[str]:
209
210
  return [self.get_exposure_column_name(axis) for axis in self.AXES]
210
211
 
211
212
  #####################
@@ -224,15 +225,15 @@ class LBWSGRisk(Risk):
224
225
  # Setup methods #
225
226
  #################
226
227
 
227
- def get_propensity_pipeline(self, builder: Builder) -> Optional[Pipeline]:
228
+ def get_propensity_pipeline(self, builder: Builder) -> Pipeline | None:
228
229
  # Propensity only used on initialization; not being saved to avoid a cycle
229
230
  return None
230
231
 
231
- def get_exposure_pipeline(self, builder: Builder) -> Optional[Pipeline]:
232
+ def get_exposure_pipeline(self, builder: Builder) -> Pipeline | None:
232
233
  # Exposure only used on initialization; not being saved to avoid a cycle
233
234
  return None
234
235
 
235
- def get_birth_exposure_pipelines(self, builder: Builder) -> Dict[str, Pipeline]:
236
+ def get_birth_exposure_pipelines(self, builder: Builder) -> dict[str, Pipeline]:
236
237
  required_columns = get_lookup_columns(
237
238
  self.exposure_distribution.lookup_tables.values()
238
239
  )
@@ -291,15 +292,15 @@ class LBWSGRiskEffect(RiskEffect):
291
292
  ##############
292
293
 
293
294
  @property
294
- def columns_created(self) -> List[str]:
295
+ def columns_created(self) -> list[str]:
295
296
  return self.rr_column_names
296
297
 
297
298
  @property
298
- def columns_required(self) -> Optional[List[str]]:
299
+ def columns_required(self) -> list[str] | None:
299
300
  return ["age", "sex"] + self.lbwsg_exposure_column_names
300
301
 
301
302
  @property
302
- def initialization_requirements(self) -> Dict[str, List[str]]:
303
+ def initialization_requirements(self) -> dict[str, list[str]]:
303
304
  return {
304
305
  "requires_columns": ["sex"] + self.lbwsg_exposure_column_names,
305
306
  "requires_values": [],
@@ -307,7 +308,7 @@ class LBWSGRiskEffect(RiskEffect):
307
308
  }
308
309
 
309
310
  @property
310
- def rr_column_names(self) -> List[str]:
311
+ def rr_column_names(self) -> list[str]:
311
312
  return [self.relative_risk_column_name(age_group) for age_group in self.age_intervals]
312
313
 
313
314
  #####################
@@ -335,7 +336,6 @@ class LBWSGRiskEffect(RiskEffect):
335
336
 
336
337
  super().setup(builder)
337
338
  self.interpolator = self.get_interpolator(builder)
338
- self.relative_risk = self.get_relative_risk_pipeline(builder)
339
339
 
340
340
  #################
341
341
  # Setup methods #
@@ -356,7 +356,7 @@ class LBWSGRiskEffect(RiskEffect):
356
356
 
357
357
  def get_population_attributable_fraction_source(
358
358
  self, builder: Builder
359
- ) -> Tuple[pd.DataFrame, List[str]]:
359
+ ) -> tuple[pd.DataFrame, list[str]]:
360
360
  paf_key = f"{self.risk}.population_attributable_fraction"
361
361
  paf_data = builder.data.load(paf_key)
362
362
  return paf_data, builder.data.value_columns()(paf_key)
@@ -376,7 +376,7 @@ class LBWSGRiskEffect(RiskEffect):
376
376
  requires_values=[self.relative_risk_pipeline_name],
377
377
  )
378
378
 
379
- def get_age_intervals(self, builder: Builder) -> Dict[str, pd.Interval]:
379
+ def get_age_intervals(self, builder: Builder) -> dict[str, pd.Interval]:
380
380
  age_bins = builder.data.load("population.age_bins").set_index("age_start")
381
381
  exposure = builder.data.load(f"{self.risk}.exposure")
382
382
  exposure = exposure[exposure["age_end"] > 0]
@@ -392,10 +392,10 @@ class LBWSGRiskEffect(RiskEffect):
392
392
  for age_start in exposed_age_group_starts
393
393
  }
394
394
 
395
- def get_relative_risk_pipeline(self, builder: Builder) -> Pipeline:
395
+ def get_relative_risk(self, builder: Builder) -> Pipeline:
396
396
  return builder.value.register_value_producer(
397
397
  self.relative_risk_pipeline_name,
398
- source=self.get_relative_risk,
398
+ source=self.get_relative_risk_source,
399
399
  requires_columns=["age"] + self.rr_column_names,
400
400
  )
401
401
 
@@ -469,7 +469,7 @@ class LBWSGRiskEffect(RiskEffect):
469
469
  # Pipeline sources and modifiers #
470
470
  ##################################
471
471
 
472
- def get_relative_risk(self, index: pd.Index) -> pd.Series:
472
+ def get_relative_risk_source(self, index: pd.Index) -> pd.Series:
473
473
  pop = self.population_view.get(index)
474
474
  relative_risk = pd.Series(1.0, index=index, name=self.relative_risk_pipeline_name)
475
475
 
@@ -8,7 +8,7 @@ level by providing direct shifts to epidemiological measures.
8
8
 
9
9
  """
10
10
 
11
- from typing import Any, Dict, List, Optional
11
+ from typing import Any
12
12
 
13
13
  from vivarium import Component
14
14
  from vivarium.framework.engine import Builder
@@ -30,13 +30,13 @@ class AbsoluteShift(Component):
30
30
  ##############
31
31
 
32
32
  @property
33
- def configuration_defaults(self) -> Dict[str, Any]:
33
+ def configuration_defaults(self) -> dict[str, Any]:
34
34
  return {
35
35
  f"intervention_on_{self.target.name}": self.CONFIGURATION_DEFAULTS["intervention"]
36
36
  }
37
37
 
38
38
  @property
39
- def columns_required(self) -> Optional[List[str]]:
39
+ def columns_required(self) -> list[str] | None:
40
40
  return ["age"]
41
41
 
42
42
  #####################
@@ -7,7 +7,8 @@ This module contains tools for applying a linear scale-up to an intervention
7
7
 
8
8
  """
9
9
 
10
- from typing import Any, Callable, Dict, Tuple
10
+ from collections.abc import Callable
11
+ from typing import Any
11
12
 
12
13
  import pandas as pd
13
14
  from vivarium import Component
@@ -61,7 +62,7 @@ class LinearScaleUp(Component):
61
62
  ##############
62
63
 
63
64
  @property
64
- def configuration_defaults(self) -> Dict[str, Any]:
65
+ def configuration_defaults(self) -> dict[str, Any]:
65
66
  return {self.configuration_key: self.CONFIGURATION_DEFAULTS["treatment"]}
66
67
 
67
68
  @property
@@ -108,11 +109,11 @@ class LinearScaleUp(Component):
108
109
  return builder.time.clock()
109
110
 
110
111
  # noinspection PyMethodMayBeStatic
111
- def get_scale_up_dates(self, builder: Builder) -> Tuple[pd.Timestamp, pd.Timestamp]:
112
+ def get_scale_up_dates(self, builder: Builder) -> tuple[pd.Timestamp, pd.Timestamp]:
112
113
  scale_up_config = builder.configuration[self.configuration_key]["date"]
113
114
  return pd.Timestamp(scale_up_config["start"]), pd.Timestamp(scale_up_config["end"])
114
115
 
115
- def get_scale_up_values(self, builder: Builder) -> Tuple[LookupTable, LookupTable]:
116
+ def get_scale_up_values(self, builder: Builder) -> tuple[LookupTable, LookupTable]:
116
117
  """Get the values at the start and end of the scale-up period.
117
118
 
118
119
  Parameters
@@ -137,7 +138,7 @@ class LinearScaleUp(Component):
137
138
  return get_endpoint_value("start"), get_endpoint_value("end")
138
139
 
139
140
  # noinspection PyMethodMayBeStatic
140
- def get_required_pipelines(self, builder: Builder) -> Dict[str, Pipeline]:
141
+ def get_required_pipelines(self, builder: Builder) -> dict[str, Pipeline]:
141
142
  return {}
142
143
 
143
144
  def register_intervention_modifiers(self, builder: Builder):
@@ -7,9 +7,8 @@ This module contains utility classes and functions for use across
7
7
  vivarium_public_health components.
8
8
 
9
9
  """
10
-
10
+ from collections.abc import Iterable
11
11
  from pathlib import Path
12
- from typing import Any, Dict, Iterable, List, Optional, Union
13
12
 
14
13
  import pandas as pd
15
14
  from vivarium.framework.lookup import LookupTable, ScalarValue
@@ -77,7 +76,7 @@ DAYS_PER_YEAR = 365.25
77
76
  DAYS_PER_MONTH = DAYS_PER_YEAR / 12
78
77
 
79
78
 
80
- def to_time_delta(span_in_days: Union[int, float, str]):
79
+ def to_time_delta(span_in_days: int | float | str):
81
80
  span_in_days = float(span_in_days)
82
81
  days, remainder = span_in_days // 1, span_in_days % 1
83
82
  hours, remainder = (24 * remainder) // 24, (24 * remainder) % 24
@@ -90,7 +89,7 @@ def to_years(time: pd.Timedelta) -> float:
90
89
  return time / pd.Timedelta(days=DAYS_PER_YEAR)
91
90
 
92
91
 
93
- def is_non_zero(data: Union[Iterable[ScalarValue], ScalarValue, pd.DataFrame]) -> bool:
92
+ def is_non_zero(data: Iterable[ScalarValue] | ScalarValue | pd.DataFrame) -> bool:
94
93
  if isinstance(data, pd.DataFrame):
95
94
  attribute_sum = data.value.sum()
96
95
  elif isinstance(data, Iterable):
@@ -103,7 +102,7 @@ def is_non_zero(data: Union[Iterable[ScalarValue], ScalarValue, pd.DataFrame]) -
103
102
 
104
103
  def get_lookup_columns(
105
104
  lookup_tables: Iterable[LookupTable], necessary_columns: Iterable = ()
106
- ) -> List[str]:
105
+ ) -> list[str]:
107
106
  necessary_columns = set(necessary_columns)
108
107
  for lookup_table in lookup_tables:
109
108
  necessary_columns.update(set(lookup_table.key_columns))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vivarium_public_health
3
- Version: 3.1.1
3
+ Version: 3.1.3
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,44 +26,44 @@ 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.2.0
30
- Requires-Dist: layered-config-tree >=1.0.1
29
+ Requires-Dist: vivarium>=3.2.0
30
+ Requires-Dist: layered_config_tree>=1.0.1
31
31
  Requires-Dist: loguru
32
- Requires-Dist: numpy <2.0.0
32
+ Requires-Dist: numpy<2.0.0
33
33
  Requires-Dist: pandas
34
34
  Requires-Dist: scipy
35
35
  Requires-Dist: tables
36
- Requires-Dist: risk-distributions >=2.0.11
36
+ Requires-Dist: risk_distributions>=2.0.11
37
37
  Requires-Dist: pyarrow
38
- Provides-Extra: dev
39
- Requires-Dist: sphinx <7.0 ; extra == 'dev'
40
- Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
41
- Requires-Dist: sphinx-click ; extra == 'dev'
42
- Requires-Dist: sphinx-autodoc-typehints ; extra == 'dev'
43
- Requires-Dist: IPython ; extra == 'dev'
44
- Requires-Dist: matplotlib ; extra == 'dev'
45
- Requires-Dist: vivarium-testing-utils ; extra == 'dev'
46
- Requires-Dist: pytest ; extra == 'dev'
47
- Requires-Dist: pytest-cov ; extra == 'dev'
48
- Requires-Dist: pytest-mock ; extra == 'dev'
49
- Requires-Dist: hypothesis ; extra == 'dev'
50
- Requires-Dist: pyyaml ; extra == 'dev'
51
- Requires-Dist: black ==22.3.0 ; extra == 'dev'
52
- Requires-Dist: isort ; extra == 'dev'
53
38
  Provides-Extra: docs
54
- Requires-Dist: sphinx <7.0 ; extra == 'docs'
55
- Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
56
- Requires-Dist: sphinx-click ; extra == 'docs'
57
- Requires-Dist: sphinx-autodoc-typehints ; extra == 'docs'
58
- Requires-Dist: IPython ; extra == 'docs'
59
- Requires-Dist: matplotlib ; extra == 'docs'
39
+ Requires-Dist: sphinx<7.0; extra == "docs"
40
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
41
+ Requires-Dist: sphinx-click; extra == "docs"
42
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
43
+ Requires-Dist: IPython; extra == "docs"
44
+ Requires-Dist: matplotlib; extra == "docs"
60
45
  Provides-Extra: test
61
- Requires-Dist: vivarium-testing-utils ; extra == 'test'
62
- Requires-Dist: pytest ; extra == 'test'
63
- Requires-Dist: pytest-cov ; extra == 'test'
64
- Requires-Dist: pytest-mock ; extra == 'test'
65
- Requires-Dist: hypothesis ; extra == 'test'
66
- Requires-Dist: pyyaml ; extra == 'test'
46
+ Requires-Dist: vivarium_testing_utils; extra == "test"
47
+ Requires-Dist: pytest; extra == "test"
48
+ Requires-Dist: pytest-cov; extra == "test"
49
+ Requires-Dist: pytest-mock; extra == "test"
50
+ Requires-Dist: hypothesis; extra == "test"
51
+ Requires-Dist: pyyaml; extra == "test"
52
+ Provides-Extra: dev
53
+ Requires-Dist: sphinx<7.0; extra == "dev"
54
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
55
+ Requires-Dist: sphinx-click; extra == "dev"
56
+ Requires-Dist: sphinx-autodoc-typehints; extra == "dev"
57
+ Requires-Dist: IPython; extra == "dev"
58
+ Requires-Dist: matplotlib; extra == "dev"
59
+ Requires-Dist: vivarium_testing_utils; extra == "dev"
60
+ Requires-Dist: pytest; extra == "dev"
61
+ Requires-Dist: pytest-cov; extra == "dev"
62
+ Requires-Dist: pytest-mock; extra == "dev"
63
+ Requires-Dist: hypothesis; extra == "dev"
64
+ Requires-Dist: pyyaml; extra == "dev"
65
+ Requires-Dist: black==22.3.0; extra == "dev"
66
+ Requires-Dist: isort; extra == "dev"
67
67
 
68
68
  Vivarium Public Health
69
69
  ======================
@@ -0,0 +1,49 @@
1
+ vivarium_public_health/__about__.py,sha256=RgWycPypKZS80TpSX7o41cREnG8PfguNHDHLuLyl820,487
2
+ vivarium_public_health/__init__.py,sha256=GDeeP-7OlCBwPuv_xQoB1wNmvCaFsqfTB7qnnYApm0w,1343
3
+ vivarium_public_health/_version.py,sha256=xoSqNkNOCK0xzFXnsO80epHc1vbiRC8Nbn4Cy-2wBX4,22
4
+ vivarium_public_health/utilities.py,sha256=QNXQ6fhAr1HcV-GwKw7wQLz6QyuNxqNvMA-XujKjTgs,3035
5
+ vivarium_public_health/disease/__init__.py,sha256=VUJHDLlE6ngo2qHNQUtZ8OWH5H_T7_ao-xsYKDkRmHw,443
6
+ vivarium_public_health/disease/model.py,sha256=ZwhhQCc8jj_QeJZO2zLtp_yWzqRxvLjuzW7iDUmmBGA,8852
7
+ vivarium_public_health/disease/models.py,sha256=01UK7yB2zGPFzmlIpvhd-XnGe6vSCMDza3QTidgY7Nc,3479
8
+ vivarium_public_health/disease/special_disease.py,sha256=kTVuE5rQjUK62ysComG8nB2f61aCKdca9trRB1zsDCQ,14537
9
+ vivarium_public_health/disease/state.py,sha256=NwTnxB_i05magsJuEc1_Z_0xMMKsqSPXIpibUdxPrWY,22333
10
+ vivarium_public_health/disease/transition.py,sha256=4g_F8L3Godb4yQjHRr42n95QXo6m0ldI6c8_vu6cTfo,6429
11
+ vivarium_public_health/mslt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ vivarium_public_health/mslt/delay.py,sha256=TrFp9nmv-PSu6xdQXfyeM4X8RrXTLUnQMxOuhdvD-Wk,22787
13
+ vivarium_public_health/mslt/disease.py,sha256=DONSItBiOUk1qBE6Msw0vrV0XLW4BPzWVxwVK90GK1I,16638
14
+ vivarium_public_health/mslt/intervention.py,sha256=jgzyDYEypsJDlKeLHDDqcgiwiCTA31VIz7_keS-Jww4,10325
15
+ vivarium_public_health/mslt/magic_wand_components.py,sha256=TUh0fJ6FLZz0qiknOQAD3T7pZN9GWjGDmtNC6Fnhd9E,3975
16
+ vivarium_public_health/mslt/observer.py,sha256=r0XqDIGrSO0BjlU1uCeFenuz-NRfpLMtug24LLg60g4,15178
17
+ vivarium_public_health/mslt/population.py,sha256=LnN9ch_FoPGNbKeIT5BaEFfeAn5itZgZ0q_ZEaZTJEI,7211
18
+ vivarium_public_health/plugins/__init__.py,sha256=oBW_zfgG_LbwfgTDjUe0btfy9FaDvAbtXho1zQFnz0Y,76
19
+ vivarium_public_health/plugins/parser.py,sha256=WoUisq0d-PfJtSzKYZ6C-s-fYdQpNiRBE14vKaYE27Y,32921
20
+ vivarium_public_health/population/__init__.py,sha256=x_9rB93q64Krw-kbBDI1-_U_JsPO1_QrL03AwiFlwXI,243
21
+ vivarium_public_health/population/add_new_birth_cohorts.py,sha256=Xc3NukpbZQpXCtGJsaaN4_arSjOMZ1YJHGyAVTUhGjU,9034
22
+ vivarium_public_health/population/base_population.py,sha256=f7eDqqP0Nxj2W0Q9fwSh_GcN1wzoaQPr--iX8QIV-sE,18827
23
+ vivarium_public_health/population/data_transformations.py,sha256=yxuZuKZt-s8X6XPULbKWXn2w3kAmNLHYvGQ4sWBKlpc,22216
24
+ vivarium_public_health/population/mortality.py,sha256=komiAsM4ONm6emChAbkiMTYey-5jbnUKjq4B4Q1DOnM,10223
25
+ vivarium_public_health/results/__init__.py,sha256=rKUZGlRXJgEyFY4a_WJeg3XnC0l34S5guYZ0N9JJS4E,319
26
+ vivarium_public_health/results/columns.py,sha256=V-L3JgTcsk51Zx9PcUwSgaE1iZjuGyfZ8aShPjynadU,495
27
+ vivarium_public_health/results/disability.py,sha256=27lXk68KRTxGIhDJ2BXT1IE2XWSVl7ktoXYUCCBJFOM,9844
28
+ vivarium_public_health/results/disease.py,sha256=NwKDtHNEjPJUB-DqhE-gVCC1TNRbX5qbQBDL06XT3Pg,12517
29
+ vivarium_public_health/results/mortality.py,sha256=-gxA9t1nSuKe1CiBje6Kkl985yAUkRWj3Cl9PFYLcQc,9644
30
+ vivarium_public_health/results/observer.py,sha256=ADikaV6TvHVaysWoeux_DcvmzAFT7kpD6KtRSl16SaY,7277
31
+ vivarium_public_health/results/risk.py,sha256=VArTuuW-xoeuE-EkgAIMVb5la_YGRulIPMLoOmsMnik,6597
32
+ vivarium_public_health/results/simple_cause.py,sha256=ibdE6KwhDfQWntCVkOEooBcmUydEoupmd3_poHSHyu8,1007
33
+ vivarium_public_health/results/stratification.py,sha256=4I3YGHVabNAZENE7YboOtWsWU4X-8LUBJ9iwYMbpl6E,5387
34
+ vivarium_public_health/risks/__init__.py,sha256=z8DcnZGxqNVAyFZm2WAV-IVNGvrSS4izju_0DNe2Ghw,212
35
+ vivarium_public_health/risks/base_risk.py,sha256=XQ_7rYJS5gh0coEKDqcc_zYdjPDBZlj6-THsIQxL3zs,10888
36
+ vivarium_public_health/risks/data_transformations.py,sha256=SgdPKc95BBqgMNUdlAQM8k6iaXcpxnjk5B2ySTES1Yg,9269
37
+ vivarium_public_health/risks/distributions.py,sha256=a63-ihg2itxqgowDZbUix8soErxs_y8TRwsdtTCIUU4,18121
38
+ vivarium_public_health/risks/effect.py,sha256=2DaBKxncS94cm8Ih-TQtbV1mGsEZhx6fEnB5V_ocIZM,21241
39
+ vivarium_public_health/risks/implementations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py,sha256=Iw5e7sCrWplEu6dic1Wu6q9e0rdeem_6gQ_-N52G54E,17866
41
+ vivarium_public_health/treatment/__init__.py,sha256=wONElu9aJbBYwpYIovYPYaN_GYfVhPXtTeFWSdQMgA0,222
42
+ vivarium_public_health/treatment/magic_wand.py,sha256=zGIhrNgB9q6JD7fHlvbDQb3H5e_N_QsROO4Y0kl_JQM,1955
43
+ vivarium_public_health/treatment/scale_up.py,sha256=hVz0ELXDqlpcExI31rKdepxqcW_hy2hZSa6qCzv6udU,7020
44
+ vivarium_public_health/treatment/therapeutic_inertia.py,sha256=8Z97s7GfcpfLu1U1ESJSqeEk4L__a3M0GbBV21MFg2s,2346
45
+ vivarium_public_health-3.1.3.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
46
+ vivarium_public_health-3.1.3.dist-info/METADATA,sha256=csuhuXUl84A5QlA7S10sjMvafQXonRvAlwm2XSj-ck4,4028
47
+ vivarium_public_health-3.1.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
48
+ vivarium_public_health-3.1.3.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
49
+ vivarium_public_health-3.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.4.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,49 +0,0 @@
1
- vivarium_public_health/__about__.py,sha256=RgWycPypKZS80TpSX7o41cREnG8PfguNHDHLuLyl820,487
2
- vivarium_public_health/__init__.py,sha256=GDeeP-7OlCBwPuv_xQoB1wNmvCaFsqfTB7qnnYApm0w,1343
3
- vivarium_public_health/_version.py,sha256=14eImCCNxRh4pWMIfkKe4h5OCS1ICfRjHSj2AfgEXa0,22
4
- vivarium_public_health/utilities.py,sha256=5cl9jjVkOQ1UeXT4DjDMAhaBNNjAsDo-SVJwpv6FDw0,3071
5
- vivarium_public_health/disease/__init__.py,sha256=VUJHDLlE6ngo2qHNQUtZ8OWH5H_T7_ao-xsYKDkRmHw,443
6
- vivarium_public_health/disease/model.py,sha256=wbQvRQF6faTjx6OzokLt6u_9vdAvUrx_P8iQmiKNfv4,9128
7
- vivarium_public_health/disease/models.py,sha256=01UK7yB2zGPFzmlIpvhd-XnGe6vSCMDza3QTidgY7Nc,3479
8
- vivarium_public_health/disease/special_disease.py,sha256=ZBtS-eDVptbZ1OjD35dhJvkKw78oDUfTyQSLY7g74dw,14562
9
- vivarium_public_health/disease/state.py,sha256=ON1RGVLV2BAmq2aGR7u94j3Q0btb0Hz3flr1FCEQHtQ,22355
10
- vivarium_public_health/disease/transition.py,sha256=G2-L0JvX4tWaHN5zrYXMR2jFj_JXFe9LEbrWjIbplCc,6446
11
- vivarium_public_health/mslt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- vivarium_public_health/mslt/delay.py,sha256=aOYjMpMSHEVlJs0FuC2gdq3uj6_vKmkhDjoBtC4i9G0,22812
13
- vivarium_public_health/mslt/disease.py,sha256=TBqa7yj6k1oUbgkAe0rIgLpbdMLMFs4DiZ1Igi2BQBg,16663
14
- vivarium_public_health/mslt/intervention.py,sha256=m6LT0CdJNwhz9X0FQNap1y9K5N4MhUDcvfDaHVukJZQ,10331
15
- vivarium_public_health/mslt/magic_wand_components.py,sha256=pnl-7MwIJIus6UjtvVmM15pIZOCbSS1mNfP7nS2bAtw,3981
16
- vivarium_public_health/mslt/observer.py,sha256=O4rysQzAGE5oDkdXb0E-qjD9TPFphQHTn7_3Qj7pBL0,15225
17
- vivarium_public_health/mslt/population.py,sha256=v_p5VkjndAVJMuXaJQc3lAdzUWHlWCEQWH4A-c4phPA,7255
18
- vivarium_public_health/plugins/__init__.py,sha256=oBW_zfgG_LbwfgTDjUe0btfy9FaDvAbtXho1zQFnz0Y,76
19
- vivarium_public_health/plugins/parser.py,sha256=WuhgV47EVUAMSR8pQxQfNfQWkR3QtAOL0zhqvLNGdBQ,32946
20
- vivarium_public_health/population/__init__.py,sha256=x_9rB93q64Krw-kbBDI1-_U_JsPO1_QrL03AwiFlwXI,243
21
- vivarium_public_health/population/add_new_birth_cohorts.py,sha256=k65Li0LYWl-JFHBUvLjJxkRv12EJw_FVxrOYgbd44q8,9078
22
- vivarium_public_health/population/base_population.py,sha256=jJMVWv_EO0ckUZHhh01dRbsRgL491Eg3thRxPwNiAeg,18866
23
- vivarium_public_health/population/data_transformations.py,sha256=YmqyrlrIBtHGp1nFyhesqlNryvB7Vr33eVu4fU4HWsA,22260
24
- vivarium_public_health/population/mortality.py,sha256=WAHtqXOgkX7li_lLvfwJsvJvVjlS5RLvm0DVpu0K3n0,10261
25
- vivarium_public_health/results/__init__.py,sha256=rKUZGlRXJgEyFY4a_WJeg3XnC0l34S5guYZ0N9JJS4E,319
26
- vivarium_public_health/results/columns.py,sha256=V-L3JgTcsk51Zx9PcUwSgaE1iZjuGyfZ8aShPjynadU,495
27
- vivarium_public_health/results/disability.py,sha256=JQm3Q7CoGCT2AgxaoH6MKkvnq4xF83wfFmEvEOvTmvA,9876
28
- vivarium_public_health/results/disease.py,sha256=OwxhPrfDsCnCZSaw8Yiq2AnibWikoqI-gM7xDdhFLcM,12529
29
- vivarium_public_health/results/mortality.py,sha256=imH5OGze_rb0i60hmFs-JUjE6XXoH8Gt9wWeut0sk_M,9656
30
- vivarium_public_health/results/observer.py,sha256=SQmKL1OCs2gDS8clIuJvZ3WiuspMkGEVDhnuNMJAvHc,7300
31
- vivarium_public_health/results/risk.py,sha256=GS4qJVjW3MqsDeRDDac2etFQlqIluxOxIZFMy1Ytmp8,6622
32
- vivarium_public_health/results/simple_cause.py,sha256=ibdE6KwhDfQWntCVkOEooBcmUydEoupmd3_poHSHyu8,1007
33
- vivarium_public_health/results/stratification.py,sha256=4I3YGHVabNAZENE7YboOtWsWU4X-8LUBJ9iwYMbpl6E,5387
34
- vivarium_public_health/risks/__init__.py,sha256=z8DcnZGxqNVAyFZm2WAV-IVNGvrSS4izju_0DNe2Ghw,212
35
- vivarium_public_health/risks/base_risk.py,sha256=fNQZIgGHYnWFWdLA9qmtTA66ujCGq2jgA5S1-MadWT8,10900
36
- vivarium_public_health/risks/data_transformations.py,sha256=SgdPKc95BBqgMNUdlAQM8k6iaXcpxnjk5B2ySTES1Yg,9269
37
- vivarium_public_health/risks/distributions.py,sha256=7xCI2zSpnKUEWow4ywRirVbvbpeJaxo6g9us0-Lh0kE,18197
38
- vivarium_public_health/risks/effect.py,sha256=fc_MrhmJLQcpaiZk12klric2c5-BY1gZaWMbsEjBUlY,20766
39
- vivarium_public_health/risks/implementations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py,sha256=kxuJwkpJzGF8CqwNEemEA7CrohcxKQJtvUXLJtD1xm0,17948
41
- vivarium_public_health/treatment/__init__.py,sha256=wONElu9aJbBYwpYIovYPYaN_GYfVhPXtTeFWSdQMgA0,222
42
- vivarium_public_health/treatment/magic_wand.py,sha256=i9N57-MEuQv5B6dQ5iVMTAdOPghYcgiRRz-dTzigf1s,1980
43
- vivarium_public_health/treatment/scale_up.py,sha256=9Cl3_MaCNPtUPPKXf3hWYepIwMCFlFY24jt2jeyFQO4,7006
44
- vivarium_public_health/treatment/therapeutic_inertia.py,sha256=8Z97s7GfcpfLu1U1ESJSqeEk4L__a3M0GbBV21MFg2s,2346
45
- vivarium_public_health-3.1.1.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
46
- vivarium_public_health-3.1.1.dist-info/METADATA,sha256=T9qvhChXoRbfWilAVz8Rbi2GkPMnDxsy-bcY16jZggk,4061
47
- vivarium_public_health-3.1.1.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
48
- vivarium_public_health-3.1.1.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
49
- vivarium_public_health-3.1.1.dist-info/RECORD,,