Skip to content

Conversation

@cdc-mitzimorris
Copy link
Collaborator

This PR adds work that was done in https://github.com/cdcent/cfa-pyrenew-hierarchical/pull/4 to PyRenew.

It adds the base observation process class, concrete implementations for Count processes and the abstract base class for Measurement processes, together with unit tests and two new tutorials for count and measurement observation processes respectively.

Once this PR and the work done in https://github.com/cdcent/cfa-pyrenew-hierarchical/pull/5 have been added to PyRenew, subsequent PRs will deprecate unused features and harmonize the documentation and tutorials.

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 98.86364% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.32%. Comparing base (02446c5) to head (9306edc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pyrenew/observation/count_observations.py 96.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
+ Coverage   96.98%   97.32%   +0.33%     
==========================================
  Files          42       47       +5     
  Lines        1094     1270     +176     
==========================================
+ Hits         1061     1236     +175     
- Misses         33       34       +1     
Flag Coverage Δ
unittests 97.32% <98.86%> (+0.33%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

Thank you for your contribution @cdc-mitzimorris 🚀! Your github-pages is ready for download 👉 here 👈!
(The artifact expires on 2026-01-16T02:44:46Z. You can re-generate it by re-running the workflow here.)

Copy link
Collaborator

@dylanhmorris dylanhmorris left a comment

Choose a reason for hiding this comment

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

Thanks @cdc-mitzimorris! A high-level suggested changes before re-review

  • Change "expected" --> "predicted" throughout, as nothing in the design requires or enforces that the prediction be the expected value, though in many concrete cases it is, and that's desirable.
  • Throughout, avoid custom names for the observed quantity, if any, to the sample() call. Instead use obs, for API mirroring of numpyro.sample().
  • Revise the measurements tutorial to be stricter about what is specific to the wastewater example and what is general to delay-ascertained measurements.
  • Remove the provided helper classes for sampling priors (i.e. pyrenew/randomvariable/hierarchical.py from this PR. That will keep it more narrowly focused on observation processes.

RE: the helper classes for sampling priors: I am open to the possibility that we could want those helper classes in Pyrenew, but as I mention in my line-by-line comments, I think it requires a broader rethink of how we do distributional variables, etc. Would also appreciate thoughts from @damonbayer on that point.

cdc-mitzimorris and others added 16 commits January 6, 2026 22:07
…randomvariable/hierarchical.py), per reviewer comments
@cdc-mitzimorris
Copy link
Collaborator Author

ready for re-review - high-level concerns addressed:

  • changed expected to predicted
  • standardized calls to sample w/ arg obs
  • revised measurement observations tutorial
  • removed helper class for hierarchical models; use NumPyro's TruncatedNormalDistribution directly.

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.

4 participants