Skip to content

Let log_rt_time_0_rv give each subpopulation its own starting Rt - #907

Merged
dylanhmorris merged 8 commits into
mainfrom
mem_905_subpopulation_starting_rt
Oct 21, 2026
Merged

dylanhmorris merged 8 commits into
mainfrom
mem_905_subpopulation_starting_rt

Conversation

@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator

Allow the latent subpopulation process to have a per-subpopulation initial value log_rt_time_0_rv.

The essential code changes are:

  1. Add _split_initial_log_rt after _validate_and_prepare_I0
  2. In sample:
    • the _split_initial_log_rt call replaces initial_log_rt = self.log_rt_time_0_rv();
    • initial_value=baseline_start goes to the baseline process;
    • initial_value=deviations_start goes to the deviation process.
  3. I0 shape check: add the shape check to _validate_and_prepare_I0
  4. Docstrings,
    • class docstring "Mathematical form": add the starting-values item;
    • __init__: the log_rt_time_0_rv parameter text
    • sample: the Raises entry for log_rt_time_0_rv and I0_rv.

This PR adds corresponding unit tests and updates to the latent subpopulations infection process tutorial.

@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator Author

This PR should be reviewed and merged only after #906 has been merged.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Thank you for your contribution @dylanhmorris 🚀! Your github-pages is ready for download 👉 here 👈!
(The artifact expires on 2026-10-28T20:16:52Z. You can re-generate it by re-running the workflow here.)

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.84%. Comparing base (4be4f4b) to head (4b01366).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #907   +/-   ##
=======================================
  Coverage   98.84%   98.84%           
=======================================
  Files          58       58           
  Lines        2249     2258    +9     
=======================================
+ Hits         2223     2232    +9     
  Misses         26       26           
Flag Coverage Δ
unittests 98.84% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dylanhmorris

Copy link
Copy Markdown
Collaborator

@cdc-mitzimorris. I believe this one is next. Can you resolve conflicts and request review?

@cdc-mitzimorris
cdc-mitzimorris force-pushed the mem_905_subpopulation_starting_rt branch from 6a3c058 to 422b3eb Compare October 20, 2026 17:10
@cdc-mitzimorris
cdc-mitzimorris force-pushed the mem_905_subpopulation_starting_rt branch from 422b3eb to 3a47e17 Compare October 20, 2026 21:20
@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator Author

@dylanhmorris - ready for review.

@dylanhmorris
dylanhmorris marked this pull request as ready for review October 20, 2026 22:17
Comment thread test/test_subpopulation_infections.py Resolved

@dylanhmorris dylanhmorris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cdc-mitzimorris. A few changes and suggestions.

cdc-mitzimorris and others added 5 commits October 21, 2026 12:28
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
…v/PyRenew into mem_905_subpopulation_starting_rt
@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator Author

@dylanhmorris changes made - more unit tests added.

Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>

@dylanhmorris dylanhmorris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dylanhmorris
dylanhmorris enabled auto-merge (squash) October 21, 2026 20:13
@dylanhmorris
dylanhmorris disabled auto-merge October 21, 2026 20:22
@dylanhmorris
dylanhmorris merged commit e16093b into main Oct 21, 2026
8 checks passed
@dylanhmorris
dylanhmorris deleted the mem_905_subpopulation_starting_rt branch October 21, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants