vivarium-public-health 3.1.5__py3-none-any.whl → 3.2.1__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.
@@ -1 +1 @@
1
- __version__ = "3.1.5"
1
+ __version__ = "3.2.1"
@@ -114,7 +114,7 @@ class RiskEffect(Component):
114
114
  self.exposure = self.get_risk_exposure(builder)
115
115
 
116
116
  self._relative_risk_source = self.get_relative_risk_source(builder)
117
- self.relative_risk = self.get_relative_risk(builder)
117
+ self.relative_risk = self.get_relative_risk_pipeline(builder)
118
118
 
119
119
  self.register_target_modifier(builder)
120
120
  self.register_paf_modifier(builder)
@@ -297,7 +297,7 @@ class RiskEffect(Component):
297
297
 
298
298
  return generate_relative_risk
299
299
 
300
- def get_relative_risk(self, builder: Builder) -> Pipeline:
300
+ def get_relative_risk_pipeline(self, builder: Builder) -> Pipeline:
301
301
  return builder.value.register_value_producer(
302
302
  f"{self.risk.name}_on_{self.target.name}.relative_risk",
303
303
  self._relative_risk_source,
@@ -361,18 +361,11 @@ class LBWSGRiskEffect(RiskEffect):
361
361
  paf_data = builder.data.load(paf_key)
362
362
  return paf_data, builder.data.value_columns()(paf_key)
363
363
 
364
- def get_target_modifier(
365
- self, builder: Builder
366
- ) -> Callable[[pd.Index, pd.Series], pd.Series]:
367
- def adjust_target(index: pd.Index, target: pd.Series) -> pd.Series:
368
- return target * self.relative_risk(index)
369
-
370
- return adjust_target
371
-
372
364
  def register_target_modifier(self, builder: Builder) -> None:
373
365
  builder.value.register_value_modifier(
374
366
  self.target_pipeline_name,
375
- modifier=self.target_modifier,
367
+ modifier=self.adjust_target,
368
+ component=self,
376
369
  requires_values=[self.relative_risk_pipeline_name],
377
370
  )
378
371
 
@@ -392,11 +385,12 @@ class LBWSGRiskEffect(RiskEffect):
392
385
  for age_start in exposed_age_group_starts
393
386
  }
394
387
 
395
- def get_relative_risk(self, builder: Builder) -> Pipeline:
388
+ def get_relative_risk_pipeline(self, builder: Builder) -> Pipeline:
396
389
  return builder.value.register_value_producer(
397
390
  self.relative_risk_pipeline_name,
398
- source=self.get_relative_risk_source,
399
- requires_columns=["age"] + self.rr_column_names,
391
+ source=self._relative_risk_source,
392
+ component=self,
393
+ required_resources=["age"] + self.rr_column_names,
400
394
  )
401
395
 
402
396
  def get_interpolator(self, builder: Builder) -> pd.Series:
@@ -469,7 +463,7 @@ class LBWSGRiskEffect(RiskEffect):
469
463
  # Pipeline sources and modifiers #
470
464
  ##################################
471
465
 
472
- def get_relative_risk_source(self, index: pd.Index) -> pd.Series:
466
+ def _get_relative_risk(self, index: pd.Index) -> pd.Series:
473
467
  pop = self.population_view.get(index)
474
468
  relative_risk = pd.Series(1.0, index=index, name=self.relative_risk_pipeline_name)
475
469
 
@@ -479,3 +473,6 @@ class LBWSGRiskEffect(RiskEffect):
479
473
  age_group_mask, self.relative_risk_column_name(age_group)
480
474
  ]
481
475
  return relative_risk
476
+
477
+ def get_relative_risk_source(self, builder: Builder) -> Callable[[pd.Index], pd.Series]:
478
+ return self._get_relative_risk
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: vivarium_public_health
3
- Version: 3.1.5
3
+ Version: 3.2.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
@@ -63,7 +63,7 @@ Requires-Dist: pytest-mock; extra == "dev"
63
63
  Requires-Dist: hypothesis; extra == "dev"
64
64
  Requires-Dist: pyyaml; extra == "dev"
65
65
  Requires-Dist: black==22.3.0; extra == "dev"
66
- Requires-Dist: isort; extra == "dev"
66
+ Requires-Dist: isort==5.13.2; extra == "dev"
67
67
  Dynamic: author
68
68
  Dynamic: author-email
69
69
  Dynamic: classifier
@@ -1,6 +1,6 @@
1
1
  vivarium_public_health/__about__.py,sha256=RgWycPypKZS80TpSX7o41cREnG8PfguNHDHLuLyl820,487
2
2
  vivarium_public_health/__init__.py,sha256=GDeeP-7OlCBwPuv_xQoB1wNmvCaFsqfTB7qnnYApm0w,1343
3
- vivarium_public_health/_version.py,sha256=TWk_ugdK07uGz4H-jBQrak6YuyBu1slD1RA6eK7eSbg,22
3
+ vivarium_public_health/_version.py,sha256=3BjxgoOdY8_gLUzv4upJn3tTpb8jX8wWqkC8k9jDva0,22
4
4
  vivarium_public_health/utilities.py,sha256=QNXQ6fhAr1HcV-GwKw7wQLz6QyuNxqNvMA-XujKjTgs,3035
5
5
  vivarium_public_health/disease/__init__.py,sha256=VUJHDLlE6ngo2qHNQUtZ8OWH5H_T7_ao-xsYKDkRmHw,443
6
6
  vivarium_public_health/disease/exceptions.py,sha256=vb30IIV82OiDf2cNZCs_E2rF6mdDDHbnZSND60no5CU,97
@@ -36,15 +36,15 @@ vivarium_public_health/risks/__init__.py,sha256=z8DcnZGxqNVAyFZm2WAV-IVNGvrSS4iz
36
36
  vivarium_public_health/risks/base_risk.py,sha256=XQ_7rYJS5gh0coEKDqcc_zYdjPDBZlj6-THsIQxL3zs,10888
37
37
  vivarium_public_health/risks/data_transformations.py,sha256=SgdPKc95BBqgMNUdlAQM8k6iaXcpxnjk5B2ySTES1Yg,9269
38
38
  vivarium_public_health/risks/distributions.py,sha256=a63-ihg2itxqgowDZbUix8soErxs_y8TRwsdtTCIUU4,18121
39
- vivarium_public_health/risks/effect.py,sha256=2DaBKxncS94cm8Ih-TQtbV1mGsEZhx6fEnB5V_ocIZM,21241
39
+ vivarium_public_health/risks/effect.py,sha256=Cw-V1rMPaAPZsirbUElPzksvNuXLQc8TIIk0hgaFzvA,21259
40
40
  vivarium_public_health/risks/implementations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py,sha256=Iw5e7sCrWplEu6dic1Wu6q9e0rdeem_6gQ_-N52G54E,17866
41
+ vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py,sha256=JkS9_33AzRBPRK9BpNvtBYg70cbh7wBi3dE7hBHbSNU,17781
42
42
  vivarium_public_health/treatment/__init__.py,sha256=wONElu9aJbBYwpYIovYPYaN_GYfVhPXtTeFWSdQMgA0,222
43
43
  vivarium_public_health/treatment/magic_wand.py,sha256=zGIhrNgB9q6JD7fHlvbDQb3H5e_N_QsROO4Y0kl_JQM,1955
44
44
  vivarium_public_health/treatment/scale_up.py,sha256=hVz0ELXDqlpcExI31rKdepxqcW_hy2hZSa6qCzv6udU,7020
45
45
  vivarium_public_health/treatment/therapeutic_inertia.py,sha256=8Z97s7GfcpfLu1U1ESJSqeEk4L__a3M0GbBV21MFg2s,2346
46
- vivarium_public_health-3.1.5.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
47
- vivarium_public_health-3.1.5.dist-info/METADATA,sha256=OCgTn3qH2kSMuoFNe3E868FEyFggjsyWqyZdrrPDofo,4207
48
- vivarium_public_health-3.1.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
49
- vivarium_public_health-3.1.5.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
50
- vivarium_public_health-3.1.5.dist-info/RECORD,,
46
+ vivarium_public_health-3.2.1.dist-info/LICENSE.txt,sha256=mN4bNLUQNcN9njYRc_3jCZkfPySVpmM6MRps104FxA4,1548
47
+ vivarium_public_health-3.2.1.dist-info/METADATA,sha256=u7H5K7zUJj2RyV59wdbkZdvvEJ9TIvqXZQ4mnUX3W7s,4215
48
+ vivarium_public_health-3.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
49
+ vivarium_public_health-3.2.1.dist-info/top_level.txt,sha256=VVInlpzCFD0UNNhjOq_j-a29odzjwUwYFTGfvqbi4dY,23
50
+ vivarium_public_health-3.2.1.dist-info/RECORD,,