laser.cholera 0.13.0__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 (80) hide show
  1. laser_cholera-0.13.0/AUTHORS.rst +6 -0
  2. laser_cholera-0.13.0/CHANGELOG.rst +163 -0
  3. laser_cholera-0.13.0/CONTRIBUTING.rst +85 -0
  4. laser_cholera-0.13.0/LICENSE +9 -0
  5. laser_cholera-0.13.0/PKG-INFO +66 -0
  6. laser_cholera-0.13.0/README.md +23 -0
  7. laser_cholera-0.13.0/README.rst +97 -0
  8. laser_cholera-0.13.0/pyproject.toml +165 -0
  9. laser_cholera-0.13.0/src/laser/cholera/__init__.py +12 -0
  10. laser_cholera-0.13.0/src/laser/cholera/_core.c +82 -0
  11. laser_cholera-0.13.0/src/laser/cholera/calc_log_likelihood_distributions.R +699 -0
  12. laser_cholera-0.13.0/src/laser/cholera/calc_log_likelihood_distributions.py +668 -0
  13. laser_cholera-0.13.0/src/laser/cholera/calc_model_likelihood.R +669 -0
  14. laser_cholera-0.13.0/src/laser/cholera/calc_model_likelihood.py +764 -0
  15. laser_cholera-0.13.0/src/laser/cholera/core.py +6 -0
  16. laser_cholera-0.13.0/src/laser/cholera/iso_codes.py +45 -0
  17. laser_cholera-0.13.0/src/laser/cholera/metapop/.DS_Store +0 -0
  18. laser_cholera-0.13.0/src/laser/cholera/metapop/__init__.py +36 -0
  19. laser_cholera-0.13.0/src/laser/cholera/metapop/analyzer.py +75 -0
  20. laser_cholera-0.13.0/src/laser/cholera/metapop/census.py +40 -0
  21. laser_cholera-0.13.0/src/laser/cholera/metapop/data/default_parameters.json +923 -0
  22. laser_cholera-0.13.0/src/laser/cholera/metapop/data/default_parameters.json.gz +0 -0
  23. laser_cholera-0.13.0/src/laser/cholera/metapop/data/demographics_africa_2000_2023.csv +1297 -0
  24. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries.cpg +1 -0
  25. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries.dbf +0 -0
  26. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries.prj +1 -0
  27. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries.shp +0 -0
  28. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries.shx +0 -0
  29. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries_01pct.dbf +0 -0
  30. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries_01pct.prj +1 -0
  31. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries_01pct.shp +0 -0
  32. laser_cholera-0.13.0/src/laser/cholera/metapop/data/mosaic_countries_01pct.shx +0 -0
  33. laser_cholera-0.13.0/src/laser/cholera/metapop/derivedvalues.py +217 -0
  34. laser_cholera-0.13.0/src/laser/cholera/metapop/environmental.py +150 -0
  35. laser_cholera-0.13.0/src/laser/cholera/metapop/envtohuman.py +83 -0
  36. laser_cholera-0.13.0/src/laser/cholera/metapop/exposed.py +52 -0
  37. laser_cholera-0.13.0/src/laser/cholera/metapop/humantohuman.py +151 -0
  38. laser_cholera-0.13.0/src/laser/cholera/metapop/infectious.py +188 -0
  39. laser_cholera-0.13.0/src/laser/cholera/metapop/logsetup.py +41 -0
  40. laser_cholera-0.13.0/src/laser/cholera/metapop/model.py +408 -0
  41. laser_cholera-0.13.0/src/laser/cholera/metapop/params.py +619 -0
  42. laser_cholera-0.13.0/src/laser/cholera/metapop/recorder.py +111 -0
  43. laser_cholera-0.13.0/src/laser/cholera/metapop/recovered.py +58 -0
  44. laser_cholera-0.13.0/src/laser/cholera/metapop/scenario.py +24 -0
  45. laser_cholera-0.13.0/src/laser/cholera/metapop/susceptible.py +62 -0
  46. laser_cholera-0.13.0/src/laser/cholera/metapop/utils.py +151 -0
  47. laser_cholera-0.13.0/src/laser/cholera/metapop/vaccinated.py +157 -0
  48. laser_cholera-0.13.0/src/laser/cholera/test.py +23 -0
  49. laser_cholera-0.13.0/src/laser/cholera/utils.py +5 -0
  50. laser_cholera-0.13.0/tests/test_analyzer.py +220 -0
  51. laser_cholera-0.13.0/tests/test_calc_log_likelihood_beta.py +167 -0
  52. laser_cholera-0.13.0/tests/test_calc_log_likelihood_binomial.py +197 -0
  53. laser_cholera-0.13.0/tests/test_calc_log_likelihood_gamma.py +166 -0
  54. laser_cholera-0.13.0/tests/test_calc_log_likelihood_negbin.py +300 -0
  55. laser_cholera-0.13.0/tests/test_calc_log_likelihood_normal.py +153 -0
  56. laser_cholera-0.13.0/tests/test_calc_log_likelihood_poisson.py +183 -0
  57. laser_cholera-0.13.0/tests/test_calc_log_likelihood_verbose.py +170 -0
  58. laser_cholera-0.13.0/tests/test_calc_model_likelihood.py +1204 -0
  59. laser_cholera-0.13.0/tests/test_calc_model_likelihood_extreme.py +175 -0
  60. laser_cholera-0.13.0/tests/test_calc_model_likelihood_reference.py +231 -0
  61. laser_cholera-0.13.0/tests/test_census.py +50 -0
  62. laser_cholera-0.13.0/tests/test_compute_wis_parametric_row.py +119 -0
  63. laser_cholera-0.13.0/tests/test_core.py +5 -0
  64. laser_cholera-0.13.0/tests/test_environmental.py +113 -0
  65. laser_cholera-0.13.0/tests/test_envtohuman.py +147 -0
  66. laser_cholera-0.13.0/tests/test_exposed.py +36 -0
  67. laser_cholera-0.13.0/tests/test_humantohuman.py +98 -0
  68. laser_cholera-0.13.0/tests/test_ifr.py +148 -0
  69. laser_cholera-0.13.0/tests/test_infectious.py +201 -0
  70. laser_cholera-0.13.0/tests/test_ll_cumulative_progressive_nb.py +123 -0
  71. laser_cholera-0.13.0/tests/test_metapop.py +16 -0
  72. laser_cholera-0.13.0/tests/test_metapop_utils.py +208 -0
  73. laser_cholera-0.13.0/tests/test_model.py +96 -0
  74. laser_cholera-0.13.0/tests/test_nb_size_from_obs_weighted.py +124 -0
  75. laser_cholera-0.13.0/tests/test_params.py +293 -0
  76. laser_cholera-0.13.0/tests/test_recorder.py +481 -0
  77. laser_cholera-0.13.0/tests/test_recovered.py +75 -0
  78. laser_cholera-0.13.0/tests/test_susceptible.py +95 -0
  79. laser_cholera-0.13.0/tests/test_vaccinated.py +592 -0
  80. laser_cholera-0.13.0/tests/test_vitalstatistics.py +202 -0
@@ -0,0 +1,6 @@
1
+
2
+ Authors
3
+ =======
4
+
5
+ * Christopher Lorton - https://www.idmod.org
6
+ * John Giles - https://www.idmod.org
@@ -0,0 +1,163 @@
1
+
2
+ Changelog
3
+ =========
4
+
5
+ 0.12.5 (unreleased)
6
+ -------------------
7
+
8
+ * Add src/laser/cholera/calc_log_likelihood_distributions.py: Python translation of calc_log_likelihood_distributions.R (Beta, Binomial, Gamma, NegBin, Normal, Poisson)
9
+ * Rename src/laser/cholera/spring_likelihood.py → calc_model_likelihood.py
10
+ * Add tests/test_calc_log_likelihood_negbin.py: Python translation of test_calc_log_likelihood_negbin.R; update import to calc_log_likelihood_distributions
11
+ * Add tests/test_calc_model_likelihood.py: Python translation of test_calc_model_likelihood.R
12
+ * Add tests/test_calc_model_likelihood_extreme.py: Python translation of test_calc_model_likelihood_extreme.R
13
+ * Add tests/test_calc_model_likelihood_reference.py: Python translation of test_calc_model_likelihood_reference.R
14
+ * Add tests/test_compute_wis_parametric_row.py: Python translation of test_compute_wis_parametric_row.R
15
+ * Add tests/test_ll_cumulative_progressive_nb.py: Python translation of test_ll_cumulative_progressive_nb.R
16
+ * Add tests/test_nb_size_from_obs_weighted.py: Python translation of test_nb_size_from_obs_weighted.R
17
+ * Update src/laser/cholera/calc_model_likelihood.py: replace the ``config`` dict argument on ``calc_model_likelihood`` with explicit ``epidemic_peaks`` (DataFrame with ``iso_code``, ``peak_date``, ``loc_idx`` columns), ``date_start``, and ``date_stop`` kwargs.
18
+ * Update src/laser/cholera/metapop/params.py: ingestion of ``epidemic_peaks`` now asserts each ``iso_code`` is in ``location_name`` and appends a ``loc_idx`` column mapping each row to its simulation location index.
19
+ * Remove HDF5 config-parameter loading from src/laser/cholera/metapop/params.py (``load_hdf5_parameters``, ``load_compressed_hdf5_parameters``, ``load_hdf5`` and the ``.h5``/``.hdf``/``.hdf5`` entries in ``get_parameters`` dispatch). HDF5 *output* via ``recorder.py`` is unaffected, as is the ``hdf5_output`` flag in ``utils.py``. Add a parametrized regression test in tests/test_params.py confirming HDF5 suffixes are now rejected by ``get_parameters``.
20
+ * Add tests/test_recorder.py: 20-test coverage of ``Recorder`` — init/model identity, ``check()`` warn-on-missing for ``people``/``patches``, per-tick gating in ``__call__`` (final-tick timing, ``hdf5_output`` + ``return`` quadrants), ``outdir`` routing, ``compress`` → ``.h5.gz``, low-level ``save_hdf5_parameters`` / ``save_compressed_hdf5_parameters`` (groups, datasets, underscore + method filtering, ``AttributeError`` on missing frames), and an end-to-end happy-path round-trip.
21
+ * Update tests/test_params.py: add tests covering ``epidemic_peaks`` ingestion (list-of-dicts and dict-of-lists → DataFrame, optional/absent case, ``loc_idx`` mapping correctness, unknown-ISO ``AssertionError``) and ``validate_parameters`` enforcement of ``iso_code`` and ``peak_date`` columns.
22
+ * Fix latent bug in src/laser/cholera/metapop/utils.py: ``override_helper`` mapped ``date_start`` / ``date_stop`` to ``partial(datetime.strptime, format="%Y-%m-%d")``, which raises ``TypeError`` because ``datetime.strptime`` is a C function that rejects keyword arguments. Replaced with a positional-args wrapper.
23
+ * Test-coverage push to ≥90% across five files: ``calc_log_likelihood_distributions.py`` 91.7%, ``calc_model_likelihood.py`` 91.5%, ``metapop/analyzer.py`` 100%, ``metapop/utils.py`` 100%, ``metapop/vaccinated.py`` 98.0%. New test files: ``tests/test_analyzer.py``, ``tests/test_calc_log_likelihood_{beta,binomial,gamma,normal,poisson,verbose}.py``. Extended files: ``tests/test_metapop_utils.py`` (new ``TestOverrideHelper`` class + single-location ``get_pi`` test), ``tests/test_vaccinated.py`` (2 dose-clamp branch tests), ``tests/test_calc_model_likelihood.py`` (new ``TestLegacyPeakHelpers`` and ``TestCalcModelLikelihoodCoverage`` classes covering legacy multi-peak helpers, peak shape-term dispatch, weekly-cadence detection, weights-validation paths, NB dispersion fallback, and the non-finite per-location safety net).
24
+
25
+ 0.10.1 (2026-01-16)
26
+ -------------------
27
+
28
+ * Add tests for new IFR implementation
29
+
30
+ 0.10.0 (2026-01-15)
31
+ -------------------
32
+
33
+ * New IFR model (Infection Fatality Ratio)
34
+ * Update observation process with rho and chi based on infectious prevalence and diagnostic rates
35
+ * Update default_parameters.json and LICENSE copyright dates
36
+ * Test fixes for NumPy scalar serialization
37
+ * Remove MacOS x86_64 from test matrix
38
+ * Linter issues and GitHub runner fixes
39
+
40
+ 0.9.1 (2025-10-02)
41
+ ------------------
42
+
43
+ * Fix typo infective -> ineffective
44
+ * Add checks against populations going negative
45
+ * Expose new_symptomatic
46
+ * Only print if verbose is True in parameters
47
+ * Skip likelihood check unless "calc_likelihood" is in parameters
48
+ * Address linter issues
49
+ * Bugfix for parameter constraints (alphas)
50
+
51
+ 0.9.0 (2025-08-19)
52
+ ------------------
53
+
54
+ * Support single location configuration
55
+
56
+ 0.8.0 (2025-07-24)
57
+ ------------------
58
+
59
+ * Spatial hazard computation fix (don't transpose pi_ij in model.results)
60
+
61
+ 0.7.11 (2025-07-11)
62
+ -------------------
63
+
64
+ * Trim and transpose for convenience in MOSAIC
65
+
66
+ 0.7.10 (2025-07-10)
67
+ -------------------
68
+
69
+ * Fix bug in double counting Vxinf
70
+ * Fix bug in suitability to decay calculations
71
+ * Update default parameters
72
+ * Fix indexing for human daily seasonality
73
+
74
+ 0.7.9 (2025-06-06)
75
+ ------------------
76
+
77
+ * Rename beta_env to beta_jt_env
78
+ * Rename beta_j_seasonality to beta_jt_human and use directly in spatial hazard calculation
79
+ * Update pre-commit
80
+ * Fix handling of pi_ij matrix math
81
+ * Track vaccine doses delivered
82
+ * Births should be Poisson rather than binomial
83
+ * Rename estimated to simulated for clarity
84
+ * Switch from 'agents' to 'people' terminology
85
+ * Fix coupling calculation for denominator == 0
86
+
87
+ 0.7.8 (2025-05-16)
88
+ ------------------
89
+
90
+ * Likelihood cleanup for NaNs and all zeros
91
+
92
+ 0.7.7 (2025-05-13)
93
+ ------------------
94
+
95
+ * Calculate log likelihood at end of simulation
96
+
97
+ 0.7.6 (2025-05-13)
98
+ ------------------
99
+
100
+ * Fix logging setup and np.var() usage
101
+
102
+ 0.7.5 (2025-05-13)
103
+ ------------------
104
+
105
+ * Add Python implementation of R tests for likelihood functions
106
+
107
+ 0.7.4 (2025-05-07)
108
+ ------------------
109
+
110
+ * Fix up reading JSON files back into memory (handle actual NaN vs "NA" or "NaN")
111
+ * Record incidence (total and per source)
112
+ * Adding likelihood functions
113
+ * Adding likelihood function tests
114
+ * More consistent variable names
115
+
116
+ 0.7.3 (2025-04-30)
117
+ ------------------
118
+
119
+ * Gate file output on hdf5_output and "return" config parameters
120
+ * Clean up console output with logging infrastructure
121
+ * Add "quiet" parameter to suppress console progress bar (defaults to False for CLI, True for programmatic interface)
122
+ * Update GHA to run tests on push to main
123
+ * Support params from R (numeric values come in as doubles, but we need an integer for p)
124
+
125
+ 0.7.2 (2025-04-24)
126
+ ------------------
127
+
128
+ * Support for passing dict to get_parameters()
129
+ * Tests for run_model() function
130
+ * Additional tests for tracking vital statistics (births, non-disease deaths, disease deaths)
131
+
132
+ 0.7.1 (2025-04-24)
133
+ ------------------
134
+
135
+ * Minor version bump
136
+
137
+ 0.7.0 (2025-04-23)
138
+ ------------------
139
+
140
+ * Initial alpha release
141
+ * Support passing parameter dictionary to run_model()
142
+ * Fix mapping of environmental suitability (psi_jt) to decay parameter (delta_jt)
143
+ * Update default_parameters.json with matrices
144
+ * Update parameter loading for matrices
145
+ * Clean up plotting and fix seasonality phase
146
+ * Handle command line parameter overrides
147
+ * Enable parameter overrides correctly
148
+ * Allow test parameter sets to skip validation
149
+ * Pin numpy, numba, and llvmlite versions
150
+ * Remove subpackages
151
+ * Update laser-core dependency
152
+ * Return model from run_model()
153
+ * Require Numba that supports NumPy>=2.0
154
+ * Update shedding to environment based on theta_j
155
+ * Updated parameters including switch from delta_min/delta_max to decay_days_fast/decay_days_slow
156
+ * Use decay_shape_1 and decay_shape_2 to parameterize scipy.stats.beta.cdf
157
+ * Add version bump, build, and release GHA
158
+ * Metapop implementation work-in-progress commits
159
+
160
+ 0.0.0 (2024-09-30)
161
+ ------------------
162
+
163
+ * First release on PyPI
@@ -0,0 +1,85 @@
1
+ ============
2
+ Contributing
3
+ ============
4
+
5
+ Contributions are welcome, and they are greatly appreciated! Every
6
+ little bit helps, and credit will always be given.
7
+
8
+ Bug reports
9
+ ===========
10
+
11
+ When `reporting a bug <https://github.com/InstituteforDiseaseModeling/laser-cholera/issues>`_ please include:
12
+
13
+ * Your operating system name and version.
14
+ * Any details about your local setup that might be helpful in troubleshooting.
15
+ * Detailed steps to reproduce the bug.
16
+
17
+ Documentation improvements
18
+ ==========================
19
+
20
+ LASER Cholera could always use more documentation, whether as part of the
21
+ official LASER Cholera docs, in docstrings, or even on the web in blog posts,
22
+ articles, and such.
23
+
24
+ Feature requests and feedback
25
+ =============================
26
+
27
+ The best way to send feedback is to file an issue at https://github.com/InstituteforDiseaseModeling/laser-cholera/issues.
28
+
29
+ If you are proposing a feature:
30
+
31
+ * Explain in detail how it would work.
32
+ * Keep the scope as narrow as possible, to make it easier to implement.
33
+ * Remember that this is a volunteer-driven project, and that code contributions are welcome :)
34
+
35
+ Development
36
+ ===========
37
+
38
+ To set up `laser-cholera` for local development:
39
+
40
+ 1. Fork `laser-cholera <https://github.com/InstituteforDiseaseModeling/laser-cholera>`_
41
+ (look for the "Fork" button).
42
+ 2. Clone your fork locally::
43
+
44
+ git clone git@github.com:YOURGITHUBNAME/laser-cholera.git
45
+
46
+ 3. Create a branch for local development::
47
+
48
+ git checkout -b name-of-your-bugfix-or-feature
49
+
50
+ Now you can make your changes locally.
51
+
52
+ 4. When you're done making changes run all the checks and docs builder with one command::
53
+
54
+ tox
55
+
56
+ 5. Commit your changes and push your branch to GitHub::
57
+
58
+ git add .
59
+ git commit -m "Your detailed description of your changes."
60
+ git push origin name-of-your-bugfix-or-feature
61
+
62
+ 6. Submit a pull request through the GitHub website.
63
+
64
+ Pull Request Guidelines
65
+ -----------------------
66
+
67
+ If you need some code review or feedback while you're developing the code just make the pull request.
68
+
69
+ For merging, you should:
70
+
71
+ 1. Include passing tests (run ``tox``).
72
+ 2. Update documentation when there's new API, functionality etc.
73
+ 3. Add a note to ``CHANGELOG.rst`` about the changes.
74
+ 4. Add yourself to ``AUTHORS.rst``.
75
+
76
+ Tips
77
+ ----
78
+
79
+ To run a subset of tests::
80
+
81
+ tox -e envname -- pytest -k test_myfeature
82
+
83
+ To run all the test environments in *parallel*::
84
+
85
+ tox -p auto
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026, Bill & Melinda Gates Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: laser.cholera
3
+ Version: 0.13.0
4
+ Summary: LASIK - LASER based SImulation of Kolera
5
+ Keywords: cholera,simulation,laser,spatial modeling
6
+ Author: Christopher Lorton, John Giles
7
+ Author-email: Christopher Lorton <christopher.lorton@gatesfoundation.org>, John Giles <john.giles@gatesfoundation.org>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Requires-Dist: laser-core~=1.0
21
+ Requires-Dist: geopandas>=1.1.2
22
+ Requires-Dist: h5py
23
+ Requires-Dist: scipy
24
+ Requires-Dist: tqdm
25
+ Requires-Dist: pytest>=9.0.3 ; extra == 'dev'
26
+ Requires-Dist: build ; extra == 'dev'
27
+ Requires-Dist: uv ; extra == 'dev'
28
+ Requires-Dist: jupyter ; extra == 'nb'
29
+ Requires-Dist: nbconvert>=7.17.1 ; extra == 'nb'
30
+ Requires-Dist: nbformat ; extra == 'nb'
31
+ Requires-Dist: ipykernel ; extra == 'nb'
32
+ Maintainer: Christopher Lorton
33
+ Maintainer-email: Christopher Lorton <christopher.lorton@gatesfoundation.org>
34
+ Requires-Python: >=3.10
35
+ Project-URL: Homepage, https://example.com
36
+ Project-URL: Documentation, https://laser-cholera.readthedocs.io/en/latest/
37
+ Project-URL: Repository, https://github.com/InstituteforDiseaseModeling/laser-cholera.git
38
+ Project-URL: Issues, https://github.com/InstituteforDiseaseModeling/laser-cholera/issues
39
+ Project-URL: Changelog, https://github.com/InstituteforDiseaseModeling/laser-cholera/blob/master/CHANGELOG.md
40
+ Provides-Extra: dev
41
+ Provides-Extra: nb
42
+ Description-Content-Type: text/markdown
43
+
44
+ # LASIK - LASER based SImulation of Kolera
45
+
46
+ -----
47
+
48
+ [![documentation](https://readthedocs.org/projects/laser-cholera/badge/?style=flat)](https://docs.idmod.org/projects/laser-cholera/en/latest/)
49
+
50
+ ![tests](https://github.com/InstituteforDiseaseModeling/laser-cholera/actions/workflows/github-actions.yml/badge.svg)
51
+
52
+ [![package](https://img.shields.io/pypi/v/laser-cholera.svg)](https://pypi.org/project/laser-cholera/)
53
+ ![wheel](https://img.shields.io/pypi/wheel/laser-cholera.svg)
54
+ ![python versions](https://img.shields.io/pypi/pyversions/laser-cholera)
55
+ ![implementation](https://img.shields.io/pypi/implementation/laser-cholera.svg)
56
+ ![license](https://img.shields.io/pypi/l/laser-cholera.svg)
57
+
58
+ ![commits since v0.13.0](https://img.shields.io/github/commits-since/InstituteforDiseaseModeling/laser-cholera/v0.13.0.svg)
59
+
60
+ -----
61
+
62
+ - `uv` package and project manager: `python3 -m pip install uv`
63
+ - `uv python install 3.10 3.11 3.12 3.13 3.14`
64
+ - in the `laser-cholera` directory:
65
+ - `uv venv` optionally specify `--python #` to use a particular versin of Python in the virtual environment
66
+ - `uv pip install -e .`
@@ -0,0 +1,23 @@
1
+ # LASIK - LASER based SImulation of Kolera
2
+
3
+ -----
4
+
5
+ [![documentation](https://readthedocs.org/projects/laser-cholera/badge/?style=flat)](https://docs.idmod.org/projects/laser-cholera/en/latest/)
6
+
7
+ ![tests](https://github.com/InstituteforDiseaseModeling/laser-cholera/actions/workflows/github-actions.yml/badge.svg)
8
+
9
+ [![package](https://img.shields.io/pypi/v/laser-cholera.svg)](https://pypi.org/project/laser-cholera/)
10
+ ![wheel](https://img.shields.io/pypi/wheel/laser-cholera.svg)
11
+ ![python versions](https://img.shields.io/pypi/pyversions/laser-cholera)
12
+ ![implementation](https://img.shields.io/pypi/implementation/laser-cholera.svg)
13
+ ![license](https://img.shields.io/pypi/l/laser-cholera.svg)
14
+
15
+ ![commits since v0.13.0](https://img.shields.io/github/commits-since/InstituteforDiseaseModeling/laser-cholera/v0.13.0.svg)
16
+
17
+ -----
18
+
19
+ - `uv` package and project manager: `python3 -m pip install uv`
20
+ - `uv python install 3.10 3.11 3.12 3.13 3.14`
21
+ - in the `laser-cholera` directory:
22
+ - `uv venv` optionally specify `--python #` to use a particular versin of Python in the virtual environment
23
+ - `uv pip install -e .`
@@ -0,0 +1,97 @@
1
+ ========
2
+ Overview
3
+ ========
4
+
5
+ .. start-badges
6
+
7
+ .. list-table::
8
+ :stub-columns: 1
9
+
10
+ * - docs
11
+ - |docs|
12
+ * - tests
13
+ - |github-actions| |codecov|
14
+ * - package
15
+ - |version| |wheel| |supported-versions| |supported-implementations| |commits-since|
16
+ .. |docs| image:: https://readthedocs.org/projects/laser-cholera/badge/?style=flat
17
+ :target: https://laser-cholera.readthedocs.io/en/latest/
18
+ :alt: Documentation Status
19
+
20
+ .. |github-actions| image:: https://github.com/InstituteforDiseaseModeling/laser-cholera/actions/workflows/github-actions.yml/badge.svg
21
+ :alt: GitHub Actions Build Status
22
+ :target: https://github.com/InstituteforDiseaseModeling/laser-cholera/actions
23
+
24
+ .. |codecov| image:: https://codecov.io/gh/InstituteforDiseaseModeling/laser-cholera/branch/main/graphs/badge.svg?branch=main
25
+ :alt: Coverage Status
26
+ :target: https://app.codecov.io/github/InstituteforDiseaseModeling/laser-cholera
27
+
28
+ .. |version| image:: https://img.shields.io/pypi/v/laser-cholera.svg
29
+ :alt: PyPI Package latest release
30
+ :target: https://test.pypi.org/project/laser-cholera/
31
+
32
+ .. |wheel| image:: https://img.shields.io/pypi/wheel/laser-cholera.svg
33
+ :alt: PyPI Wheel
34
+ :target: https://test.pypi.org/project/laser-cholera/
35
+
36
+ .. |supported-versions| image:: https://img.shields.io/pypi/pyversions/laser-cholera.svg
37
+ :alt: Supported versions
38
+ :target: https://test.pypi.org/project/laser-cholera/
39
+
40
+ .. |supported-implementations| image:: https://img.shields.io/pypi/implementation/laser-cholera.svg
41
+ :alt: Supported implementations
42
+ :target: https://test.pypi.org/project/laser-cholera/
43
+
44
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/InstituteforDiseaseModeling/laser-cholera/v0.13.0.svg
45
+ :alt: Commits since latest release
46
+ :target: https://github.com/InstituteforDiseaseModeling/laser-cholera/compare/v0.13.0...main
47
+
48
+
49
+
50
+ .. end-badges
51
+
52
+ LASIK - LASER based SImulation of Kolera
53
+
54
+ * Free software: MIT license
55
+
56
+ Installation
57
+ ============
58
+
59
+ ::
60
+
61
+ pip install laser-cholera
62
+
63
+ You can also install the in-development version with::
64
+
65
+ pip install https://github.com/InstituteforDiseaseModeling/laser-cholera/archive/main.zip
66
+
67
+
68
+ Documentation
69
+ =============
70
+
71
+
72
+ https://laser-cholera.readthedocs.io/en/latest/
73
+
74
+
75
+ Development
76
+ ===========
77
+
78
+ To run all the tests run::
79
+
80
+ tox
81
+
82
+ Note, to combine the coverage data from all the tox environments run:
83
+
84
+ .. list-table::
85
+ :widths: 10 90
86
+ :stub-columns: 1
87
+
88
+ - - Windows
89
+ - ::
90
+
91
+ set PYTEST_ADDOPTS=--cov-append
92
+ tox
93
+
94
+ - - Other
95
+ - ::
96
+
97
+ PYTEST_ADDOPTS=--cov-append tox
@@ -0,0 +1,165 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.10.0,<0.12.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "laser.cholera"
7
+ version = "0.13.0"
8
+ authors = [
9
+ { name="Christopher Lorton", email="christopher.lorton@gatesfoundation.org" },
10
+ { name="John Giles", email="john.giles@gatesfoundation.org" },
11
+ ]
12
+ maintainers = [
13
+ { name="Christopher Lorton", email="christopher.lorton@gatesfoundation.org" },
14
+ ]
15
+ description = "LASIK - LASER based SImulation of Kolera"
16
+ readme = "README.md"
17
+ license = "MIT"
18
+ license-files = ["LICENSE"]
19
+ requires-python = ">=3.10"
20
+ keywords = ["cholera", "simulation", "laser", "spatial modeling"]
21
+ classifiers = [
22
+ "Programming Language :: Python :: 3",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Programming Language :: Python :: 3.14",
31
+ # "Programming Language :: Python :: 3.15", # Not until Numba supports it
32
+ "Programming Language :: Python :: Implementation :: CPython",
33
+ ]
34
+ dependencies = [
35
+ "laser-core~=1.0",
36
+ "geopandas>=1.1.2",
37
+ "h5py",
38
+ "scipy",
39
+ "tqdm",
40
+ ]
41
+
42
+ [project.optional-dependencies]
43
+ "dev" = ["pytest>=9.0.3", "build", "uv"]
44
+ # "docs" = ["sphinx", "sphinx-rtd-theme"]
45
+ "nb" = ["jupyter", "nbconvert>=7.17.1", "nbformat", "ipykernel"]
46
+
47
+ [project.urls]
48
+ Homepage = "https://example.com"
49
+ Documentation = "https://laser-cholera.readthedocs.io/en/latest/"
50
+ Repository = "https://github.com/InstituteforDiseaseModeling/laser-cholera.git"
51
+ Issues = "https://github.com/InstituteforDiseaseModeling/laser-cholera/issues"
52
+ Changelog = "https://github.com/InstituteforDiseaseModeling/laser-cholera/blob/master/CHANGELOG.md"
53
+
54
+ [project.scripts]
55
+ metapop = "laser.cholera.metapop.model:cli_run"
56
+
57
+ [tool.uv.build-backend]
58
+ module-name = [ "laser.cholera" ]
59
+ source-include = [
60
+ "AUTHORS.rst", "CHANGELOG.rst", "CONTRIBUTING.rst", "README.rst",
61
+ "src/laser/cholera/metapop/data/default_parameters.*",
62
+ "src/laser/cholera/metapop/data/demographics_africa_2000_2023.csv",
63
+ "src/laser/cholera/metapop/data/mosaic_countries*",
64
+ "tests/test*py"
65
+ ]
66
+
67
+ [tool.ruff]
68
+ extend-exclude = ["static", "ci/templates"]
69
+ line-length = 150
70
+ src = ["src", "tests"]
71
+ target-version = "py39"
72
+
73
+ [tool.ruff.lint.per-file-ignores]
74
+ "ci/*" = ["S"]
75
+
76
+ [tool.ruff.lint]
77
+ select = [
78
+ "B", # flake8-bugbear
79
+ "C4", # flake8-comprehensions
80
+ "DTZ", # flake8-datetimez
81
+ "E", # pycodestyle errors
82
+ "EXE", # flake8-executable
83
+ "F", # pyflakes
84
+ "I", # isort
85
+ "INT", # flake8-gettext
86
+ "PIE", # flake8-pie
87
+ "PLC", # pylint convention
88
+ "PLE", # pylint errors
89
+ "PT", # flake8-pytest-style
90
+ "PTH", # flake8-use-pathlib
91
+ "RSE", # flake8-raise
92
+ "RUF", # ruff-specific rules
93
+ "S", # flake8-bandit
94
+ "UP", # pyupgrade
95
+ "W", # pycodestyle warnings
96
+ ]
97
+ ignore = [
98
+ "RUF001", # ruff-specific rules ambiguous-unicode-character-string
99
+ "RUF002", # ruff-specific rules ambiguous minus sign
100
+ "S101", # flake8-bandit assert
101
+ "S308", # flake8-bandit suspicious-mark-safe-usage
102
+ "S603", # flake8-bandit subprocess-without-shell-equals-true
103
+ "S607", # flake8-bandit start-process-with-partial-path
104
+ "E501", # pycodestyle line-too-long
105
+ "DTZ001", # flake8-datetimez call datetime without tzinfo
106
+ ]
107
+
108
+ [tool.ruff.lint.flake8-pytest-style]
109
+ fixture-parentheses = false
110
+ mark-parentheses = false
111
+
112
+ [tool.ruff.lint.isort]
113
+ forced-separate = ["conftest"]
114
+ force-single-line = true
115
+
116
+ [tool.ruff.format]
117
+ quote-style = "double"
118
+
119
+
120
+ [tool.bumpversion]
121
+ current_version = "0.13.0"
122
+ parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
123
+ serialize = ["{major}.{minor}.{patch}"]
124
+ search = "{current_version}"
125
+ replace = "{new_version}"
126
+ regex = false
127
+ ignore_missing_version = false
128
+ tag = true
129
+ sign_tags = false
130
+ tag_name = "v{new_version}"
131
+ tag_message = "Bump version: {current_version} → {new_version}"
132
+ allow_dirty = false
133
+ commit = true
134
+ message = "Bump version: {current_version} → {new_version}"
135
+ commit_args = ""
136
+
137
+ [[tool.bumpversion.files]]
138
+ filename = "README.md"
139
+ search = "since v{current_version}"
140
+ replace = "since v{new_version}"
141
+
142
+ [[tool.bumpversion.files]]
143
+ filename = "README.md"
144
+ search = "/v{current_version}.svg"
145
+ replace = "/v{new_version}.svg"
146
+
147
+ [[tool.bumpversion.files]]
148
+ filename = "README.rst"
149
+ search = "/v{current_version}.svg"
150
+ replace = "/v{new_version}.svg"
151
+
152
+ [[tool.bumpversion.files]]
153
+ filename = "README.rst"
154
+ search = "/v{current_version}...main"
155
+ replace = "/v{new_version}...main"
156
+
157
+ [[tool.bumpversion.files]]
158
+ filename = "docs/conf.py"
159
+ search = 'version = release = "{current_version}"'
160
+ replace = 'version = release = "{new_version}"'
161
+
162
+ [[tool.bumpversion.files]]
163
+ filename = "pyproject.toml"
164
+ search = 'version = "{current_version}"'
165
+ replace = 'version = "{new_version}"'
@@ -0,0 +1,12 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("laser.cholera")
4
+
5
+ from .core import compute
6
+ from .iso_codes import iso_codes
7
+
8
+ __all__ = [
9
+ "__version__",
10
+ "compute",
11
+ "iso_codes",
12
+ ]