Skip to content

Bump minimum numpyro to >=0.21.0 and remove epsilon padding for zero-mean Poisson/NegBinomial#806

Merged
damonbayer merged 4 commits into
mainfrom
copilot/bump-minimum-numpyro-version
May 4, 2026
Merged

Bump minimum numpyro to >=0.21.0 and remove epsilon padding for zero-mean Poisson/NegBinomial#806
damonbayer merged 4 commits into
mainfrom
copilot/bump-minimum-numpyro-version

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

NumPyro >=0.21.0 natively supports zero-mean Poisson and Negative Binomial distributions, eliminating the need for the 1e-10 epsilon workaround previously required to avoid numerical instability.

Changes

  • pyproject.toml: Bumps numpyro>=0.19.0numpyro>=0.21.0
  • pyrenew/observation/noise.py: Removes _EPSILON = 1e-10 constant; PoissonNoise and NegativeBinomialNoise now pass predicted directly to their distributions
  • pyrenew/observation/negativebinomial.py: Removes eps parameter from NegativeBinomialObservation.__init__; sample passes mu directly
  • pyrenew/datasets/datagen_he_CA_126.py: Removes mu = np.maximum(mu, 1e-10) clamp in sample_negbinom; updates docstring to reflect non-negative (rather than strictly positive) mu

Before:

# noise.py
_EPSILON = 1e-10
dist.Poisson(rate=predicted + _EPSILON)
dist.NegativeBinomial2(mean=predicted + _EPSILON, concentration=concentration)

# negativebinomial.py
NegativeBinomialObservation(name, concentration_rv, eps=1e-10)
dist.NegativeBinomial2(mean=mu + self.eps, concentration=concentration)

After:

dist.Poisson(rate=predicted)
dist.NegativeBinomial2(mean=predicted, concentration=concentration)

NegativeBinomialObservation(name, concentration_rv)
dist.NegativeBinomial2(mean=mu, concentration=concentration)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…inom means

Agent-Logs-Url: https://github.com/CDCgov/PyRenew/sessions/e3b47174-bb21-451e-ae53-e2cc86e16c62

Co-authored-by: dylanhmorris <8032117+dylanhmorris@users.noreply.github.com>
Copilot AI changed the title [WIP] Bump minimum numpyro version to >= 0.21.0 and remove tiny float padding Bump minimum numpyro to >=0.21.0 and remove epsilon padding for zero-mean Poisson/NegBinomial May 4, 2026
Copilot AI requested a review from dylanhmorris May 4, 2026 13:48
@dylanhmorris dylanhmorris marked this pull request as ready for review May 4, 2026 13:50
@dylanhmorris
Copy link
Copy Markdown
Collaborator

@cdc-mitzimorris and/or @damonbayer I think this can be merged pending your review.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Thank you for your contribution @damonbayer 🚀! Your github-pages is ready for download 👉 here 👈!
(The artifact expires on 2026-05-11T15:15:18Z. You can re-generate it by re-running the workflow here.)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.49%. Comparing base (f829dcc) to head (2314c81).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #806      +/-   ##
==========================================
- Coverage   98.49%   98.49%   -0.01%     
==========================================
  Files          51       51              
  Lines        1866     1863       -3     
==========================================
- Hits         1838     1835       -3     
  Misses         28       28              
Flag Coverage Δ
unittests 98.49% <ø> (-0.01%) ⬇️

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.

Copy link
Copy Markdown
Collaborator

@damonbayer damonbayer left a comment

Choose a reason for hiding this comment

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

@copilot update the uv.lock.

@dylanhmorris
Copy link
Copy Markdown
Collaborator

@copilot update uv.lock.

Agent-Logs-Url: https://github.com/CDCgov/PyRenew/sessions/71113a48-a462-4eb4-a218-268e56df0dcd

Co-authored-by: dylanhmorris <8032117+dylanhmorris@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 4, 2026

@copilot update the uv.lock.

Done — updated uv.lock in commit 4ae4326 (numpyro v0.20.1v0.21.0).

@copilot update uv.lock.

Done — updated uv.lock in commit 4ae4326 (numpyro v0.20.1v0.21.0).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • releases.astral.sh
    • Triggering command: /home/REDACTED/.local/bin/uv uv lock (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from dylanhmorris May 4, 2026 14:58
@damonbayer
Copy link
Copy Markdown
Collaborator

I just bumped everything in uv lock while we're here, so we can close a bunch of other PRs.

@damonbayer damonbayer self-requested a review May 4, 2026 15:17
@damonbayer damonbayer merged commit b8be39c into main May 4, 2026
8 checks passed
@damonbayer damonbayer deleted the copilot/bump-minimum-numpyro-version branch May 4, 2026 15:17
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.

Bump minimum numpyro version to >= 0.21.0 and remove all tiny float padding for zero Poisson and Negative Binomial means

3 participants