vivarium-public-health 4.3.2__tar.gz → 4.3.4__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 (172) hide show
  1. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.gitignore +1 -4
  2. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/CHANGELOG.rst +10 -2
  3. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/PKG-INFO +2 -2
  4. vivarium_public_health-4.3.4/docs/source/api_reference/risks/distributions.rst +1 -0
  5. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/setup.py +1 -1
  6. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/__init__.py +1 -7
  7. vivarium_public_health-4.3.4/src/vivarium_public_health/_version.py +1 -0
  8. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/population/data_transformations.py +13 -14
  9. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/__init__.py +0 -1
  10. vivarium_public_health-4.3.2/src/vivarium_public_health/exposure/exposure.py → vivarium_public_health-4.3.4/src/vivarium_public_health/risks/base_risk.py +99 -48
  11. {vivarium_public_health-4.3.2/src/vivarium_public_health/exposure → vivarium_public_health-4.3.4/src/vivarium_public_health/risks}/distributions.py +38 -102
  12. vivarium_public_health-4.3.4/src/vivarium_public_health/risks/effect.py +533 -0
  13. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +12 -17
  14. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/treatment/__init__.py +0 -1
  15. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/PKG-INFO +2 -2
  16. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/SOURCES.txt +1 -14
  17. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/requires.txt +1 -1
  18. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/mock_artifact.py +0 -26
  19. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_categorical_risk_observer.py +4 -4
  20. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/test_base_risk.py +11 -46
  21. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/test_data_transformations.py +3 -5
  22. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/test_effect.py +7 -8
  23. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/test_low_birth_weight_and_short_gestation.py +1 -1
  24. vivarium_public_health-4.3.2/docs/source/api_reference/exposure/data_transformations.rst +0 -1
  25. vivarium_public_health-4.3.2/docs/source/api_reference/exposure/distributions.rst +0 -1
  26. vivarium_public_health-4.3.2/docs/source/api_reference/exposure/effect.rst +0 -1
  27. vivarium_public_health-4.3.2/docs/source/api_reference/exposure/exposure.rst +0 -1
  28. vivarium_public_health-4.3.2/docs/source/api_reference/exposure/index.rst +0 -11
  29. vivarium_public_health-4.3.2/docs/source/api_reference/treatment/intervention.rst +0 -1
  30. vivarium_public_health-4.3.2/src/vivarium_public_health/_version.py +0 -1
  31. vivarium_public_health-4.3.2/src/vivarium_public_health/exposure/__init__.py +0 -2
  32. vivarium_public_health-4.3.2/src/vivarium_public_health/exposure/effect.py +0 -356
  33. vivarium_public_health-4.3.2/src/vivarium_public_health/results/intervention.py +0 -139
  34. vivarium_public_health-4.3.2/src/vivarium_public_health/risks/base_risk.py +0 -125
  35. vivarium_public_health-4.3.2/src/vivarium_public_health/risks/data_transformations.py +0 -32
  36. vivarium_public_health-4.3.2/src/vivarium_public_health/risks/distributions.py +0 -24
  37. vivarium_public_health-4.3.2/src/vivarium_public_health/risks/effect.py +0 -247
  38. vivarium_public_health-4.3.2/src/vivarium_public_health/treatment/intervention.py +0 -85
  39. vivarium_public_health-4.3.2/tests/interventions/test_intervention.py +0 -126
  40. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.bandit +0 -0
  41. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.flake8 +0 -0
  42. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.gitattributes +0 -0
  43. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.github/CODEOWNERS +0 -0
  44. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.github/pull_request_template.md +0 -0
  45. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.github/workflows/deploy.yml +0 -0
  46. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.pylintrc +0 -0
  47. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.readthedocs.yml +0 -0
  48. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/.zenodo.json +0 -0
  49. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/CODE_OF_CONDUCT.rst +0 -0
  50. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/CONTRIBUTING.rst +0 -0
  51. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/Jenkinsfile +0 -0
  52. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/LICENSE.txt +0 -0
  53. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/MANIFEST.in +0 -0
  54. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/Makefile +0 -0
  55. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/README.rst +0 -0
  56. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/Makefile +0 -0
  57. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/nitpick-exceptions +0 -0
  58. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/_static/style.css +0 -0
  59. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/_templates/layout.html +0 -0
  60. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/index.rst +0 -0
  61. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/model.rst +0 -0
  62. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/models.rst +0 -0
  63. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/special_disease.rst +0 -0
  64. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/state.rst +0 -0
  65. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/disease/transition.rst +0 -0
  66. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/index.rst +0 -0
  67. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/delay.rst +0 -0
  68. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/disease.rst +0 -0
  69. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/index.rst +0 -0
  70. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/intervention.rst +0 -0
  71. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/magic_wand_components.rst +0 -0
  72. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/observer.rst +0 -0
  73. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/mslt/population.rst +0 -0
  74. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/plugins/index.rst +0 -0
  75. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/plugins/parser.rst +0 -0
  76. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/population/add_new_birth_cohorts.rst +0 -0
  77. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/population/base_population.rst +0 -0
  78. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/population/data_transformations.rst +0 -0
  79. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/population/index.rst +0 -0
  80. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/population/mortality.rst +0 -0
  81. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/disability.rst +0 -0
  82. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/disease.rst +0 -0
  83. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/index.rst +0 -0
  84. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/mortality.rst +0 -0
  85. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/observer.rst +0 -0
  86. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/risk.rst +0 -0
  87. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/simple_cause.rst +0 -0
  88. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/results/stratification.rst +0 -0
  89. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/base_risk.rst +0 -0
  90. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/data_transformations.rst +0 -0
  91. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/effect.rst +0 -0
  92. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/implementations/index.rst +0 -0
  93. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/implementations/low_birth_weight_and_short_gestation.rst +0 -0
  94. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/risks/index.rst +0 -0
  95. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/treatment/index.rst +0 -0
  96. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/treatment/magic_wand.rst +0 -0
  97. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/treatment/scale_up.rst +0 -0
  98. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/treatment/therapeutic_inertia.rst +0 -0
  99. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/api_reference/utilities.rst +0 -0
  100. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/conf.py +0 -0
  101. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/index.rst +0 -0
  102. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/tutorials/index.rst +0 -0
  103. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/docs/source/tutorials/risk_exposure.rst +0 -0
  104. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/pyproject.toml +0 -0
  105. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/python_versions.json +0 -0
  106. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/setup.cfg +0 -0
  107. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/__about__.py +0 -0
  108. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/__init__.py +0 -0
  109. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/exceptions.py +0 -0
  110. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/model.py +0 -0
  111. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/models.py +0 -0
  112. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/special_disease.py +0 -0
  113. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/state.py +0 -0
  114. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/disease/transition.py +0 -0
  115. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/__init__.py +0 -0
  116. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/delay.py +0 -0
  117. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/disease.py +0 -0
  118. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/intervention.py +0 -0
  119. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/magic_wand_components.py +0 -0
  120. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/observer.py +0 -0
  121. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/mslt/population.py +0 -0
  122. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/plugins/__init__.py +0 -0
  123. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/plugins/parser.py +0 -0
  124. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/population/__init__.py +0 -0
  125. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/population/add_new_birth_cohorts.py +0 -0
  126. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/population/base_population.py +0 -0
  127. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/population/mortality.py +0 -0
  128. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/columns.py +0 -0
  129. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/disability.py +0 -0
  130. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/disease.py +0 -0
  131. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/mortality.py +0 -0
  132. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/observer.py +0 -0
  133. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/risk.py +0 -0
  134. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/simple_cause.py +0 -0
  135. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/results/stratification.py +0 -0
  136. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/risks/__init__.py +0 -0
  137. {vivarium_public_health-4.3.2/src/vivarium_public_health/exposure → vivarium_public_health-4.3.4/src/vivarium_public_health/risks}/data_transformations.py +0 -0
  138. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/risks/implementations/__init__.py +0 -0
  139. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/treatment/magic_wand.py +0 -0
  140. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/treatment/scale_up.py +0 -0
  141. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/treatment/therapeutic_inertia.py +0 -0
  142. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health/utilities.py +0 -0
  143. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/dependency_links.txt +0 -0
  144. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/not-zip-safe +0 -0
  145. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/src/vivarium_public_health.egg-info/top_level.txt +0 -0
  146. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/__init__.py +0 -0
  147. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/conftest.py +0 -0
  148. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/data/rr_interpolator.csv +0 -0
  149. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/disease/__init__.py +0 -0
  150. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/disease/test_disease.py +0 -0
  151. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/disease/test_special_disease.py +0 -0
  152. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/plugins/__init__.py +0 -0
  153. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/plugins/test_parser.py +0 -0
  154. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/__init__.py +0 -0
  155. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/conftest.py +0 -0
  156. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/test_add_new_birth_cohort.py +0 -0
  157. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/test_base_population.py +0 -0
  158. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/test_data_transformations.py +0 -0
  159. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/population/test_mortality.py +0 -0
  160. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/__init__.py +0 -0
  161. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_disability.py +0 -0
  162. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_disability_observer.py +0 -0
  163. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_disease_observer.py +0 -0
  164. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_mortality_observer.py +0 -0
  165. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/results/test_stratification.py +0 -0
  166. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/__init__.py +0 -0
  167. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/conftest.py +0 -0
  168. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/risks/test_distributions.py +0 -0
  169. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/test_utilities.py +0 -0
  170. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/treatment/__init__.py +0 -0
  171. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tests/treatment/test_scale_up.py +0 -0
  172. {vivarium_public_health-4.3.2 → vivarium_public_health-4.3.4}/tox.ini +0 -0
@@ -114,7 +114,4 @@ src/vivarium_public_health/_version.py
114
114
  tests/proportion_test_diagnostics.csv
115
115
 
116
116
  # macOS
117
- *.DS_Store
118
-
119
- # Visual Studio Code project settings
120
- .vscode/
117
+ *.DS_Store
@@ -1,8 +1,16 @@
1
- **4.3.2 - 07/30/25**
1
+ **4.3.4 - 07/31/25**
2
+
3
+ - Modify futurewarning fix from v4.2.6 to not require pandas>=2.2.0
4
+
5
+ **4.3.3 - 07/30/25**
6
+
7
+ - Revert changes from v4.3.0-4.3.2
8
+
9
+ **4.3.2 - 07/30/25** (withdrawn)
2
10
 
3
11
  - Support RiskEffect backwards compatibility with v4.2.x
4
12
 
5
- **4.3.1 - 07/30/25**
13
+ **4.3.1 - 07/30/25** (withdrawn)
6
14
 
7
15
  - Bugfix: reference correct entity name in LBWSG get_current_exposure method
8
16
  - Support backwards compatibility with v4.2.x
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vivarium_public_health
3
- Version: 4.3.2
3
+ Version: 4.3.4
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
@@ -31,7 +31,7 @@ Requires-Dist: vivarium>=3.4.3
31
31
  Requires-Dist: layered_config_tree>=3.2.0
32
32
  Requires-Dist: loguru
33
33
  Requires-Dist: numpy<2.0.0
34
- Requires-Dist: pandas>=2.2.0
34
+ Requires-Dist: pandas
35
35
  Requires-Dist: scipy
36
36
  Requires-Dist: tables
37
37
  Requires-Dist: risk_distributions>=2.0.11
@@ -0,0 +1 @@
1
+ .. automodule:: vivarium_public_health.risks.distributions
@@ -47,7 +47,7 @@ if __name__ == "__main__":
47
47
  "layered_config_tree>=3.2.0",
48
48
  "loguru",
49
49
  "numpy<2.0.0",
50
- "pandas>=2.2.0",
50
+ "pandas",
51
51
  "scipy",
52
52
  "tables",
53
53
  "risk_distributions>=2.0.11",
@@ -46,13 +46,7 @@ from vivarium_public_health.risks import (
46
46
  Risk,
47
47
  RiskEffect,
48
48
  )
49
- from vivarium_public_health.treatment import (
50
- AbsoluteShift,
51
- Intervention,
52
- InterventionEffect,
53
- LinearScaleUp,
54
- TherapeuticInertia,
55
- )
49
+ from vivarium_public_health.treatment import AbsoluteShift, LinearScaleUp, TherapeuticInertia
56
50
 
57
51
  __all__ = [
58
52
  __author__,
@@ -0,0 +1 @@
1
+ __version__ = "4.3.4"
@@ -52,29 +52,28 @@ def assign_demographic_proportions(
52
52
  if include_sex != "Both":
53
53
  population_data.loc[population_data.sex != include_sex, "value"] = 0.0
54
54
 
55
+ year_start_groups = population_data.groupby("year_start", as_index=False)
55
56
  population_data["P(sex, location, age| year)"] = (
56
- population_data.groupby("year_start", as_index=False)
57
- .apply(
58
- lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum(), include_groups=False
59
- )
57
+ year_start_groups[year_start_groups.obj.columns]
58
+ .apply(lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum())
60
59
  .reset_index(level=0)["value"]
61
60
  .fillna(0.0)
62
61
  )
63
62
 
63
+ age_year_start_groups = population_data.groupby(["age", "year_start"], as_index=False)
64
64
  population_data["P(sex, location | age, year)"] = (
65
- population_data.groupby(["age", "year_start"], as_index=False)
66
- .apply(
67
- lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum(), include_groups=False
68
- )
65
+ age_year_start_groups[age_year_start_groups.obj.columns]
66
+ .apply(lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum())
69
67
  .reset_index(level=0)["value"]
70
68
  .fillna(0.0)
71
69
  )
72
70
 
71
+ year_start_sex_location_groups = population_data.groupby(
72
+ ["year_start", "sex", "location"], as_index=False
73
+ )
73
74
  population_data["P(age | year, sex, location)"] = (
74
- population_data.groupby(["year_start", "sex", "location"], as_index=False)
75
- .apply(
76
- lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum(), include_groups=False
77
- )
75
+ year_start_sex_location_groups[year_start_sex_location_groups.obj.columns]
76
+ .apply(lambda sub_pop: sub_pop[["value"]] / sub_pop["value"].sum())
78
77
  .reset_index(level=0)["value"]
79
78
  .fillna(0.0)
80
79
  )
@@ -584,8 +583,8 @@ def rescale_final_age_bin(builder, population_data):
584
583
 
585
584
  def validate_crude_birth_rate_data(builder, data_year_max):
586
585
  population_config = builder.configuration.population.to_dict()
587
- untracking_age = population_config.get("untracking_age")
588
- age_end = population_config.get("age_end")
586
+ untracking_age = population_config.get("untracking_age", None)
587
+ age_end = population_config.get("age_end", None)
589
588
  if untracking_age and age_end and age_end != untracking_age:
590
589
  raise ValueError(
591
590
  "If you specify an exit age, the initial population age end must be the same "
@@ -1,7 +1,6 @@
1
1
  from .columns import COLUMNS
2
2
  from .disability import DisabilityObserver
3
3
  from .disease import DiseaseObserver
4
- from .intervention import CategoricalInterventionObserver
5
4
  from .mortality import MortalityObserver
6
5
  from .observer import PublicHealthObserver
7
6
  from .risk import CategoricalRiskObserver
@@ -1,5 +1,14 @@
1
- from abc import ABC, abstractmethod
2
- from typing import Any, NamedTuple
1
+ """
2
+ ===================
3
+ Risk Exposure Model
4
+ ===================
5
+
6
+ This module contains tools for modeling categorical and continuous risk
7
+ exposure.
8
+
9
+ """
10
+
11
+ from typing import Any
3
12
 
4
13
  import pandas as pd
5
14
  from vivarium import Component
@@ -10,23 +19,73 @@ from vivarium.framework.randomness import RandomnessStream
10
19
  from vivarium.framework.resource import Resource
11
20
  from vivarium.framework.values import Pipeline
12
21
 
13
- from vivarium_public_health.exposure.distributions import (
22
+ from vivarium_public_health.risks.data_transformations import get_exposure_post_processor
23
+ from vivarium_public_health.risks.distributions import (
14
24
  ContinuousDistribution,
15
25
  DichotomousDistribution,
16
26
  EnsembleDistribution,
17
- ExposureDistribution,
18
27
  PolytomousDistribution,
28
+ RiskExposureDistribution,
19
29
  )
20
- from vivarium_public_health.risks.data_transformations import get_exposure_post_processor
21
30
  from vivarium_public_health.utilities import EntityString, get_lookup_columns
22
31
 
23
32
 
24
- class Exposure(Component, ABC):
25
- """A base class to store common functionality for for risk-like health factors.
33
+ class Risk(Component):
34
+ """A model for a risk factor defined by either a continuous or a categorical value.
35
+
36
+ For example,
37
+
38
+ #. high systolic blood pressure as a risk where the SBP is not dichotomized
39
+ into hypotension and normal but is treated as the actual SBP
40
+ measurement.
41
+ #. smoking as two categories: current smoker and non-smoker.
42
+
43
+ This component can source data either from builder.data or from parameters
44
+ supplied in the configuration. If data is derived from the configuration, it
45
+ must be an integer or float expressing the desired exposure level or a
46
+ covariate name that is intended to be used as a proxy. For example, for a
47
+ risk named "risk", the configuration could look like this:
48
+
49
+ .. code-block:: yaml
50
+
51
+ configuration:
52
+ risk:
53
+ exposure: 1.0
54
+
55
+ or
56
+
57
+ .. code-block:: yaml
58
+
59
+ configuration:
60
+ risk:
61
+ exposure: proxy_covariate
26
62
 
27
- This class is used to define the determinant of models health factors such as
28
- risks and the exposure to these risks, or interventions and the available coverage
29
- for these interventions.
63
+ For polytomous risks, you can also provide an optional 'rebinned_exposed'
64
+ block in the configuration to indicate that the risk should be rebinned
65
+ into a dichotomous risk. That block should contain a list of the categories
66
+ that should be rebinned into a single exposed category in the resulting
67
+ dichotomous risk. For example, for a risk named "risk" with categories
68
+ cat1, cat2, cat3, and cat4 that you wished to rebin into a dichotomous risk
69
+ with an exposed category containing cat1 and cat2 and an unexposed category
70
+ containing cat3 and cat4, the configuration could look like this:
71
+
72
+ .. code-block:: yaml
73
+
74
+ configuration:
75
+ risk:
76
+ rebinned_exposed: ['cat1', 'cat2']
77
+
78
+ For alternative risk factors, you must provide a 'category_thresholds'
79
+ block in the in configuration to dictate the thresholds that should be
80
+ used to bin the continuous distributions. Note that this is mutually
81
+ exclusive with providing 'rebinned_exposed' categories. For a risk named
82
+ "risk", the configuration could look like:
83
+
84
+ .. code-block:: yaml
85
+
86
+ configuration:
87
+ risk:
88
+ category_thresholds: [7, 8, 9]
30
89
 
31
90
  """
32
91
 
@@ -45,18 +104,18 @@ class Exposure(Component, ABC):
45
104
 
46
105
  @property
47
106
  def name(self) -> str:
48
- return self.entity
107
+ return self.risk
49
108
 
50
109
  @property
51
110
  def configuration_defaults(self) -> dict[str, Any]:
52
111
  return {
53
112
  self.name: {
54
113
  "data_sources": {
55
- f"{self.exposure_type}": f"{self.entity}.{self.exposure_type}",
56
- "ensemble_distribution_weights": f"{self.entity}.exposure_distribution_weights",
57
- "exposure_standard_deviation": f"{self.entity}.exposure_standard_deviation",
114
+ "exposure": f"{self.risk}.exposure",
115
+ "ensemble_distribution_weights": f"{self.risk}.exposure_distribution_weights",
116
+ "exposure_standard_deviation": f"{self.risk}.exposure_standard_deviation",
58
117
  },
59
- "distribution_type": f"{self.entity}.distribution",
118
+ "distribution_type": f"{self.risk}.distribution",
60
119
  # rebinned_exposed only used for DichotomousDistribution
61
120
  "rebinned_exposed": [],
62
121
  "category_thresholds": [],
@@ -74,42 +133,27 @@ class Exposure(Component, ABC):
74
133
  def initialization_requirements(self) -> list[str | Resource]:
75
134
  return [self.randomness]
76
135
 
77
- @property
78
- @abstractmethod
79
- def exposure_type(self) -> str:
80
- raise NotImplementedError
81
-
82
- @property
83
- @abstractmethod
84
- def dichotomous_exposure_category_names(self) -> NamedTuple:
85
- """The name of the exposure categories. E.g. "exposed" and "unexposed" or
86
- "covered" and "uncovered".
87
-
88
- """
89
- raise NotImplementedError
90
-
91
136
  #####################
92
137
  # Lifecycle methods #
93
138
  #####################
94
139
 
95
- def __init__(self, entity: str) -> None:
140
+ def __init__(self, risk: str):
96
141
  """
97
142
 
98
143
  Parameters
99
144
  ----------
100
- entity
101
- the type and name of a entity, specified as "type.name". Type is singular.
102
- level_type
103
- The type of level for the health factor, e.g., "exposure" or "coverage".
145
+ risk
146
+ the type and name of a risk, specified as "type.name". Type is singular.
104
147
  """
105
148
  super().__init__()
106
- self.entity = EntityString(entity)
149
+ self.risk = EntityString(risk)
107
150
  self.distribution_type = None
108
- self.randomness_stream_name = f"initial_{self.entity.name}_propensity"
109
- self.propensity_column_name = f"{self.entity.name}_propensity"
110
- self.propensity_pipeline_name = f"{self.entity.name}.propensity"
111
- self.exposure_pipeline_name = f"{self.entity.name}.{self.exposure_type}"
112
- self.exposure_column_name = f"{self.entity.name}_{self.exposure_type}"
151
+
152
+ self.randomness_stream_name = f"initial_{self.risk.name}_propensity"
153
+ self.propensity_column_name = f"{self.risk.name}_propensity"
154
+ self.propensity_pipeline_name = f"{self.risk.name}.propensity"
155
+ self.exposure_pipeline_name = f"{self.risk.name}.exposure"
156
+ self.exposure_column_name = f"{self.risk.name}_exposure"
113
157
 
114
158
  #################
115
159
  # Setup methods #
@@ -126,10 +170,17 @@ class Exposure(Component, ABC):
126
170
 
127
171
  self.randomness = self.get_randomness_stream(builder)
128
172
  self.propensity = self.get_propensity_pipeline(builder)
129
- self.exposure = self.get_exposure_callable(builder)
130
- # This will be overwritten in the Risk class if there is a non-loglinear risk effect
131
- # on that risk instance
132
- self.create_exposure_column = False
173
+ self.exposure = self.get_exposure_pipeline(builder)
174
+
175
+ # We want to set this to True iff there is a non-loglinear risk effect
176
+ # on this risk instance
177
+ self.create_exposure_column = bool(
178
+ [
179
+ component
180
+ for component in builder.components.list_components()
181
+ if component.startswith(f"non_log_linear_risk_effect.{self.risk.name}_on_")
182
+ ]
183
+ )
133
184
 
134
185
  def get_distribution_type(self, builder: Builder) -> str:
135
186
  """Get the distribution type for the risk from the configuration.
@@ -165,7 +216,7 @@ class Exposure(Component, ABC):
165
216
  distribution_type = "dichotomous"
166
217
  return distribution_type
167
218
 
168
- def get_exposure_distribution(self, builder: Builder) -> ExposureDistribution:
219
+ def get_exposure_distribution(self, builder: Builder) -> RiskExposureDistribution:
169
220
  """Creates and sets up the exposure distribution component for the Risk
170
221
  based on its distribution type.
171
222
 
@@ -185,7 +236,7 @@ class Exposure(Component, ABC):
185
236
  """
186
237
  try:
187
238
  exposure_distribution = self.exposure_distributions[self.distribution_type](
188
- self, self.distribution_type
239
+ self.risk, self.distribution_type
189
240
  )
190
241
  except KeyError:
191
242
  raise NotImplementedError(
@@ -210,7 +261,7 @@ class Exposure(Component, ABC):
210
261
  required_resources=[self.propensity_column_name],
211
262
  )
212
263
 
213
- def get_exposure_callable(self, builder: Builder) -> Pipeline:
264
+ def get_exposure_pipeline(self, builder: Builder) -> Pipeline:
214
265
  required_columns = get_lookup_columns(
215
266
  self.exposure_distribution.lookup_tables.values()
216
267
  )
@@ -242,7 +293,7 @@ class Exposure(Component, ABC):
242
293
 
243
294
  def update_exposure_column(self, index: pd.Index) -> None:
244
295
  if self.create_exposure_column:
245
- exposure = pd.Series(self.exposure_type(index), name=self.exposure_column_name)
296
+ exposure = pd.Series(self.exposure(index), name=self.exposure_column_name)
246
297
  self.population_view.update(exposure)
247
298
 
248
299
  ##################################