epymorph 1.0.0b0__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 (227) hide show
  1. epymorph-1.0.0b0/.git-blame-ignore-revs +1 -0
  2. epymorph-1.0.0b0/.github/workflows/code-quality.yml +57 -0
  3. epymorph-1.0.0b0/.github/workflows/matrix-test.yml +51 -0
  4. epymorph-1.0.0b0/.github/workflows/release.yml +105 -0
  5. epymorph-1.0.0b0/.gitignore +27 -0
  6. epymorph-1.0.0b0/.python-version +1 -0
  7. epymorph-1.0.0b0/.vscode/extensions.json +8 -0
  8. epymorph-1.0.0b0/.vscode/settings.json +42 -0
  9. epymorph-1.0.0b0/CONTRIBUTING.md +51 -0
  10. epymorph-1.0.0b0/LICENSE +674 -0
  11. epymorph-1.0.0b0/PKG-INFO +57 -0
  12. epymorph-1.0.0b0/README.md +18 -0
  13. epymorph-1.0.0b0/USAGE.ipynb +340 -0
  14. epymorph-1.0.0b0/doc/demo/01-SIRH-IPM.ipynb +166 -0
  15. epymorph-1.0.0b0/doc/demo/02-states-GEO.ipynb +295 -0
  16. epymorph-1.0.0b0/doc/demo/03-counties-GEO.ipynb +286 -0
  17. epymorph-1.0.0b0/doc/demo/04-time-varying-beta.ipynb +169 -0
  18. epymorph-1.0.0b0/doc/demo/05-visualizing-mm.ipynb +228 -0
  19. epymorph-1.0.0b0/doc/demo/img/SIRH-diagram.png +0 -0
  20. epymorph-1.0.0b0/doc/devlog/2023-05-03.ipynb +202 -0
  21. epymorph-1.0.0b0/doc/devlog/2023-05-04.ipynb +210 -0
  22. epymorph-1.0.0b0/doc/devlog/2023-05-16.ipynb +329 -0
  23. epymorph-1.0.0b0/doc/devlog/2023-05-17.ipynb +252 -0
  24. epymorph-1.0.0b0/doc/devlog/2023-05-31-mm.ipynb +138 -0
  25. epymorph-1.0.0b0/doc/devlog/2023-05-31-sirh.ipynb +568 -0
  26. epymorph-1.0.0b0/doc/devlog/2023-06-01-pei-example.ipynb +171 -0
  27. epymorph-1.0.0b0/doc/devlog/2023-06-01-sparsemod-example.ipynb +170 -0
  28. epymorph-1.0.0b0/doc/devlog/2023-06-28.ipynb +146 -0
  29. epymorph-1.0.0b0/doc/devlog/2023-06-30.ipynb +528 -0
  30. epymorph-1.0.0b0/doc/devlog/2023-07-06.ipynb +552 -0
  31. epymorph-1.0.0b0/doc/devlog/2023-07-07.ipynb +365 -0
  32. epymorph-1.0.0b0/doc/devlog/2023-07-12.ipynb +754 -0
  33. epymorph-1.0.0b0/doc/devlog/2023-07-13.ipynb +569 -0
  34. epymorph-1.0.0b0/doc/devlog/2023-07-14.ipynb +177 -0
  35. epymorph-1.0.0b0/doc/devlog/2023-07-20-movement-probs.ipynb +446 -0
  36. epymorph-1.0.0b0/doc/devlog/2023-07-24.ipynb +216 -0
  37. epymorph-1.0.0b0/doc/devlog/2023-08-11.ipynb +294 -0
  38. epymorph-1.0.0b0/doc/devlog/2023-08-17.ipynb +326 -0
  39. epymorph-1.0.0b0/doc/devlog/2023-08-23.ipynb +139 -0
  40. epymorph-1.0.0b0/doc/devlog/2023-09-22-adrio-demo.ipynb +735 -0
  41. epymorph-1.0.0b0/doc/devlog/2023-09-29.ipynb +408 -0
  42. epymorph-1.0.0b0/doc/devlog/2023-10-05.ipynb +267 -0
  43. epymorph-1.0.0b0/doc/devlog/2023-10-10.ipynb +400 -0
  44. epymorph-1.0.0b0/doc/devlog/2023-10-25.ipynb +803 -0
  45. epymorph-1.0.0b0/doc/devlog/2023-10-26.ipynb +230 -0
  46. epymorph-1.0.0b0/doc/devlog/2023-11-03-seirs-example.ipynb +563 -0
  47. epymorph-1.0.0b0/doc/devlog/2023-11-08-age-ipm.ipynb +327 -0
  48. epymorph-1.0.0b0/doc/devlog/2023-11-08.ipynb +436 -0
  49. epymorph-1.0.0b0/doc/devlog/2023-11-15.ipynb +1279 -0
  50. epymorph-1.0.0b0/doc/devlog/2023-11-20-adrio-phase-2-demo.ipynb +745 -0
  51. epymorph-1.0.0b0/doc/devlog/2023-11-22-ipm-probs.ipynb +518 -0
  52. epymorph-1.0.0b0/doc/devlog/2023-12-05.ipynb +103 -0
  53. epymorph-1.0.0b0/doc/devlog/2024-01-08.ipynb +197 -0
  54. epymorph-1.0.0b0/doc/devlog/2024-02-06-adrio-demo.ipynb +221 -0
  55. epymorph-1.0.0b0/doc/devlog/2024-02-06.ipynb +486 -0
  56. epymorph-1.0.0b0/doc/devlog/2024-02-12.ipynb +491 -0
  57. epymorph-1.0.0b0/doc/devlog/2024-02-14.ipynb +806 -0
  58. epymorph-1.0.0b0/doc/devlog/2024-03-01.ipynb +260 -0
  59. epymorph-1.0.0b0/doc/devlog/2024-03-13.ipynb +430 -0
  60. epymorph-1.0.0b0/doc/devlog/2024-03-19.ipynb +101 -0
  61. epymorph-1.0.0b0/doc/devlog/2024-04-04-draw-demo.ipynb +384 -0
  62. epymorph-1.0.0b0/doc/devlog/2024-04-16.ipynb +803 -0
  63. epymorph-1.0.0b0/doc/devlog/2024-04-25.ipynb +112 -0
  64. epymorph-1.0.0b0/doc/devlog/2024-05-03.ipynb +134 -0
  65. epymorph-1.0.0b0/doc/devlog/2024-05-09-lodes-adrio-demo.ipynb +147 -0
  66. epymorph-1.0.0b0/doc/devlog/2024-06-03.ipynb +290 -0
  67. epymorph-1.0.0b0/doc/devlog/2024-06-05.ipynb +352 -0
  68. epymorph-1.0.0b0/doc/devlog/2024-06-12.ipynb +441 -0
  69. epymorph-1.0.0b0/doc/devlog/2024-07-03-cdc-adrio-demo.ipynb +521 -0
  70. epymorph-1.0.0b0/doc/devlog/2024-07-08.ipynb +506 -0
  71. epymorph-1.0.0b0/doc/devlog/2024-07-10.ipynb +241 -0
  72. epymorph-1.0.0b0/doc/devlog/2024-07-12-v0.4.ipynb +266 -0
  73. epymorph-1.0.0b0/doc/devlog/2024-07-12-v0.5.ipynb +793 -0
  74. epymorph-1.0.0b0/doc/devlog/2024-07-12-v0.6.ipynb +684 -0
  75. epymorph-1.0.0b0/doc/devlog/2024-07-16.ipynb +747 -0
  76. epymorph-1.0.0b0/doc/devlog/2024-07-18.ipynb +192 -0
  77. epymorph-1.0.0b0/doc/devlog/2024-08-13.ipynb +298 -0
  78. epymorph-1.0.0b0/doc/devlog/2024-08-26-prism-adrio-demo.ipynb +349 -0
  79. epymorph-1.0.0b0/doc/devlog/2024-08-28.ipynb +269 -0
  80. epymorph-1.0.0b0/doc/devlog/2024-08-30.ipynb +255 -0
  81. epymorph-1.0.0b0/doc/devlog/2024-09-24.ipynb +112 -0
  82. epymorph-1.0.0b0/doc/devlog/2024-09-25.ipynb +213 -0
  83. epymorph-1.0.0b0/doc/devlog/2024-10-09.ipynb +642 -0
  84. epymorph-1.0.0b0/doc/devlog/2024-10-11.ipynb +404 -0
  85. epymorph-1.0.0b0/doc/devlog/2024-12-03-v0.7.ipynb +738 -0
  86. epymorph-1.0.0b0/doc/devlog/2024-12-06.ipynb +407 -0
  87. epymorph-1.0.0b0/doc/devlog/2024-12-16.ipynb +507 -0
  88. epymorph-1.0.0b0/doc/devlog/2024-12-19-v0.9.ipynb +746 -0
  89. epymorph-1.0.0b0/doc/devlog/2024-5-22-pf+epymorph.ipynb +656 -0
  90. epymorph-1.0.0b0/doc/devlog/2025-01-23-param-estimation-demo.ipynb +744 -0
  91. epymorph-1.0.0b0/doc/devlog/2025-01-23-param-estimation-multinode.ipynb +466 -0
  92. epymorph-1.0.0b0/doc/devlog/2025-02-05-v0.10.ipynb +746 -0
  93. epymorph-1.0.0b0/doc/devlog/README.md +95 -0
  94. epymorph-1.0.0b0/doc/devlog/data/influenza.csv +54 -0
  95. epymorph-1.0.0b0/doc/devlog/img/pei-model.png +0 -0
  96. epymorph-1.0.0b0/doc/scripts/setup-epymorph-monsoon.sh +222 -0
  97. epymorph-1.0.0b0/epymorph/__init__.py +7 -0
  98. epymorph-1.0.0b0/epymorph/__main__.py +16 -0
  99. epymorph-1.0.0b0/epymorph/adrio/__init__.py +0 -0
  100. epymorph-1.0.0b0/epymorph/adrio/acs5.py +602 -0
  101. epymorph-1.0.0b0/epymorph/adrio/adrio.py +215 -0
  102. epymorph-1.0.0b0/epymorph/adrio/cdc.py +781 -0
  103. epymorph-1.0.0b0/epymorph/adrio/commuting_flows.py +237 -0
  104. epymorph-1.0.0b0/epymorph/adrio/csv.py +387 -0
  105. epymorph-1.0.0b0/epymorph/adrio/humidity.py +84 -0
  106. epymorph-1.0.0b0/epymorph/adrio/lodes.py +624 -0
  107. epymorph-1.0.0b0/epymorph/adrio/numpy.py +119 -0
  108. epymorph-1.0.0b0/epymorph/adrio/prism.py +543 -0
  109. epymorph-1.0.0b0/epymorph/adrio/respiratory_cdc.py +489 -0
  110. epymorph-1.0.0b0/epymorph/adrio/us_tiger.py +217 -0
  111. epymorph-1.0.0b0/epymorph/attribute.py +301 -0
  112. epymorph-1.0.0b0/epymorph/cache.py +494 -0
  113. epymorph-1.0.0b0/epymorph/cli/__init__.py +0 -0
  114. epymorph-1.0.0b0/epymorph/cli/cache.py +77 -0
  115. epymorph-1.0.0b0/epymorph/cli/main.py +29 -0
  116. epymorph-1.0.0b0/epymorph/compartment_model.py +1335 -0
  117. epymorph-1.0.0b0/epymorph/data/__init__.py +1 -0
  118. epymorph-1.0.0b0/epymorph/data/ipm/__init__.py +22 -0
  119. epymorph-1.0.0b0/epymorph/data/ipm/no.py +14 -0
  120. epymorph-1.0.0b0/epymorph/data/ipm/pei.py +40 -0
  121. epymorph-1.0.0b0/epymorph/data/ipm/seirs.py +50 -0
  122. epymorph-1.0.0b0/epymorph/data/ipm/sirh.py +55 -0
  123. epymorph-1.0.0b0/epymorph/data/ipm/sirs.py +48 -0
  124. epymorph-1.0.0b0/epymorph/data/ipm/sparsemod.py +96 -0
  125. epymorph-1.0.0b0/epymorph/data/mm/__init__.py +22 -0
  126. epymorph-1.0.0b0/epymorph/data/mm/centroids.py +76 -0
  127. epymorph-1.0.0b0/epymorph/data/mm/flat.py +61 -0
  128. epymorph-1.0.0b0/epymorph/data/mm/icecube.py +50 -0
  129. epymorph-1.0.0b0/epymorph/data/mm/no.py +29 -0
  130. epymorph-1.0.0b0/epymorph/data/mm/pei.py +105 -0
  131. epymorph-1.0.0b0/epymorph/data/mm/sparsemod.py +73 -0
  132. epymorph-1.0.0b0/epymorph/data/pei.py +424 -0
  133. epymorph-1.0.0b0/epymorph/data_shape.py +475 -0
  134. epymorph-1.0.0b0/epymorph/data_type.py +129 -0
  135. epymorph-1.0.0b0/epymorph/data_usage.py +171 -0
  136. epymorph-1.0.0b0/epymorph/database.py +1010 -0
  137. epymorph-1.0.0b0/epymorph/error.py +183 -0
  138. epymorph-1.0.0b0/epymorph/event.py +188 -0
  139. epymorph-1.0.0b0/epymorph/geography/__init__.py +0 -0
  140. epymorph-1.0.0b0/epymorph/geography/custom.py +61 -0
  141. epymorph-1.0.0b0/epymorph/geography/scope.py +214 -0
  142. epymorph-1.0.0b0/epymorph/geography/us_census.py +622 -0
  143. epymorph-1.0.0b0/epymorph/geography/us_geography.py +278 -0
  144. epymorph-1.0.0b0/epymorph/geography/us_tiger.py +755 -0
  145. epymorph-1.0.0b0/epymorph/initializer.py +596 -0
  146. epymorph-1.0.0b0/epymorph/kit.py +90 -0
  147. epymorph-1.0.0b0/epymorph/log/__init__.py +0 -0
  148. epymorph-1.0.0b0/epymorph/log/file.py +108 -0
  149. epymorph-1.0.0b0/epymorph/log/messaging.py +129 -0
  150. epymorph-1.0.0b0/epymorph/log/movement.py +151 -0
  151. epymorph-1.0.0b0/epymorph/movement_model.py +274 -0
  152. epymorph-1.0.0b0/epymorph/parameter_fitting/__init__.py +0 -0
  153. epymorph-1.0.0b0/epymorph/parameter_fitting/distribution.py +68 -0
  154. epymorph-1.0.0b0/epymorph/parameter_fitting/dynamics.py +19 -0
  155. epymorph-1.0.0b0/epymorph/parameter_fitting/filter/__init__.py +0 -0
  156. epymorph-1.0.0b0/epymorph/parameter_fitting/filter/base_filter.py +50 -0
  157. epymorph-1.0.0b0/epymorph/parameter_fitting/filter/particle.py +32 -0
  158. epymorph-1.0.0b0/epymorph/parameter_fitting/filter/particle_filter.py +296 -0
  159. epymorph-1.0.0b0/epymorph/parameter_fitting/likelihood.py +54 -0
  160. epymorph-1.0.0b0/epymorph/parameter_fitting/output.py +73 -0
  161. epymorph-1.0.0b0/epymorph/parameter_fitting/particlefilter_simulation.py +175 -0
  162. epymorph-1.0.0b0/epymorph/parameter_fitting/perturbation.py +19 -0
  163. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/__init__.py +0 -0
  164. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/data_loader.py +111 -0
  165. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/epymorph_simulation.py +119 -0
  166. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/observations.py +63 -0
  167. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/parameter_estimation.py +49 -0
  168. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/params_perturb.py +43 -0
  169. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/particle_initializer.py +95 -0
  170. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/resampler.py +249 -0
  171. epymorph-1.0.0b0/epymorph/parameter_fitting/utils/utils.py +101 -0
  172. epymorph-1.0.0b0/epymorph/params.py +248 -0
  173. epymorph-1.0.0b0/epymorph/py.typed +0 -0
  174. epymorph-1.0.0b0/epymorph/rume.py +700 -0
  175. epymorph-1.0.0b0/epymorph/simulation.py +706 -0
  176. epymorph-1.0.0b0/epymorph/simulator/__init__.py +0 -0
  177. epymorph-1.0.0b0/epymorph/simulator/basic/__init__.py +0 -0
  178. epymorph-1.0.0b0/epymorph/simulator/basic/basic_simulator.py +145 -0
  179. epymorph-1.0.0b0/epymorph/simulator/basic/ipm_exec.py +406 -0
  180. epymorph-1.0.0b0/epymorph/simulator/basic/mm_exec.py +197 -0
  181. epymorph-1.0.0b0/epymorph/simulator/basic/output.py +181 -0
  182. epymorph-1.0.0b0/epymorph/simulator/world.py +83 -0
  183. epymorph-1.0.0b0/epymorph/simulator/world_list.py +196 -0
  184. epymorph-1.0.0b0/epymorph/strata.py +12 -0
  185. epymorph-1.0.0b0/epymorph/sympy_shim.py +55 -0
  186. epymorph-1.0.0b0/epymorph/time.py +649 -0
  187. epymorph-1.0.0b0/epymorph/tools/__init__.py +0 -0
  188. epymorph-1.0.0b0/epymorph/tools/data.py +218 -0
  189. epymorph-1.0.0b0/epymorph/tools/ipm_diagram.py +165 -0
  190. epymorph-1.0.0b0/epymorph/tools/out_map.py +426 -0
  191. epymorph-1.0.0b0/epymorph/tools/out_plot.py +412 -0
  192. epymorph-1.0.0b0/epymorph/tools/out_table.py +575 -0
  193. epymorph-1.0.0b0/epymorph/util.py +825 -0
  194. epymorph-1.0.0b0/epymorph.egg-info/PKG-INFO +57 -0
  195. epymorph-1.0.0b0/epymorph.egg-info/SOURCES.txt +225 -0
  196. epymorph-1.0.0b0/epymorph.egg-info/dependency_links.txt +1 -0
  197. epymorph-1.0.0b0/epymorph.egg-info/entry_points.txt +2 -0
  198. epymorph-1.0.0b0/epymorph.egg-info/requires.txt +16 -0
  199. epymorph-1.0.0b0/epymorph.egg-info/top_level.txt +1 -0
  200. epymorph-1.0.0b0/pyproject.toml +169 -0
  201. epymorph-1.0.0b0/scripts/README.md +1 -0
  202. epymorph-1.0.0b0/scripts/data_exports.py +145 -0
  203. epymorph-1.0.0b0/setup.cfg +4 -0
  204. epymorph-1.0.0b0/tests/fast/compartment_model_test.py +651 -0
  205. epymorph-1.0.0b0/tests/fast/data_shape_test.py +312 -0
  206. epymorph-1.0.0b0/tests/fast/data_test.py +351 -0
  207. epymorph-1.0.0b0/tests/fast/data_type_test.py +79 -0
  208. epymorph-1.0.0b0/tests/fast/data_usage_test.py +75 -0
  209. epymorph-1.0.0b0/tests/fast/database_test.py +974 -0
  210. epymorph-1.0.0b0/tests/fast/geography/us_census_test.py +18 -0
  211. epymorph-1.0.0b0/tests/fast/geography/us_geography_test.py +135 -0
  212. epymorph-1.0.0b0/tests/fast/initializer_test.py +581 -0
  213. epymorph-1.0.0b0/tests/fast/movement_model_test.py +198 -0
  214. epymorph-1.0.0b0/tests/fast/params_test.py +184 -0
  215. epymorph-1.0.0b0/tests/fast/rume_test.py +422 -0
  216. epymorph-1.0.0b0/tests/fast/simulation_test.py +161 -0
  217. epymorph-1.0.0b0/tests/fast/simulator/basic_simulator_test.py +322 -0
  218. epymorph-1.0.0b0/tests/fast/simulator/ipm_exec_test.py +202 -0
  219. epymorph-1.0.0b0/tests/fast/simulator/world_list_test.py +362 -0
  220. epymorph-1.0.0b0/tests/fast/time_test.py +178 -0
  221. epymorph-1.0.0b0/tests/fast/util_test.py +435 -0
  222. epymorph-1.0.0b0/tests/slow/adrio/acs5_test.py +152 -0
  223. epymorph-1.0.0b0/tests/slow/adrio/commuting_flows_test.py +32 -0
  224. epymorph-1.0.0b0/tests/slow/adrio/csv_test.py +236 -0
  225. epymorph-1.0.0b0/tests/slow/adrio/us_tiger_test.py +91 -0
  226. epymorph-1.0.0b0/tests/slow/geography/us_tiger_test.py +52 -0
  227. epymorph-1.0.0b0/uv.lock +1536 -0
@@ -0,0 +1 @@
1
+ a556620f6a85f7eb8613233b64cb19b3b1f721ae
@@ -0,0 +1,57 @@
1
+ # Runs formatting, linting, and unit tests on any push to main or a pull request.
2
+
3
+ # Useful docs:
4
+ # https://docs.astral.sh/uv/guides/integration/github/
5
+ # https://docs.astral.sh/ruff/integrations/#github-actions
6
+
7
+ name: Code quality checks
8
+ on:
9
+ pull_request:
10
+ push:
11
+ branches: ['main']
12
+
13
+ jobs:
14
+ code-quality:
15
+ name: Code quality checks
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Check out code
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ enable-cache: true
25
+ version: "0.5.x"
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version-file: ".python-version"
31
+
32
+ - name: Configure AWS Credentials
33
+ if: env.SIDELOAD_CACHE == 'true'
34
+ uses: aws-actions/configure-aws-credentials@v4
35
+ with:
36
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
37
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38
+ aws-region: us-west-2
39
+
40
+ - name: Download cache files from S3
41
+ if: env.SIDELOAD_CACHE == 'true'
42
+ run: |
43
+ mkdir -p .cache
44
+ echo "EPYMORPH_CACHE_PATH=$(realpath .cache)" >> $GITHUB_ENV
45
+ aws s3 sync s3://epymorph-gha-cache .cache
46
+
47
+ - name: Install dependencies
48
+ run: uv sync --frozen --all-extras --dev
49
+
50
+ - name: Check imports and formatting
51
+ run: uv run ruff check --no-fix --exclude doc/devlog --output-format=github .
52
+
53
+ - name: Check data package exports
54
+ run: uv run scripts/data_exports.py --check
55
+
56
+ - name: Run unit tests
57
+ run: uv run pytest tests/fast
@@ -0,0 +1,51 @@
1
+ # Runs unit tests with a matrix of Python versions and operating systems
2
+
3
+ name: Test matrix
4
+ on: workflow_dispatch
5
+
6
+ jobs:
7
+ test-matrix:
8
+ name: Test matrix
9
+
10
+ strategy:
11
+ matrix:
12
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
13
+ python-version: ["3.11", "3.12", "3.13"]
14
+
15
+ runs-on: ${{ matrix.os }}
16
+
17
+ steps:
18
+ - name: Check out code
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+ with:
24
+ enable-cache: true
25
+ version: "0.5.x"
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Configure AWS Credentials
33
+ if: env.SIDELOAD_CACHE == 'true'
34
+ uses: aws-actions/configure-aws-credentials@v4
35
+ with:
36
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
37
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38
+ aws-region: us-west-2
39
+
40
+ - name: Download cache files from S3
41
+ if: env.SIDELOAD_CACHE == 'true'
42
+ run: |
43
+ mkdir -p .cache
44
+ echo "EPYMORPH_CACHE_PATH=$(realpath .cache)" >> $GITHUB_ENV
45
+ aws s3 sync s3://epymorph-gha-cache .cache
46
+
47
+ - name: Install dependencies
48
+ run: uv sync --frozen --all-extras --dev
49
+
50
+ - name: Run unit tests
51
+ run: uv run pytest tests/fast
@@ -0,0 +1,105 @@
1
+ # Builds and releases to GitHub and PyPI whenever a "v" tag is added.
2
+
3
+ # Useful docs:
4
+ # https://docs.astral.sh/uv/concepts/projects/build/
5
+ # https://docs.astral.sh/uv/guides/integration/github/
6
+ # https://docs.astral.sh/ruff/integrations/#github-actions
7
+ # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
8
+ # https://cli.github.com/manual/gh_release_create
9
+
10
+ name: Build and release
11
+
12
+ on:
13
+ push:
14
+ tags:
15
+ - 'v*'
16
+
17
+ jobs:
18
+ # First job: run unit tests on OS/Python matrix.
19
+ test-matrix:
20
+ name: Test matrix
21
+
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
26
+ python-version: ["3.11", "3.12", "3.13"]
27
+
28
+ runs-on: ${{ matrix.os }}
29
+
30
+ steps:
31
+ - name: Check out code
32
+ uses: actions/checkout@v4
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@v4
36
+ with:
37
+ enable-cache: true
38
+ version: "0.5.x"
39
+
40
+ - name: Set up Python ${{ matrix.python-version }}
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: ${{ matrix.python-version }}
44
+
45
+ - name: Install dependencies
46
+ run: uv sync --frozen --all-extras --dev
47
+
48
+ - name: Configure AWS Credentials
49
+ if: env.SIDELOAD_CACHE == 'true'
50
+ uses: aws-actions/configure-aws-credentials@v4
51
+ with:
52
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
53
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
54
+ aws-region: us-west-2
55
+
56
+ - name: Download cache files from S3
57
+ if: env.SIDELOAD_CACHE == 'true'
58
+ run: |
59
+ mkdir -p .cache
60
+ echo "EPYMORPH_CACHE_PATH=$(realpath .cache)" >> $GITHUB_ENV
61
+ aws s3 sync s3://epymorph-gha-cache .cache
62
+
63
+ - name: Run unit tests
64
+ run: uv run pytest tests/fast
65
+
66
+ # Second job: iff tests succeed, build and publish the release (not matrixed).
67
+ build-release:
68
+ name: Build and release
69
+ runs-on: ubuntu-latest
70
+ needs: test-matrix
71
+ permissions:
72
+ contents: write
73
+ id-token: write
74
+ steps:
75
+ - name: Checkout code
76
+ uses: actions/checkout@v4
77
+
78
+ - name: Install uv
79
+ uses: astral-sh/setup-uv@v4
80
+ with:
81
+ enable-cache: true
82
+ version: "0.5.x"
83
+
84
+ - name: Set up Python
85
+ uses: actions/setup-python@v5
86
+ with:
87
+ python-version-file: '.python-version'
88
+
89
+ - name: Install dependencies
90
+ run: uv sync --frozen --all-extras --dev
91
+
92
+ - name: Build project
93
+ run: uv build
94
+
95
+ - name: Create GitHub Release
96
+ env:
97
+ GITHUB_TOKEN: ${{ github.token }}
98
+ run: |
99
+ version="$(uv run python -m setuptools_scm)"
100
+ wheel_file="./dist/epymorph-${version}-py3-none-any.whl"
101
+ source_file="./dist/epymorph-${version}.tar.gz"
102
+ gh release create "v${version}" --generate-notes $wheel_file $source_file
103
+
104
+ - name: Create PyPI Release
105
+ run: uv publish
@@ -0,0 +1,27 @@
1
+ # OS files
2
+ .DS_Store
3
+
4
+ # Secrets
5
+ .env
6
+
7
+ # Virtual environments
8
+ /.venv*
9
+
10
+ # Cached data
11
+ /.cache
12
+
13
+ # Compilation
14
+ __pycache__/
15
+
16
+ # Build
17
+ dist/
18
+ build/
19
+ *.egg-info
20
+
21
+ # Testing & dev
22
+ .pytest_cache/
23
+ .coverage
24
+ htmlcov
25
+ debug.log
26
+ scratch
27
+ doc/devlog/data/temp_synthetic_data.csv
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-python.python",
4
+ "ms-python.vscode-pylance",
5
+ "ms-toolsai.jupyter",
6
+ "charliermarsh.ruff",
7
+ ]
8
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "files.exclude": {
3
+ "**/.git": true,
4
+ "**/.svn": true,
5
+ "**/.hg": true,
6
+ "**/CVS": true,
7
+ "**/.DS_Store": true,
8
+ "**/Thumbs.db": true,
9
+ "**/__pycache__": true,
10
+ ".pytest_cache": true
11
+ },
12
+ "files.insertFinalNewline": true,
13
+ "files.trimFinalNewlines": true,
14
+
15
+ "python.analysis.autoImportCompletions": true,
16
+ "python.analysis.diagnosticMode": "workspace",
17
+
18
+ "python.testing.pytestEnabled": true,
19
+ "python.testing.unittestEnabled": false,
20
+ "python.testing.pytestArgs": ["tests"],
21
+
22
+ "editor.defaultFormatter": null,
23
+ "[python]": {
24
+ "editor.detectIndentation": false,
25
+ "editor.insertSpaces": true,
26
+ "editor.tabSize": 4,
27
+ "editor.formatOnSave": true,
28
+ "editor.codeActionsOnSave": {
29
+ "source.fixAll": "explicit",
30
+ "source.organizeImports": "explicit"
31
+ },
32
+ "editor.defaultFormatter": "charliermarsh.ruff",
33
+ },
34
+
35
+ "notebook.formatOnSave.enabled": true,
36
+ "notebook.codeActionsOnSave": {
37
+ "notebook.source.fixAll": "explicit",
38
+ "notebook.source.organizeImports": "explicit"
39
+ },
40
+
41
+ "jupyter.notebookFileRoot": "${workspaceFolder}",
42
+ }
@@ -0,0 +1,51 @@
1
+ # Contributing to epymorph
2
+
3
+ epymorph is open source software and we welcome your contributions and feedback.
4
+
5
+ For general inquiries please contact us via email at Epymorph@nau.edu
6
+
7
+ You can contribute directly to the codebase by [submitting Issues](https://github.com/NAU-CCL/Epymorph/issues) if you encounter bugs. We are also happy to consider [Pull Requests](https://github.com/NAU-CCL/Epymorph). In order to help us respond as fast as possible, please provide as much descriptive detail in your requests as you can. You might include code samples, error messages, input data, information about your operating system and Python version, and anything else that may be relevant.
8
+
9
+ ## Development Setup
10
+
11
+ A correctly configured development environment is critical for contributing code to the project. For epymorph, that includes the following pieces:
12
+
13
+ - the epymorph git repository, cloned to your development machine,
14
+ - a python runtime of an appropriate version,
15
+ - a virtual environment with dependencies installed,
16
+ - an automated code formatter and linter, and
17
+ - your IDE of choice (integrated development environment).
18
+
19
+ While there are many options that fulfill the above, our "official" recommended environment includes the following:
20
+
21
+ - **uv** as a tool for python, project, and virtual environment management,
22
+ - **ruff** as a code formatter and linter, and
23
+ - **VS Code** as an IDE that integrates these tools.
24
+
25
+ To set up our recommended environment follow these steps:
26
+
27
+ 1. [Install **uv**.](https://docs.astral.sh/uv/)
28
+ 1. [Install **VS Code**.](https://code.visualstudio.com/)
29
+ 1. [Clone the **epymorph** git repository.](https://github.com/NAU-CCL/Epymorph)
30
+ 1. Open the project folder in VS Code.
31
+ 1. Install the recommended extensions (which include Python, Jupyter, and ruff).
32
+ 1. Open a terminal in VS Code (which should open a shell in the project folder) and run `uv sync`; this will create a virtual environment and install epymorph's dependencies (including dev dependencies). Additionally if you don't already have python installed, uv will install a suitable version for you.
33
+ 1. VS Code may enable the new virtual environment automatically, but it may not. You can run the "Python: Select Interpreter" command from VS Code's command palette to be sure. You want to select the virtual environment in the project's ".venv" folder.
34
+
35
+ That's it! In the terminal, you can run the command `uv run epymorph --help` to check that epymorph has been successfully installed. You should see a description of epymorph's command-line interface.
36
+
37
+ The included VS Code settings configure the editor to run linting checks and auto-format the code on file save. You should verify that this is true! Make a trivial change to a python code file, like adding some blank lines, and save the file. The formatter should fix the file to remove the extraneous blank lines. If it doesn't, double check your configuration. We require a strict auto-formatter in order to maintain a clean and readable change history and avoid unnecessary merge conflicts in contributions.
38
+
39
+ ## Configuration
40
+
41
+ epymorph developers using VS Code will find it convenient to use a `.env` file in the project root for providing configuration values (i.e., environment variables; as noted in the README).
42
+
43
+ For example, `USAGE.ipynb` fetches data from the US Census and you'll need to provide an API key for that to work.
44
+
45
+ First [request an API key from the Census](https://api.census.gov/data/key_signup.html). Once you have the key (a sequence of letters and numbers), create a file named `.env` in the root of the epymorph project containing these contents (for example, assuming our key is "abcd1234"):
46
+
47
+ ```
48
+ CENSUS_API_KEY=abcd1234
49
+ ```
50
+
51
+ You may need to reload VS Code first, but otherwise the values in this file will be used automatically. Of course you can set other environment variables here as well.