Rename latent process classes and update tests and documentation#781
Rename latent process classes and update tests and documentation#781cdc-mitzimorris merged 40 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Renames latent infection process classes and constructor arguments to better match epidemiological terminology, updating tests and tutorials to reflect the new public-facing API.
Changes:
- Renamed
SharedInfections→PopulationInfectionsandHierarchicalInfections→SubpopulationInfections, including updated exports. - Renamed constructor arg
initial_log_rt_rv→log_rt_time_0_rvand propagated through model builder, tests, and integration coverage. - Updated documentation/tutorials and navigation to reference the new class/argument names.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_subpopulation_infections.py | Updates unit tests to use SubpopulationInfections + renamed constructor arg and trace-site prefixes. |
| test/test_pyrenew_builder.py | Updates builder tests to configure SubpopulationInfections and new arg name. |
| test/test_population_infections.py | Migrates unit tests from SharedInfections to PopulationInfections and updates deterministic-site expectations. |
| test/test_interface_coverage.py | Updates interface coverage to instantiate SubpopulationInfections and use renamed arg. |
| test/integration/test_population_infections_he.py | Updates integration test to new deterministic variable names for PopulationInfections. |
| test/integration/conftest.py | Updates integration model builder wiring to PopulationInfections + new arg/process param names. |
| test/conftest.py | Replaces latent fixtures with subpopulation_infections and adds population_infections fixture. |
| pyrenew/model/pyrenew_builder.py | Updates docstring example for latent class naming. |
| pyrenew/model/multisignal_model.py | Updates docstring example for latent class naming. |
| pyrenew/latent/subpopulation_infections.py | Renames class and constructor arg; updates sampling to use log_rt_time_0_rv. |
| pyrenew/latent/population_infections.py | Renames class and constructor arg; renames process parameter and deterministic-site names. |
| pyrenew/latent/base.py | Updates base-class docs to reference new class names. |
| pyrenew/latent/init.py | Updates public exports to PopulationInfections and SubpopulationInfections. |
| docs/tutorials/latent_subpopulation_infections.qmd | Renames tutorial content and examples to SubpopulationInfections / PopulationInfections + new arg name. |
| docs/tutorials/latent_infections.qmd | Updates single-population latent tutorial to PopulationInfections and new arg/process parameter names. |
| docs/tutorials/building_multisignal_models.qmd | Updates builder tutorial examples and narrative to SubpopulationInfections + log_rt_time_0_rv. |
| docs/tutorials/.pages | Updates tutorials nav entry to latent_subpopulation_infections.md. |
| docs/index.md | Updates docs landing page links to new tutorial names. |
Comments suppressed due to low confidence (5)
pyrenew/latent/population_infections.py:3
- Module docstring has a typo: "Populaton-level" should be "Population-level".
pyrenew/latent/population_infections.py:30 - The class docstring math markup has an extra space ("$\ mathcal{R}(t)$"), which may render incorrectly in generated docs. Consider changing it to "$\mathcal{R}(t)$".
docs/tutorials/latent_subpopulation_infections.qmd:116 - This tutorial text still references the old initial-condition name
initial_log_rt. It should be updated tolog_rt_time_0to match the renamed constructor argument (log_rt_time_0_rv).
docs/tutorials/latent_subpopulation_infections.qmd:183 - This print statement labels the value as "Log Rt" but prints
exp(log_rt_time_0), which is Rt (not log Rt). Update the label or the printed value so they match.
pyrenew/latent/subpopulation_infections.py:30 - After renaming the class to SubpopulationInfections, several docstrings in this module still use the old phrasing "hierarchical infections" (e.g., init/validate/sample docstrings). Updating these strings will keep the generated API docs consistent with the new public name.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #781 +/- ##
=======================================
Coverage 98.44% 98.44%
=======================================
Files 51 51
Lines 1675 1675
=======================================
Hits 1649 1649
Misses 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you for your contribution @cdc-mitzimorris 🚀! Your github-pages is ready for download 👉 here 👈! |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| * **The shape is set by `initial_log_rt`**.<br> | ||
| `initial_log_rt` enters the model in two places: it is the starting point of | ||
| * **The shape is set by `log_rt_time_0`**.<br> | ||
| `log_rt_time_0` enters the model in two places: it is the starting point of |
There was a problem hiding this comment.
The latex explanation below still uses the old name $e^{\text{initial\_log\_rt}}$. Perhaps search the codebase for any latex versions of the olde names.
There was a problem hiding this comment.
good catch. thanks!
damonbayer
left a comment
There was a problem hiding this comment.
Please review the latex portions of the tutorials / docs for any names that should have been changed. Otherwise, this looks good!
This PR implements the first set of name changes in issue #778:
class
SharedInfections->PopulationInfectionsclass
HierarchicalInfections->SubpopulationInfectionsconstructor arg
initial_log_rt_rv->log_rt_time_0_rv.The tests and documentation have been updated accordingly.