vivarium-public-health 2.1.1__tar.gz → 2.1.3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.github/workflows/build.yml +20 -1
  2. vivarium_public_health-2.1.3/.github/workflows/deploy.yml +49 -0
  3. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/CHANGELOG.rst +8 -0
  4. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/PKG-INFO +24 -2
  5. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/nitpick-exceptions +3 -1
  6. vivarium_public_health-2.1.3/src/vivarium_public_health/_version.py +1 -0
  7. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/state.py +59 -0
  8. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/population/mortality.py +40 -0
  9. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/effect.py +28 -0
  10. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/treatment/scale_up.py +31 -0
  11. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/PKG-INFO +25 -3
  12. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/disease/test_disease.py +9 -13
  13. vivarium_public_health-2.1.1/.github/workflows/deploy.yml +0 -31
  14. vivarium_public_health-2.1.1/src/vivarium_public_health/_version.py +0 -1
  15. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.gitattributes +0 -0
  16. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.github/CODEOWNERS +0 -0
  17. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.github/pull_request_template.md +0 -0
  18. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.gitignore +0 -0
  19. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.pylintrc +0 -0
  20. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.readthedocs.yml +0 -0
  21. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/.zenodo.json +0 -0
  22. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/CODE_OF_CONDUCT.rst +0 -0
  23. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/CONTRIBUTING.rst +0 -0
  24. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/LICENSE.txt +0 -0
  25. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/MANIFEST.in +0 -0
  26. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/README.rst +0 -0
  27. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/Makefile +0 -0
  28. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/_static/style.css +0 -0
  29. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/_templates/layout.html +0 -0
  30. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/index.rst +0 -0
  31. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/model.rst +0 -0
  32. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/models.rst +0 -0
  33. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/special_disease.rst +0 -0
  34. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/state.rst +0 -0
  35. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/disease/transition.rst +0 -0
  36. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/index.rst +0 -0
  37. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/disability.rst +0 -0
  38. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/disease.rst +0 -0
  39. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/index.rst +0 -0
  40. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/mortality.rst +0 -0
  41. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/risk.rst +0 -0
  42. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/metrics/stratification.rst +0 -0
  43. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/delay.rst +0 -0
  44. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/disease.rst +0 -0
  45. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/index.rst +0 -0
  46. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/intervention.rst +0 -0
  47. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/magic_wand_components.rst +0 -0
  48. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/observer.rst +0 -0
  49. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/mslt/population.rst +0 -0
  50. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/population/add_new_birth_cohorts.rst +0 -0
  51. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/population/base_population.rst +0 -0
  52. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/population/data_transformations.rst +0 -0
  53. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/population/index.rst +0 -0
  54. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/population/mortality.rst +0 -0
  55. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/base_risk.rst +0 -0
  56. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/data_transformations.rst +0 -0
  57. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/distributions.rst +0 -0
  58. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/effect.rst +0 -0
  59. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/implementations/index.rst +0 -0
  60. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/implementations/low_birth_weight_and_short_gestation.rst +0 -0
  61. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/risks/index.rst +0 -0
  62. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/testing/index.rst +0 -0
  63. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/testing/mock_artifact.rst +0 -0
  64. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/testing/utils.rst +0 -0
  65. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/treatment/index.rst +0 -0
  66. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/treatment/magic_wand.rst +0 -0
  67. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/treatment/scale_up.rst +0 -0
  68. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/treatment/therapeutic_inertia.rst +0 -0
  69. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/api_reference/utilities.rst +0 -0
  70. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/conf.py +0 -0
  71. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/index.rst +0 -0
  72. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/tutorials/index.rst +0 -0
  73. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/docs/source/tutorials/risk_exposure.rst +0 -0
  74. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/pyproject.toml +0 -0
  75. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/setup.cfg +0 -0
  76. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/setup.py +0 -0
  77. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/__about__.py +0 -0
  78. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/__init__.py +0 -0
  79. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/__init__.py +0 -0
  80. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/model.py +0 -0
  81. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/models.py +0 -0
  82. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/special_disease.py +0 -0
  83. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/disease/transition.py +0 -0
  84. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/__init__.py +0 -0
  85. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/disability.py +0 -0
  86. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/disease.py +0 -0
  87. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/mortality.py +0 -0
  88. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/risk.py +0 -0
  89. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/metrics/stratification.py +0 -0
  90. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/__init__.py +0 -0
  91. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/delay.py +0 -0
  92. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/disease.py +0 -0
  93. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/intervention.py +0 -0
  94. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/magic_wand_components.py +0 -0
  95. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/observer.py +0 -0
  96. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/mslt/population.py +0 -0
  97. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/population/__init__.py +0 -0
  98. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/population/add_new_birth_cohorts.py +0 -0
  99. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/population/base_population.py +0 -0
  100. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/population/data_transformations.py +0 -0
  101. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/__init__.py +0 -0
  102. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/base_risk.py +0 -0
  103. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/data_transformations.py +0 -0
  104. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/distributions.py +0 -0
  105. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/implementations/__init__.py +0 -0
  106. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/risks/implementations/low_birth_weight_and_short_gestation.py +0 -0
  107. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/testing/__init__.py +0 -0
  108. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/testing/mock_artifact.py +0 -0
  109. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/testing/utils.py +0 -0
  110. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/treatment/__init__.py +0 -0
  111. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/treatment/magic_wand.py +0 -0
  112. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/treatment/therapeutic_inertia.py +0 -0
  113. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health/utilities.py +0 -0
  114. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/SOURCES.txt +0 -0
  115. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/dependency_links.txt +0 -0
  116. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/not-zip-safe +0 -0
  117. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/requires.txt +0 -0
  118. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/src/vivarium_public_health.egg-info/top_level.txt +0 -0
  119. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/__init__.py +0 -0
  120. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/conftest.py +0 -0
  121. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/disease/__init__.py +0 -0
  122. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/disease/test_special_disease.py +0 -0
  123. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/__init__.py +0 -0
  124. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_categorical_risk_observer.py +0 -0
  125. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_disability.py +0 -0
  126. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_disability_observer.py +0 -0
  127. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_disease_observer.py +0 -0
  128. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_mortality_observer.py +0 -0
  129. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/metrics/test_stratification.py +0 -0
  130. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/population/__init__.py +0 -0
  131. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/population/conftest.py +0 -0
  132. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/population/test_add_new_birth_cohort.py +0 -0
  133. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/population/test_base_population.py +0 -0
  134. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/population/test_data_transformations.py +0 -0
  135. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/__init__.py +0 -0
  136. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/conftest.py +0 -0
  137. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/test_base_risk.py +0 -0
  138. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/test_data_transformations.py +0 -0
  139. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/test_distributions.py +0 -0
  140. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/risks/test_effect.py +0 -0
  141. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/test_utilities.py +0 -0
  142. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tests/treatment/__init__.py +0 -0
  143. {vivarium_public_health-2.1.1 → vivarium_public_health-2.1.3}/tox.ini +0 -0
@@ -63,7 +63,7 @@ jobs:
63
63
  isort . --check --verbose --only-modified --diff
64
64
  - name: Test
65
65
  run: |
66
- if github.event_name == 'schedule'; then
66
+ if "${{ github.event_name == 'schedule' }}"; then
67
67
  pytest --runslow ./tests
68
68
  else
69
69
  pytest ./tests
@@ -74,3 +74,22 @@ jobs:
74
74
  - name: Doctest
75
75
  run: |
76
76
  make doctest -C docs/
77
+ - name: Send mail
78
+ # Notify when cron job fails
79
+ if: (github.event_name == 'schedule' && failure())
80
+ uses: dawidd6/action-send-mail@v2
81
+ with:
82
+ # mail server settings
83
+ server_address: smtp.gmail.com
84
+ server_port: 465
85
+ # user credentials
86
+ username: ${{ secrets.NOTIFY_EMAIL }}
87
+ password: ${{ secrets.NOTIFY_PASSWORD }}
88
+ # email subject
89
+ subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
90
+ # email body as text
91
+ body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
92
+ # comma-separated string, send email to
93
+ to: uw_ihme_simulationscience@uw.edu
94
+ # from email name
95
+ from: Vivarium Notifications
@@ -0,0 +1,49 @@
1
+ name: deploy
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ deploy:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v4
16
+ with:
17
+ python-version: '3.11'
18
+ - name: Install dependencies
19
+ run: |
20
+ python --version
21
+ python -m pip install --upgrade pip
22
+ pip install setuptools wheel build
23
+ - name: Test
24
+ run: |
25
+ pip install .[test]
26
+ pytest --runslow ./tests
27
+ - name: Build
28
+ run: python -m build
29
+ - name: Publish
30
+ uses: pypa/gh-action-pypi-publish@release/v1
31
+ - name: Send mail
32
+ # Notify when cron job fails
33
+ if: failure()
34
+ uses: dawidd6/action-send-mail@v2
35
+ with:
36
+ # mail server settings
37
+ server_address: smtp.gmail.com
38
+ server_port: 465
39
+ # user credentials
40
+ username: ${{ secrets.NOTIFY_EMAIL }}
41
+ password: ${{ secrets.NOTIFY_PASSWORD }}
42
+ # email subject
43
+ subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
44
+ # email body as text
45
+ body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
46
+ # comma-separated string, send email to
47
+ to: uw_ihme_simulationscience@uw.edu
48
+ # from email name
49
+ from: Vivarium Notifications
@@ -1,3 +1,11 @@
1
+ **2.1.3 - 01/09/24**
2
+
3
+ - Update PyPI to 2FA with trusted publisher
4
+
5
+ **2.1.2 - 12/21/23**
6
+
7
+ - Fix tests failing due to Vivarium 2.3.0 release
8
+
1
9
  **2.1.1 - 10/13/23**
2
10
 
3
11
  - Perform actions in DiseaseState setup using class methods rather than hardcoding to allow for cleaner subclassing
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vivarium_public_health
3
- Version: 2.1.1
3
+ Version: 2.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
@@ -25,10 +25,32 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
25
25
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
26
26
  Classifier: Topic :: Scientific/Engineering :: Physics
27
27
  Classifier: Topic :: Software Development :: Libraries
28
+ License-File: LICENSE.txt
29
+ Requires-Dist: vivarium>=2.0.0
30
+ Requires-Dist: numpy
31
+ Requires-Dist: pandas
32
+ Requires-Dist: scipy
33
+ Requires-Dist: tables
34
+ Requires-Dist: risk_distributions>=2.0.11
28
35
  Provides-Extra: docs
36
+ Requires-Dist: sphinx<7.0; extra == "docs"
37
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
38
+ Requires-Dist: sphinx-click; extra == "docs"
39
+ Requires-Dist: IPython; extra == "docs"
40
+ Requires-Dist: matplotlib; extra == "docs"
29
41
  Provides-Extra: test
42
+ Requires-Dist: pytest; extra == "test"
43
+ Requires-Dist: pytest-mock; extra == "test"
44
+ Requires-Dist: hypothesis; extra == "test"
30
45
  Provides-Extra: dev
31
- License-File: LICENSE.txt
46
+ Requires-Dist: sphinx<7.0; extra == "dev"
47
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
48
+ Requires-Dist: sphinx-click; extra == "dev"
49
+ Requires-Dist: IPython; extra == "dev"
50
+ Requires-Dist: matplotlib; extra == "dev"
51
+ Requires-Dist: pytest; extra == "dev"
52
+ Requires-Dist: pytest-mock; extra == "dev"
53
+ Requires-Dist: hypothesis; extra == "dev"
32
54
 
33
55
  Vivarium Public Health
34
56
  ======================
@@ -16,4 +16,6 @@ py:class Logger
16
16
  # TODO: Need to revisit this. Nitpicking here to avoid failing everywhere
17
17
  py:class Builder
18
18
  py:class SimulantData
19
- py:class Event
19
+ py:class Event
20
+ py:class LookupTable
21
+ py:class Pipeline
@@ -0,0 +1 @@
1
+ __version__ = "2.1.3"
@@ -373,6 +373,20 @@ class DiseaseState(BaseDiseaseState):
373
373
  def get_prevalence(
374
374
  self, builder: Builder, prevalence_data: LookupTableData
375
375
  ) -> LookupTable:
376
+ """Builds a LookupTable for the prevalence of this state.
377
+
378
+ Parameters
379
+ ----------
380
+ builder
381
+ Interface to access simulation managers.
382
+ prevalence_data
383
+ The data to use to build the LookupTable.
384
+
385
+ Returns
386
+ -------
387
+ LookupTable
388
+ The LookupTable for the prevalence of this state.
389
+ """
376
390
  return builder.lookup.build_table(
377
391
  prevalence_data, key_columns=["sex"], parameter_columns=["age", "year"]
378
392
  )
@@ -386,6 +400,21 @@ class DiseaseState(BaseDiseaseState):
386
400
  def get_birth_prevalence(
387
401
  self, builder: Builder, birth_prevalence_data: LookupTableData
388
402
  ) -> LookupTable:
403
+ """
404
+ Builds a LookupTable for the birth prevalence of this state.
405
+
406
+ Parameters
407
+ ----------
408
+ builder
409
+ Interface to access simulation managers.
410
+ birth_prevalence_data
411
+ The data to use to build the LookupTable.
412
+
413
+ Returns
414
+ -------
415
+ LookupTable
416
+ The LookupTable for the birth prevalence of this state.
417
+ """
389
418
  return builder.lookup.build_table(
390
419
  birth_prevalence_data, key_columns=["sex"], parameter_columns=["year"]
391
420
  )
@@ -434,6 +463,21 @@ class DiseaseState(BaseDiseaseState):
434
463
  def get_base_disability_weight(
435
464
  self, builder: Builder, disability_weight_data: LookupTableData
436
465
  ) -> LookupTable:
466
+ """
467
+ Builds a LookupTable for the base disability weight of this state.
468
+
469
+ Parameters
470
+ ----------
471
+ builder
472
+ Interface to access simulation managers.
473
+ disability_weight_data
474
+ The data to use to build the LookupTable.
475
+
476
+ Returns
477
+ -------
478
+ LookupTable
479
+ The LookupTable for the disability weight of this state.
480
+ """
437
481
  return builder.lookup.build_table(
438
482
  disability_weight_data, key_columns=["sex"], parameter_columns=["age", "year"]
439
483
  )
@@ -458,6 +502,21 @@ class DiseaseState(BaseDiseaseState):
458
502
  def get_base_excess_mortality_rate(
459
503
  self, builder: Builder, excess_mortality_data: LookupTableData
460
504
  ) -> LookupTable:
505
+ """
506
+ Builds a LookupTable for the base excess mortality rate of this state.
507
+
508
+ Parameters
509
+ ----------
510
+ builder
511
+ Interface to access simulation managers.
512
+ excess_mortality_data
513
+ The data to use to build the LookupTable.
514
+
515
+ Returns
516
+ -------
517
+ LookupTable
518
+ The LookupTable for the base excess mortality rate of this state.
519
+ """
461
520
  return builder.lookup.build_table(
462
521
  excess_mortality_data, key_columns=["sex"], parameter_columns=["age", "year"]
463
522
  )
@@ -128,6 +128,19 @@ class Mortality(Component):
128
128
 
129
129
  # noinspection PyMethodMayBeStatic
130
130
  def get_all_cause_mortality_rate(self, builder: Builder) -> Union[LookupTable, Pipeline]:
131
+ """
132
+ Load all cause mortality rate data and build a lookup table or pipeline.
133
+
134
+ Parameters
135
+ ----------
136
+ builder
137
+ Interface to access simulation managers.
138
+
139
+ Returns
140
+ -------
141
+ Union[LookupTable, Pipeline]
142
+ A lookup table or pipeline returning the all cause mortality rate.
143
+ """
131
144
  acmr_data = builder.data.load("cause.all_causes.cause_specific_mortality_rate")
132
145
  return builder.lookup.build_table(
133
146
  acmr_data, key_columns=["sex"], parameter_columns=["age", "year"]
@@ -135,6 +148,19 @@ class Mortality(Component):
135
148
 
136
149
  # noinspection PyMethodMayBeStatic
137
150
  def get_life_expectancy(self, builder: Builder) -> Union[LookupTable, Pipeline]:
151
+ """
152
+ Load life expectancy data and build a lookup table or pipeline.
153
+
154
+ Parameters
155
+ ----------
156
+ builder
157
+ Interface to access simulation managers.
158
+
159
+ Returns
160
+ -------
161
+ Union[LookupTable, Pipeline]
162
+ A lookup table or pipeline returning the life expectancy.
163
+ """
138
164
  life_expectancy_data = builder.data.load(
139
165
  "population.theoretical_minimum_risk_life_expectancy"
140
166
  )
@@ -142,6 +168,20 @@ class Mortality(Component):
142
168
 
143
169
  # noinspection PyMethodMayBeStatic
144
170
  def get_raw_unmodeled_csmr(self, builder: Builder) -> Union[LookupTable, Pipeline]:
171
+ """
172
+ Load unmodeled cause specific mortality rate data and build a lookup
173
+ table or pipeline.
174
+
175
+ Parameters
176
+ ----------
177
+ builder
178
+ Interface to access simulation managers.
179
+
180
+ Returns
181
+ -------
182
+ Union[LookupTable, Pipeline]
183
+ A lookup table or pipeline returning the unmodeled csmr.
184
+ """
145
185
  unmodeled_causes = builder.configuration.unmodeled_causes
146
186
  raw_csmr = 0.0
147
187
  for idx, cause in enumerate(unmodeled_causes):
@@ -121,12 +121,40 @@ class RiskEffect(Component):
121
121
  return builder.value.get_value(self.exposure_pipeline_name)
122
122
 
123
123
  def get_relative_risk_source(self, builder: Builder) -> LookupTable:
124
+ """
125
+ Get the relative risk source for this risk effect model.
126
+
127
+ Parameters
128
+ ----------
129
+ builder
130
+ Interface to access simulation managers.
131
+
132
+ Returns
133
+ -------
134
+ LookupTable
135
+ A lookup table containing the relative risk data for this risk
136
+ effect model.
137
+ """
124
138
  relative_risk_data = get_relative_risk_data(builder, self.risk, self.target)
125
139
  return builder.lookup.build_table(
126
140
  relative_risk_data, key_columns=["sex"], parameter_columns=["age", "year"]
127
141
  )
128
142
 
129
143
  def get_population_attributable_fraction_source(self, builder: Builder) -> LookupTable:
144
+ """
145
+ Get the population attributable fraction source for this risk effect model.
146
+
147
+ Parameters
148
+ ----------
149
+ builder
150
+ Interface to access simulation managers.
151
+
152
+ Returns
153
+ -------
154
+ LookupTable
155
+ A lookup table containing the population attributable fraction data
156
+ for this risk effect model.
157
+ """
130
158
  paf_data = get_population_attributable_fraction_data(builder, self.risk, self.target)
131
159
  return builder.lookup.build_table(
132
160
  paf_data, key_columns=["sex"], parameter_columns=["age", "year"]
@@ -127,6 +127,20 @@ class LinearScaleUp(Component):
127
127
  return get_endpoint("start"), get_endpoint("end")
128
128
 
129
129
  def get_scale_up_values(self, builder: Builder) -> Tuple[LookupTable, LookupTable]:
130
+ """
131
+ Get the values at the start and end of the scale-up period.
132
+
133
+ Parameters
134
+ ----------
135
+ builder
136
+ Interface to access simulation managers.
137
+
138
+ Returns
139
+ -------
140
+ LookupTable
141
+ A tuple of lookup tables returning the values at the start and end
142
+ of the scale-up period.
143
+ """
130
144
  scale_up_config = builder.configuration[self.configuration_key]["value"]
131
145
 
132
146
  def get_endpoint_value(endpoint_type: str) -> LookupTable:
@@ -172,6 +186,23 @@ class LinearScaleUp(Component):
172
186
  def get_endpoint_value_from_data(
173
187
  self, builder: Builder, endpoint_type: str
174
188
  ) -> LookupTable:
189
+ """
190
+ Get the value at the start or end of the scale-up period from data.
191
+
192
+ Parameters
193
+ ----------
194
+ builder
195
+ Interface to access simulation managers.
196
+ endpoint_type
197
+ The type of endpoint to get the value for. Allowed values are
198
+ "start" and "end".
199
+
200
+ Returns
201
+ -------
202
+ LookupTable
203
+ A lookup table returning the value at the start or end of the
204
+ scale-up period.
205
+ """
175
206
  if endpoint_type == "start":
176
207
  endpoint_data = builder.data.load(f"{self.treatment}.exposure")
177
208
  elif endpoint_type == "end":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: vivarium-public-health
3
- Version: 2.1.1
2
+ Name: vivarium_public_health
3
+ Version: 2.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
@@ -25,10 +25,32 @@ Classifier: Topic :: Scientific/Engineering :: Mathematics
25
25
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
26
26
  Classifier: Topic :: Scientific/Engineering :: Physics
27
27
  Classifier: Topic :: Software Development :: Libraries
28
+ License-File: LICENSE.txt
29
+ Requires-Dist: vivarium>=2.0.0
30
+ Requires-Dist: numpy
31
+ Requires-Dist: pandas
32
+ Requires-Dist: scipy
33
+ Requires-Dist: tables
34
+ Requires-Dist: risk_distributions>=2.0.11
28
35
  Provides-Extra: docs
36
+ Requires-Dist: sphinx<7.0; extra == "docs"
37
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
38
+ Requires-Dist: sphinx-click; extra == "docs"
39
+ Requires-Dist: IPython; extra == "docs"
40
+ Requires-Dist: matplotlib; extra == "docs"
29
41
  Provides-Extra: test
42
+ Requires-Dist: pytest; extra == "test"
43
+ Requires-Dist: pytest-mock; extra == "test"
44
+ Requires-Dist: hypothesis; extra == "test"
30
45
  Provides-Extra: dev
31
- License-File: LICENSE.txt
46
+ Requires-Dist: sphinx<7.0; extra == "dev"
47
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
48
+ Requires-Dist: sphinx-click; extra == "dev"
49
+ Requires-Dist: IPython; extra == "dev"
50
+ Requires-Dist: matplotlib; extra == "dev"
51
+ Requires-Dist: pytest; extra == "dev"
52
+ Requires-Dist: pytest-mock; extra == "dev"
53
+ Requires-Dist: hypothesis; extra == "dev"
32
54
 
33
55
  Vivarium Public Health
34
56
  ======================
@@ -1,7 +1,7 @@
1
1
  import numpy as np
2
2
  import pandas as pd
3
3
  import pytest
4
- from vivarium import InteractiveContext
4
+ from vivarium import Component, InteractiveContext
5
5
  from vivarium.framework.state_machine import Transition
6
6
  from vivarium.framework.utilities import from_yearly
7
7
  from vivarium.testing_utilities import TestPopulation, build_table, metadata
@@ -188,7 +188,7 @@ def test_prevalence_single_state_with_migration(
188
188
  assert np.isclose(
189
189
  get_test_prevalence(simulation, "sick"), test_prevalence_level, 0.01
190
190
  ), error_message
191
- simulation._clock.step_forward()
191
+ simulation.step()
192
192
  assert np.isclose(
193
193
  get_test_prevalence(simulation, "sick"), test_prevalence_level, 0.01
194
194
  ), error_message
@@ -199,7 +199,7 @@ def test_prevalence_single_state_with_migration(
199
199
  assert np.isclose(
200
200
  get_test_prevalence(simulation, "sick"), test_prevalence_level, 0.01
201
201
  ), error_message
202
- simulation._clock.step_forward()
202
+ simulation.step()
203
203
  simulation.simulant_creator(
204
204
  50000,
205
205
  population_configuration={"age_start": 0, "age_end": 5, "sim_state": "time_step"},
@@ -358,11 +358,7 @@ def test_risk_deletion(base_config, base_plugins, disease):
358
358
 
359
359
  model = DiseaseModel(disease, initial_state=healthy, states=[healthy, sick])
360
360
 
361
- class PafModifier:
362
- @property
363
- def name(self):
364
- return "paf_modifier"
365
-
361
+ class PafModifier(Component):
366
362
  def setup(self, builder):
367
363
  builder.value.register_value_modifier(
368
364
  "sick.incidence_rate.paf",
@@ -370,7 +366,7 @@ def test_risk_deletion(base_config, base_plugins, disease):
370
366
  build_table(paf, year_start, year_end),
371
367
  key_columns=("sex",),
372
368
  parameter_columns=["age", "year"],
373
- value_columns=None,
369
+ value_columns=(),
374
370
  ),
375
371
  )
376
372
 
@@ -436,7 +432,7 @@ def test_prevalence_birth_prevalence_initial_assignment(base_config, base_plugin
436
432
  assert np.isclose(get_test_prevalence(simulation, "with_condition"), 1)
437
433
 
438
434
  # birth prevalence should be used for assigning initial status to newly-borns on time steps
439
- simulation._clock.step_forward()
435
+ simulation.step()
440
436
  simulation.simulant_creator(
441
437
  pop_size,
442
438
  population_configuration={"age_start": 0, "age_end": 0, "sim_state": "time_step"},
@@ -444,7 +440,7 @@ def test_prevalence_birth_prevalence_initial_assignment(base_config, base_plugin
444
440
  assert np.isclose(get_test_prevalence(simulation, "with_condition"), 0.75, 0.01)
445
441
 
446
442
  # and prevalence should be used for ages not start = end = 0
447
- simulation._clock.step_forward()
443
+ simulation.step()
448
444
  simulation.simulant_creator(
449
445
  pop_size,
450
446
  population_configuration={"age_start": 0, "age_end": 5, "sim_state": "time_step"},
@@ -473,7 +469,7 @@ def test_no_birth_prevalence_initial_assignment(base_config, base_plugins, disea
473
469
  assert np.isclose(get_test_prevalence(simulation, "with_condition"), 1)
474
470
 
475
471
  # with no birth prevalence provided, it should default to 0 for ages start = end = 0
476
- simulation._clock.step_forward()
472
+ simulation.step()
477
473
  simulation.simulant_creator(
478
474
  1000,
479
475
  population_configuration={"age_start": 0, "age_end": 0, "sim_state": "time_step"},
@@ -481,7 +477,7 @@ def test_no_birth_prevalence_initial_assignment(base_config, base_plugins, disea
481
477
  assert np.isclose(get_test_prevalence(simulation, "with_condition"), 0.5, 0.01)
482
478
 
483
479
  # and default to prevalence for ages not start = end = 0
484
- simulation._clock.step_forward()
480
+ simulation.step()
485
481
  simulation.simulant_creator(
486
482
  1000,
487
483
  population_configuration={"age_start": 0, "age_end": 5, "sim_state": "time_step"},
@@ -1,31 +0,0 @@
1
- name: deploy
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- jobs:
8
- deploy:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v3
12
- - name: Set up Python
13
- uses: actions/setup-python@v4
14
- with:
15
- python-version: '3.11'
16
- - name: Install dependencies
17
- run: |
18
- python --version
19
- python -m pip install --upgrade pip
20
- pip install setuptools wheel twine
21
- - name: Test
22
- run: |
23
- pip install .[test]
24
- pytest --runslow ./tests
25
- - name: Build and publish
26
- env:
27
- TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28
- TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29
- run: |
30
- python setup.py sdist bdist_wheel
31
- twine upload dist/*
@@ -1 +0,0 @@
1
- __version__ = "2.1.1"