vivarium-public-health 3.2.2__tar.gz → 4.0.1__tar.gz

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 (159) hide show
  1. vivarium_public_health-4.0.1/.github/CODEOWNERS +2 -0
  2. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/CHANGELOG.rst +8 -0
  3. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/PKG-INFO +3 -2
  4. vivarium_public_health-4.0.1/src/vivarium_public_health/_version.py +1 -0
  5. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/model.py +2 -1
  6. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/special_disease.py +19 -15
  7. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/state.py +23 -14
  8. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/transition.py +7 -6
  9. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/delay.py +13 -11
  10. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/disease.py +24 -19
  11. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/intervention.py +17 -9
  12. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/magic_wand_components.py +15 -5
  13. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/population.py +4 -1
  14. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/population/add_new_birth_cohorts.py +8 -8
  15. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/population/base_population.py +7 -6
  16. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/population/mortality.py +8 -4
  17. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/disability.py +1 -0
  18. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/disease.py +3 -4
  19. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/base_risk.py +11 -12
  20. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/distributions.py +12 -11
  21. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +9 -9
  22. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/treatment/magic_wand.py +2 -1
  23. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/treatment/scale_up.py +1 -0
  24. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/treatment/therapeutic_inertia.py +1 -1
  25. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/PKG-INFO +3 -2
  26. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/SOURCES.txt +0 -1
  27. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/test_low_birth_weight_and_short_gestation.py +55 -4
  28. vivarium_public_health-3.2.2/.github/CODEOWNERS +0 -2
  29. vivarium_public_health-3.2.2/.github/workflows/build.yml +0 -26
  30. vivarium_public_health-3.2.2/src/vivarium_public_health/_version.py +0 -1
  31. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.bandit +0 -0
  32. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.flake8 +0 -0
  33. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.gitattributes +0 -0
  34. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.github/pull_request_template.md +0 -0
  35. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.github/workflows/deploy.yml +0 -0
  36. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.gitignore +0 -0
  37. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.pylintrc +0 -0
  38. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.readthedocs.yml +0 -0
  39. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/.zenodo.json +0 -0
  40. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/CODE_OF_CONDUCT.rst +0 -0
  41. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/CONTRIBUTING.rst +0 -0
  42. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/Jenkinsfile +0 -0
  43. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/LICENSE.txt +0 -0
  44. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/MANIFEST.in +0 -0
  45. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/Makefile +0 -0
  46. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/README.rst +0 -0
  47. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/Makefile +0 -0
  48. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/nitpick-exceptions +0 -0
  49. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/_static/style.css +0 -0
  50. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/_templates/layout.html +0 -0
  51. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/index.rst +0 -0
  52. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/model.rst +0 -0
  53. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/models.rst +0 -0
  54. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/special_disease.rst +0 -0
  55. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/state.rst +0 -0
  56. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/disease/transition.rst +0 -0
  57. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/index.rst +0 -0
  58. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/delay.rst +0 -0
  59. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/disease.rst +0 -0
  60. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/index.rst +0 -0
  61. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/intervention.rst +0 -0
  62. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/magic_wand_components.rst +0 -0
  63. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/observer.rst +0 -0
  64. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/mslt/population.rst +0 -0
  65. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/plugins/index.rst +0 -0
  66. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/plugins/parser.rst +0 -0
  67. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/population/add_new_birth_cohorts.rst +0 -0
  68. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/population/base_population.rst +0 -0
  69. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/population/data_transformations.rst +0 -0
  70. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/population/index.rst +0 -0
  71. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/population/mortality.rst +0 -0
  72. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/disability.rst +0 -0
  73. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/disease.rst +0 -0
  74. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/index.rst +0 -0
  75. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/mortality.rst +0 -0
  76. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/observer.rst +0 -0
  77. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/risk.rst +0 -0
  78. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/simple_cause.rst +0 -0
  79. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/results/stratification.rst +0 -0
  80. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/base_risk.rst +0 -0
  81. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/data_transformations.rst +0 -0
  82. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/distributions.rst +0 -0
  83. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/effect.rst +0 -0
  84. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/implementations/index.rst +0 -0
  85. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/implementations/low_birth_weight_and_short_gestation.rst +0 -0
  86. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/risks/index.rst +0 -0
  87. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/treatment/index.rst +0 -0
  88. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/treatment/magic_wand.rst +0 -0
  89. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/treatment/scale_up.rst +0 -0
  90. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/treatment/therapeutic_inertia.rst +0 -0
  91. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/api_reference/utilities.rst +0 -0
  92. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/conf.py +0 -0
  93. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/index.rst +0 -0
  94. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/tutorials/index.rst +0 -0
  95. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/docs/source/tutorials/risk_exposure.rst +0 -0
  96. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/pyproject.toml +0 -0
  97. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/python_versions.json +0 -0
  98. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/setup.cfg +0 -0
  99. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/setup.py +0 -0
  100. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/__about__.py +0 -0
  101. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/__init__.py +0 -0
  102. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/__init__.py +0 -0
  103. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/exceptions.py +0 -0
  104. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/disease/models.py +0 -0
  105. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/__init__.py +0 -0
  106. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/mslt/observer.py +0 -0
  107. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/plugins/__init__.py +0 -0
  108. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/plugins/parser.py +0 -0
  109. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/population/__init__.py +0 -0
  110. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/population/data_transformations.py +0 -0
  111. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/__init__.py +0 -0
  112. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/columns.py +0 -0
  113. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/mortality.py +0 -0
  114. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/observer.py +0 -0
  115. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/risk.py +0 -0
  116. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/simple_cause.py +0 -0
  117. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/results/stratification.py +0 -0
  118. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/__init__.py +0 -0
  119. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/data_transformations.py +0 -0
  120. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/effect.py +0 -0
  121. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/risks/implementations/__init__.py +0 -0
  122. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/treatment/__init__.py +0 -0
  123. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health/utilities.py +0 -0
  124. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/dependency_links.txt +0 -0
  125. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/not-zip-safe +0 -0
  126. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/requires.txt +0 -0
  127. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/src/vivarium_public_health.egg-info/top_level.txt +0 -0
  128. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/__init__.py +0 -0
  129. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/conftest.py +0 -0
  130. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/data/rr_interpolator.csv +0 -0
  131. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/disease/__init__.py +0 -0
  132. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/disease/test_disease.py +0 -0
  133. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/disease/test_special_disease.py +0 -0
  134. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/mock_artifact.py +0 -0
  135. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/plugins/__init__.py +0 -0
  136. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/plugins/test_parser.py +0 -0
  137. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/__init__.py +0 -0
  138. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/conftest.py +0 -0
  139. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/test_add_new_birth_cohort.py +0 -0
  140. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/test_base_population.py +0 -0
  141. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/test_data_transformations.py +0 -0
  142. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/population/test_mortality.py +0 -0
  143. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/__init__.py +0 -0
  144. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_categorical_risk_observer.py +0 -0
  145. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_disability.py +0 -0
  146. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_disability_observer.py +0 -0
  147. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_disease_observer.py +0 -0
  148. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_mortality_observer.py +0 -0
  149. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/results/test_stratification.py +0 -0
  150. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/__init__.py +0 -0
  151. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/conftest.py +0 -0
  152. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/test_base_risk.py +0 -0
  153. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/test_data_transformations.py +0 -0
  154. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/test_distributions.py +0 -0
  155. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/risks/test_effect.py +0 -0
  156. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/test_utilities.py +0 -0
  157. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/treatment/__init__.py +0 -0
  158. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tests/treatment/test_scale_up.py +0 -0
  159. {vivarium_public_health-3.2.2 → vivarium_public_health-4.0.1}/tox.ini +0 -0
@@ -0,0 +1,2 @@
1
+ # default owners
2
+ * @albrja @hussain-jafari @patricktnast @rmudambi @stevebachmeier
@@ -1,3 +1,11 @@
1
+ **4.0.1 - 03/21/25**
2
+
3
+ - Feature: Update required resources for all components
4
+
5
+ **4.0.0 - 03/17/25**
6
+
7
+ - Feature: Use birth exposure artifact key for LBWSG components
8
+
1
9
  **3.2.2 - 2/21/25**
2
10
 
3
11
  - Bugfix: Use relative risk data to get age intervals for LBWSGRiskEffect
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: vivarium_public_health
3
- Version: 3.2.2
3
+ Version: 4.0.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
@@ -70,6 +70,7 @@ Dynamic: classifier
70
70
  Dynamic: description
71
71
  Dynamic: home-page
72
72
  Dynamic: license
73
+ Dynamic: license-file
73
74
  Dynamic: provides-extra
74
75
  Dynamic: requires-dist
75
76
  Dynamic: summary
@@ -0,0 +1 @@
1
+ __version__ = "4.0.1"
@@ -114,7 +114,8 @@ class DiseaseModel(Machine):
114
114
  builder.value.register_value_modifier(
115
115
  "cause_specific_mortality_rate",
116
116
  self.adjust_cause_specific_mortality_rate,
117
- requires_columns=["age", "sex"],
117
+ component=self,
118
+ required_resources=["age", "sex"],
118
119
  )
119
120
 
120
121
  def on_initialize_simulants(self, pop_data: SimulantData) -> None:
@@ -16,6 +16,7 @@ import pandas as pd
16
16
  from vivarium import Component
17
17
  from vivarium.framework.event import Event
18
18
  from vivarium.framework.population import SimulantData
19
+ from vivarium.framework.resource import Resource
19
20
  from vivarium.framework.values import list_combiner, union_post_processor
20
21
 
21
22
  from vivarium_public_health.disease.transition import TransitionString
@@ -123,12 +124,8 @@ class RiskAttributableDisease(Component):
123
124
  return ["alive"]
124
125
 
125
126
  @property
126
- def initialization_requirements(self) -> dict[str, list[str]]:
127
- return {
128
- "requires_columns": [],
129
- "requires_values": [f"{self.risk.name}.exposure"],
130
- "requires_streams": [],
131
- }
127
+ def initialization_requirements(self) -> list[str | Resource]:
128
+ return [self.exposure_pipeline]
132
129
 
133
130
  @property
134
131
  def state_names(self):
@@ -171,17 +168,21 @@ class RiskAttributableDisease(Component):
171
168
  self.disability_weight = builder.value.register_value_producer(
172
169
  f"{self.cause.name}.disability_weight",
173
170
  source=self.compute_disability_weight,
174
- requires_columns=get_lookup_columns(
171
+ component=self,
172
+ required_resources=get_lookup_columns(
175
173
  [self.lookup_tables["raw_disability_weight"]]
176
174
  ),
177
175
  )
178
176
  builder.value.register_value_modifier(
179
- "all_causes.disability_weight", modifier=self.disability_weight
177
+ "all_causes.disability_weight",
178
+ modifier=self.disability_weight,
179
+ component=self,
180
180
  )
181
181
  builder.value.register_value_modifier(
182
182
  "cause_specific_mortality_rate",
183
183
  self.adjust_cause_specific_mortality_rate,
184
- requires_columns=get_lookup_columns(
184
+ component=self,
185
+ required_resources=get_lookup_columns(
185
186
  [self.lookup_tables["cause_specific_mortality_rate"]]
186
187
  ),
187
188
  )
@@ -190,29 +191,32 @@ class RiskAttributableDisease(Component):
190
191
  self.excess_mortality_rate = builder.value.register_value_producer(
191
192
  self.excess_mortality_rate_pipeline_name,
192
193
  source=self.compute_excess_mortality_rate,
193
- requires_columns=get_lookup_columns(
194
+ component=self,
195
+ required_resources=get_lookup_columns(
194
196
  [self.lookup_tables["excess_mortality_rate"]]
195
- ),
196
- requires_values=[self.excess_mortality_rate_paf_pipeline_name],
197
+ )
198
+ + [self.joint_paf],
197
199
  )
198
200
  self.joint_paf = builder.value.register_value_producer(
199
201
  self.excess_mortality_rate_paf_pipeline_name,
200
202
  source=lambda idx: [self.lookup_tables["population_attributable_fraction"](idx)],
203
+ component=self,
201
204
  preferred_combiner=list_combiner,
202
205
  preferred_post_processor=union_post_processor,
203
206
  )
204
207
  builder.value.register_value_modifier(
205
208
  "mortality_rate",
206
209
  modifier=self.adjust_mortality_rate,
207
- requires_values=[self.excess_mortality_rate_pipeline_name],
210
+ component=self,
211
+ required_resources=[self.excess_mortality_rate],
208
212
  )
209
213
 
210
214
  distribution = builder.data.load(f"{self.risk}.distribution")
211
- exposure_pipeline = builder.value.get_value(f"{self.risk.name}.exposure")
215
+ self.exposure_pipeline = builder.value.get_value(f"{self.risk.name}.exposure")
212
216
  threshold = builder.configuration[self.name].threshold
213
217
 
214
218
  self.filter_by_exposure = self.get_exposure_filter(
215
- distribution, exposure_pipeline, threshold
219
+ distribution, self.exposure_pipeline, threshold
216
220
  )
217
221
 
218
222
  #################
@@ -15,6 +15,7 @@ import pandas as pd
15
15
  from vivarium.framework.engine import Builder
16
16
  from vivarium.framework.population import PopulationView, SimulantData
17
17
  from vivarium.framework.randomness import RandomnessStream
18
+ from vivarium.framework.resource import Resource
18
19
  from vivarium.framework.state_machine import State, Transient, Transition, Trigger
19
20
  from vivarium.framework.values import Pipeline, list_combiner, union_post_processor
20
21
  from vivarium.types import DataInput, LookupTableData
@@ -57,12 +58,8 @@ class BaseDiseaseState(State):
57
58
  return [self.model, "alive"]
58
59
 
59
60
  @property
60
- def initialization_requirements(self) -> dict[str, list[str]]:
61
- return {
62
- "requires_columns": [self.model],
63
- "requires_values": [],
64
- "requires_streams": [],
65
- }
61
+ def initialization_requirements(self) -> list[str | Resource]:
62
+ return [self.model]
66
63
 
67
64
  #####################
68
65
  # Lifecycle methods #
@@ -327,6 +324,10 @@ class DiseaseState(BaseDiseaseState):
327
324
  # Properties #
328
325
  ##############
329
326
 
327
+ @property
328
+ def initialization_requirements(self) -> list[str | Resource]:
329
+ return super().initialization_requirements + [self.randomness_prevalence]
330
+
330
331
  @property
331
332
  def configuration_defaults(self) -> dict[str, Any]:
332
333
  configuration_defaults = super().configuration_defaults
@@ -465,19 +466,22 @@ class DiseaseState(BaseDiseaseState):
465
466
  self.disability_weight = self.get_disability_weight_pipeline(builder)
466
467
 
467
468
  builder.value.register_value_modifier(
468
- "all_causes.disability_weight", modifier=self.disability_weight
469
+ "all_causes.disability_weight",
470
+ modifier=self.disability_weight,
471
+ component=self,
469
472
  )
470
473
 
471
474
  self.has_excess_mortality = is_non_zero(
472
475
  self.lookup_tables["excess_mortality_rate"].data
473
476
  )
474
- self.excess_mortality_rate = self.get_excess_mortality_rate_pipeline(builder)
475
477
  self.joint_paf = self.get_joint_paf(builder)
478
+ self.excess_mortality_rate = self.get_excess_mortality_rate_pipeline(builder)
476
479
 
477
480
  builder.value.register_value_modifier(
478
481
  "mortality_rate",
479
482
  modifier=self.adjust_mortality_rate,
480
- requires_values=[self.excess_mortality_rate_pipeline_name],
483
+ component=self,
484
+ required_resources=[self.excess_mortality_rate],
481
485
  )
482
486
 
483
487
  self.randomness_prevalence = self.get_randomness_prevalence(builder)
@@ -531,7 +535,8 @@ class DiseaseState(BaseDiseaseState):
531
535
  return builder.value.register_value_producer(
532
536
  f"{self.state_id}.dwell_time",
533
537
  source=self.lookup_tables["dwell_time"],
534
- requires_columns=required_columns,
538
+ component=self,
539
+ required_resources=required_columns,
535
540
  )
536
541
 
537
542
  def get_disability_weight_source(self, disability_weight: DataInput | None) -> DataInput:
@@ -556,7 +561,8 @@ class DiseaseState(BaseDiseaseState):
556
561
  return builder.value.register_value_producer(
557
562
  f"{self.state_id}.disability_weight",
558
563
  source=self.compute_disability_weight,
559
- requires_columns=lookup_columns + ["alive", self.model],
564
+ component=self,
565
+ required_resources=lookup_columns + ["alive", self.model],
560
566
  )
561
567
 
562
568
  def get_excess_mortality_rate_source(
@@ -583,8 +589,8 @@ class DiseaseState(BaseDiseaseState):
583
589
  return builder.value.register_rate_producer(
584
590
  self.excess_mortality_rate_pipeline_name,
585
591
  source=self.compute_excess_mortality_rate,
586
- requires_columns=lookup_columns + ["alive", self.model],
587
- requires_values=[self.excess_mortality_rate_paf_pipeline_name],
592
+ component=self,
593
+ required_resources=lookup_columns + ["alive", self.model, self.joint_paf],
588
594
  )
589
595
 
590
596
  def get_joint_paf(self, builder: Builder) -> Pipeline:
@@ -592,12 +598,15 @@ class DiseaseState(BaseDiseaseState):
592
598
  return builder.value.register_value_producer(
593
599
  self.excess_mortality_rate_paf_pipeline_name,
594
600
  source=lambda idx: [paf(idx)],
601
+ component=self,
595
602
  preferred_combiner=list_combiner,
596
603
  preferred_post_processor=union_post_processor,
597
604
  )
598
605
 
599
606
  def get_randomness_prevalence(self, builder: Builder) -> RandomnessStream:
600
- return builder.randomness.get_stream(f"{self.state_id}_prevalent_cases")
607
+ return builder.randomness.get_stream(
608
+ f"{self.state_id}_prevalent_cases", component=self
609
+ )
601
610
 
602
611
  ##################
603
612
  # Public methods #
@@ -129,19 +129,20 @@ class RateTransition(Transition):
129
129
  # noinspection PyAttributeOutsideInit
130
130
  def setup(self, builder: Builder) -> None:
131
131
  lookup_columns = get_lookup_columns([self.lookup_tables["transition_rate"]])
132
- self.transition_rate = builder.value.register_rate_producer(
133
- self.transition_rate_pipeline_name,
134
- source=self.compute_transition_rate,
135
- requires_columns=lookup_columns + ["alive"],
136
- requires_values=[f"{self.transition_rate_pipeline_name}.paf"],
137
- )
138
132
  paf = builder.lookup.build_table(0)
139
133
  self.joint_paf = builder.value.register_value_producer(
140
134
  f"{self.transition_rate_pipeline_name}.paf",
141
135
  source=lambda index: [paf(index)],
136
+ component=self,
142
137
  preferred_combiner=list_combiner,
143
138
  preferred_post_processor=union_post_processor,
144
139
  )
140
+ self.transition_rate = builder.value.register_rate_producer(
141
+ self.transition_rate_pipeline_name,
142
+ source=self.compute_transition_rate,
143
+ component=self,
144
+ required_resources=lookup_columns + ["alive", self.joint_paf],
145
+ )
145
146
 
146
147
  #################
147
148
  # Setup methods #
@@ -16,6 +16,7 @@ from vivarium import Component
16
16
  from vivarium.framework.engine import Builder
17
17
  from vivarium.framework.event import Event
18
18
  from vivarium.framework.population import SimulantData
19
+ from vivarium.framework.resource import Resource
19
20
 
20
21
 
21
22
  class DelayedRisk(Component):
@@ -111,12 +112,8 @@ class DelayedRisk(Component):
111
112
  return ["age", "sex", "population"]
112
113
 
113
114
  @property
114
- def initialization_requirements(self) -> dict[str, list[str]]:
115
- return {
116
- "requires_columns": ["age", "sex", "population"],
117
- "requires_values": [],
118
- "requires_streams": [],
119
- }
115
+ def initialization_requirements(self) -> list[str | Resource]:
116
+ return ["age", "sex", "population"]
120
117
 
121
118
  #####################
122
119
  # Lifecycle methods #
@@ -168,9 +165,11 @@ class DelayedRisk(Component):
168
165
  )
169
166
  inc_name = "{}.incidence".format(self.risk)
170
167
  inc_int_name = "{}_intervention.incidence".format(self.risk)
171
- self.incidence = builder.value.register_rate_producer(inc_name, source=inc_data)
168
+ self.incidence = builder.value.register_rate_producer(
169
+ inc_name, source=inc_data, component=self
170
+ )
172
171
  self.int_incidence = builder.value.register_rate_producer(
173
- inc_int_name, source=inc_data
172
+ inc_int_name, source=inc_data, component=self
174
173
  )
175
174
 
176
175
  # Load the remission rates for the BAU and intervention scenarios.
@@ -183,9 +182,11 @@ class DelayedRisk(Component):
183
182
  )
184
183
  rem_name = "{}.remission".format(self.risk)
185
184
  rem_int_name = "{}_intervention.remission".format(self.risk)
186
- self.remission = builder.value.register_rate_producer(rem_name, source=rem_data)
185
+ self.remission = builder.value.register_rate_producer(
186
+ rem_name, source=rem_data, component=self
187
+ )
187
188
  self.int_remission = builder.value.register_rate_producer(
188
- rem_int_name, source=rem_data
189
+ rem_int_name, source=rem_data, component=self
189
190
  )
190
191
 
191
192
  # We apply separate mortality rates to the different exposure bins.
@@ -255,6 +256,7 @@ class DelayedRisk(Component):
255
256
  source=builder.lookup.build_table(
256
257
  mortality_data, key_columns=["sex"], parameter_columns=["age", "year"]
257
258
  ),
259
+ component=self,
258
260
  )
259
261
 
260
262
  #################
@@ -312,7 +314,7 @@ class DelayedRisk(Component):
312
314
  for template in rate_templates:
313
315
  rate_name = template.format(disease)
314
316
  modifier = lambda ix, rate: self.incidence_adjustment(disease, ix, rate)
315
- builder.value.register_value_modifier(rate_name, modifier)
317
+ builder.value.register_value_modifier(rate_name, modifier, component=self)
316
318
 
317
319
  ########################
318
320
  # Event-driven methods #
@@ -16,6 +16,7 @@ from vivarium import Component
16
16
  from vivarium.framework.engine import Builder
17
17
  from vivarium.framework.event import Event
18
18
  from vivarium.framework.population import SimulantData
19
+ from vivarium.framework.resource import Resource
19
20
 
20
21
 
21
22
  class AcuteDisease(Component):
@@ -67,19 +68,23 @@ class AcuteDisease(Component):
67
68
  yld_data, key_columns=["sex"], parameter_columns=["age", "year"]
68
69
  )
69
70
  self.excess_mortality = builder.value.register_rate_producer(
70
- f"{self.disease}.excess_mortality", source=mty_rate
71
+ f"{self.disease}.excess_mortality", source=mty_rate, component=self
71
72
  )
72
73
  self.int_excess_mortality = builder.value.register_rate_producer(
73
- f"{self.disease}_intervention.excess_mortality", source=mty_rate
74
+ f"{self.disease}_intervention.excess_mortality", source=mty_rate, component=self
74
75
  )
75
76
  self.disability_rate = builder.value.register_rate_producer(
76
- f"{self.disease}.yld_rate", source=yld_rate
77
+ f"{self.disease}.yld_rate", source=yld_rate, component=self
77
78
  )
78
79
  self.int_disability_rate = builder.value.register_rate_producer(
79
- f"{self.disease}_intervention.yld_rate", source=yld_rate
80
+ f"{self.disease}_intervention.yld_rate", source=yld_rate, component=self
81
+ )
82
+ builder.value.register_value_modifier(
83
+ "mortality_rate", self.mortality_adjustment, component=self
84
+ )
85
+ builder.value.register_value_modifier(
86
+ "yld_rate", self.disability_adjustment, component=self
80
87
  )
81
- builder.value.register_value_modifier("mortality_rate", self.mortality_adjustment)
82
- builder.value.register_value_modifier("yld_rate", self.disability_adjustment)
83
88
 
84
89
  ##################################
85
90
  # Pipeline sources and modifiers #
@@ -164,12 +169,8 @@ class Disease(Component):
164
169
  return ["age", "sex"]
165
170
 
166
171
  @property
167
- def initialization_requirements(self) -> dict[str, list[str]]:
168
- return {
169
- "requires_columns": ["age", "sex"],
170
- "requires_values": [],
171
- "requires_streams": [],
172
- }
172
+ def initialization_requirements(self) -> list[str | Resource]:
173
+ return ["age", "sex"]
173
174
 
174
175
  def __init__(self, disease: str):
175
176
  super().__init__()
@@ -192,10 +193,10 @@ class Disease(Component):
192
193
  inc_data, key_columns=["sex"], parameter_columns=["age", "year"]
193
194
  )
194
195
  self.incidence = builder.value.register_rate_producer(
195
- bau_prefix + "incidence", source=i
196
+ bau_prefix + "incidence", source=i, component=self
196
197
  )
197
198
  self.incidence_intervention = builder.value.register_rate_producer(
198
- int_prefix + "incidence", source=i
199
+ int_prefix + "incidence", source=i, component=self
199
200
  )
200
201
 
201
202
  rem_data = builder.data.load(data_prefix + "remission")
@@ -203,7 +204,7 @@ class Disease(Component):
203
204
  rem_data, key_columns=["sex"], parameter_columns=["age", "year"]
204
205
  )
205
206
  self.remission = builder.value.register_rate_producer(
206
- bau_prefix + "remission", source=r
207
+ bau_prefix + "remission", source=r, component=self
207
208
  )
208
209
 
209
210
  mty_data = builder.data.load(data_prefix + "mortality")
@@ -211,7 +212,7 @@ class Disease(Component):
211
212
  mty_data, key_columns=["sex"], parameter_columns=["age", "year"]
212
213
  )
213
214
  self.excess_mortality = builder.value.register_rate_producer(
214
- bau_prefix + "excess_mortality", source=f
215
+ bau_prefix + "excess_mortality", source=f, component=self
215
216
  )
216
217
 
217
218
  yld_data = builder.data.load(data_prefix + "morbidity")
@@ -219,7 +220,7 @@ class Disease(Component):
219
220
  yld_data, key_columns=["sex"], parameter_columns=["age", "year"]
220
221
  )
221
222
  self.disability_rate = builder.value.register_rate_producer(
222
- bau_prefix + "yld_rate", source=yld_rate
223
+ bau_prefix + "yld_rate", source=yld_rate, component=self
223
224
  )
224
225
 
225
226
  prev_data = builder.data.load(data_prefix + "prevalence")
@@ -227,8 +228,12 @@ class Disease(Component):
227
228
  prev_data, key_columns=["sex"], parameter_columns=["age", "year"]
228
229
  )
229
230
 
230
- builder.value.register_value_modifier("mortality_rate", self.mortality_adjustment)
231
- builder.value.register_value_modifier("yld_rate", self.disability_adjustment)
231
+ builder.value.register_value_modifier(
232
+ "mortality_rate", self.mortality_adjustment, component=self
233
+ )
234
+ builder.value.register_value_modifier(
235
+ "yld_rate", self.disability_adjustment, component=self
236
+ )
232
237
 
233
238
  ########################
234
239
  # Event-driven methods #
@@ -44,7 +44,9 @@ class ModifyAllCauseMortality(Component):
44
44
  self.scale = self.config.intervention[self.intervention]["scale"]
45
45
  if self.scale < 0:
46
46
  raise ValueError("Invalid scale: {}".format(self.scale))
47
- builder.value.register_value_modifier("mortality_rate", self.mortality_adjustment)
47
+ builder.value.register_value_modifier(
48
+ "mortality_rate", self.mortality_adjustment, component=self
49
+ )
48
50
 
49
51
  ##################################
50
52
  # Pipeline sources and modifiers #
@@ -89,7 +91,7 @@ class ModifyDiseaseRate(Component):
89
91
  if self.scale < 0:
90
92
  raise ValueError("Invalid scale: {}".format(self.scale))
91
93
  rate_name = "{}_intervention.{}".format(self.disease, self.rate)
92
- builder.value.register_value_modifier(rate_name, self.adjust_rate)
94
+ builder.value.register_value_modifier(rate_name, self.adjust_rate, component=self)
93
95
 
94
96
  ##################################
95
97
  # Pipeline sources and modifiers #
@@ -167,9 +169,9 @@ class ModifyAcuteDiseaseIncidence(Component):
167
169
  if self.scale < 0:
168
170
  raise ValueError("Invalid incidence scale: {}".format(self.scale))
169
171
  yld_rate = "{}_intervention.yld_rate".format(self.intervention)
170
- builder.value.register_value_modifier(yld_rate, self.rate_adjustment)
172
+ builder.value.register_value_modifier(yld_rate, self.rate_adjustment, component=self)
171
173
  mort_rate = "{}_intervention.excess_mortality".format(self.intervention)
172
- builder.value.register_value_modifier(mort_rate, self.rate_adjustment)
174
+ builder.value.register_value_modifier(mort_rate, self.rate_adjustment, component=self)
173
175
 
174
176
  ##################################
175
177
  # Pipeline sources and modifiers #
@@ -210,7 +212,9 @@ class ModifyAcuteDiseaseMorbidity(Component):
210
212
  if self.scale < 0:
211
213
  raise ValueError("Invalid YLD scale: {}".format(self.scale))
212
214
  rate = "{}_intervention.yld_rate".format(self.intervention)
213
- builder.value.register_value_modifier(rate, self.disability_adjustment)
215
+ builder.value.register_value_modifier(
216
+ rate, self.disability_adjustment, component=self
217
+ )
214
218
 
215
219
  ##################################
216
220
  # Pipeline sources and modifiers #
@@ -251,7 +255,7 @@ class ModifyAcuteDiseaseMortality(Component):
251
255
  if self.scale < 0:
252
256
  raise ValueError("Invalid mortality scale: {}".format(self.scale))
253
257
  rate = "{}_intervention.excess_mortality".format(self.intervention)
254
- builder.value.register_value_modifier(rate, self.mortality_adjustment)
258
+ builder.value.register_value_modifier(rate, self.mortality_adjustment, component=self)
255
259
 
256
260
  ##################################
257
261
  # Pipeline sources and modifiers #
@@ -288,7 +292,7 @@ class TobaccoFreeGeneration(Component):
288
292
  self.year = builder.configuration["tobacco_free_generation"].year
289
293
  self.clock = builder.time.clock()
290
294
  rate_name = "{}_intervention.incidence".format(self.exposure)
291
- builder.value.register_value_modifier(rate_name, self.adjust_rate)
295
+ builder.value.register_value_modifier(rate_name, self.adjust_rate, component=self)
292
296
 
293
297
  ##################################
294
298
  # Pipeline sources and modifiers #
@@ -329,9 +333,13 @@ class TobaccoEradication(Component):
329
333
  self.year = builder.configuration["tobacco_eradication"].year
330
334
  self.clock = builder.time.clock()
331
335
  inc_rate_name = "{}_intervention.incidence".format(self.exposure)
332
- builder.value.register_value_modifier(inc_rate_name, self.adjust_inc_rate)
336
+ builder.value.register_value_modifier(
337
+ inc_rate_name, self.adjust_inc_rate, component=self
338
+ )
333
339
  rem_rate_name = "{}_intervention.remission".format(self.exposure)
334
- builder.value.register_value_modifier(rem_rate_name, self.adjust_rem_rate)
340
+ builder.value.register_value_modifier(
341
+ rem_rate_name, self.adjust_rem_rate, component=self
342
+ )
335
343
 
336
344
  ##################################
337
345
  # Pipeline sources and modifiers #
@@ -20,7 +20,9 @@ class MortalityShift(Component):
20
20
  #####################
21
21
 
22
22
  def setup(self, builder: Builder) -> None:
23
- builder.value.register_value_modifier("mortality_rate", self.mortality_adjustment)
23
+ builder.value.register_value_modifier(
24
+ "mortality_rate", self.mortality_adjustment, component=self
25
+ )
24
26
 
25
27
  ##################################
26
28
  # Pipeline sources and modifiers #
@@ -36,7 +38,9 @@ class YLDShift(Component):
36
38
  #####################
37
39
 
38
40
  def setup(self, builder: Builder) -> None:
39
- builder.value.register_value_modifier("yld_rate", self.disability_adjustment)
41
+ builder.value.register_value_modifier(
42
+ "yld_rate", self.disability_adjustment, component=self
43
+ )
40
44
 
41
45
  ##################################
42
46
  # Pipeline sources and modifiers #
@@ -56,7 +60,9 @@ class IncidenceShift(Component):
56
60
 
57
61
  def setup(self, builder: Builder) -> None:
58
62
  builder.value.register_value_modifier(
59
- f"{self.disease}_intervention.incidence", self.incidence_adjustment
63
+ f"{self.disease}_intervention.incidence",
64
+ self.incidence_adjustment,
65
+ component=self,
60
66
  )
61
67
 
62
68
  ##################################
@@ -95,7 +101,9 @@ class ModifyAcuteDiseaseYLD(Component):
95
101
  if self.scale < 0:
96
102
  raise ValueError(f"Invalid YLD scale: {self.scale}")
97
103
  builder.value.register_value_modifier(
98
- f"{self.disease}_intervention.yld_rate", self.disability_adjustment
104
+ f"{self.disease}_intervention.yld_rate",
105
+ self.disability_adjustment,
106
+ component=self,
99
107
  )
100
108
 
101
109
  ##################################
@@ -134,7 +142,9 @@ class ModifyAcuteDiseaseMortality(Component):
134
142
  if self.scale < 0:
135
143
  raise ValueError(f"Invalid mortality scale: {self.scale}")
136
144
  builder.value.register_value_modifier(
137
- f"{self.disease}_intervention.excess_mortality", self.mortality_adjustment
145
+ f"{self.disease}_intervention.excess_mortality",
146
+ self.mortality_adjustment,
147
+ component=self,
138
148
  )
139
149
 
140
150
  ##################################
@@ -146,6 +146,7 @@ class Mortality(Component):
146
146
  source=builder.lookup.build_table(
147
147
  mortality_data, key_columns=["sex"], parameter_columns=["age", "year"]
148
148
  ),
149
+ component=self,
149
150
  )
150
151
 
151
152
  ########################
@@ -208,7 +209,9 @@ class Disability(Component):
208
209
  yld_rate = builder.lookup.build_table(
209
210
  yld_data, key_columns=["sex"], parameter_columns=["age", "year"]
210
211
  )
211
- self.yld_rate = builder.value.register_rate_producer("yld_rate", source=yld_rate)
212
+ self.yld_rate = builder.value.register_rate_producer(
213
+ "yld_rate", source=yld_rate, component=self
214
+ )
212
215
 
213
216
  ########################
214
217
  # Event-driven methods #
@@ -13,6 +13,7 @@ from vivarium import Component
13
13
  from vivarium.framework.engine import Builder
14
14
  from vivarium.framework.event import Event
15
15
  from vivarium.framework.population import SimulantData
16
+ from vivarium.framework.resource import Resource
16
17
 
17
18
  from vivarium_public_health import utilities
18
19
  from vivarium_public_health.population.data_transformations import get_live_births_per_year
@@ -164,12 +165,8 @@ class FertilityAgeSpecificRates(Component):
164
165
  return ["sex"]
165
166
 
166
167
  @property
167
- def initialization_requirements(self) -> dict[str, list[str]]:
168
- return {
169
- "requires_columns": ["sex"],
170
- "requires_values": [],
171
- "requires_streams": [],
172
- }
168
+ def initialization_requirements(self) -> list[str | Resource]:
169
+ return ["sex"]
173
170
 
174
171
  #####################
175
172
  # Lifecycle methods #
@@ -188,10 +185,13 @@ class FertilityAgeSpecificRates(Component):
188
185
  age_specific_fertility_rate, parameter_columns=["age", "year"]
189
186
  )
190
187
  self.fertility_rate = builder.value.register_rate_producer(
191
- "fertility rate", source=fertility_rate, requires_columns=["age"]
188
+ "fertility rate",
189
+ source=fertility_rate,
190
+ component=self,
191
+ required_resources=["age"],
192
192
  )
193
193
 
194
- self.randomness = builder.randomness.get_stream("fertility")
194
+ self.randomness = builder.randomness.get_stream("fertility", component=self)
195
195
  self.simulant_creator = builder.population.get_simulant_creator()
196
196
 
197
197
  #################
@@ -88,18 +88,19 @@ class BasePopulation(Component):
88
88
  # Setup methods #
89
89
  #################
90
90
 
91
- @staticmethod
92
- def get_randomness_streams(builder: Builder) -> dict[str, RandomnessStream]:
91
+ def get_randomness_streams(self, builder: Builder) -> dict[str, RandomnessStream]:
93
92
  return {
94
- "general_purpose": builder.randomness.get_stream("population_generation"),
93
+ "general_purpose": builder.randomness.get_stream(
94
+ "population_generation", component=self
95
+ ),
95
96
  "bin_selection": builder.randomness.get_stream(
96
- "bin_selection", initializes_crn_attributes=True
97
+ "bin_selection", component=self, initializes_crn_attributes=True
97
98
  ),
98
99
  "age_smoothing": builder.randomness.get_stream(
99
- "age_smoothing", initializes_crn_attributes=True
100
+ "age_smoothing", component=self, initializes_crn_attributes=True
100
101
  ),
101
102
  "age_smoothing_age_bounds": builder.randomness.get_stream(
102
- "age_smoothing_age_bounds", initializes_crn_attributes=True
103
+ "age_smoothing_age_bounds", component=self, initializes_crn_attributes=True
103
104
  ),
104
105
  }
105
106