Keep scCODA and tascCODA working under numpyro 0.22 - #1104
Merged
Merged
Conversation
numpyro 0.22 turns distribution validation on by default. scCODA replaces zero counts with a pseudocount of 0.5, so `counts` and the derived `n_total` fall outside the discrete DirichletMultinomial support: sampling now raises and NUTS initialization fails with "Cannot find valid initial parameters". The log-prob itself is well defined for fractional counts, so the likelihood site opts out of validation, and the prior predictive rounds the number of trials, which is the only well-defined choice when actually drawing counts. Verified against numpyro 0.22.0 in the pertpy conda env: all 11 tests in tests/tools/_coda pass, where run_nuts and make_arviz failed before.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1104 +/- ##
==========================================
+ Coverage 79.94% 79.96% +0.02%
==========================================
Files 55 55
Lines 7533 7533
==========================================
+ Hits 6022 6024 +2
+ Misses 1511 1509 -2
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
numpyro 0.22 enables distribution validation by default, which rejects the fractional counts scCODA creates with its 0.5 pseudocount and makes
run_nuts()fail with "Cannot find valid initial parameters".The count likelihood now opts out of validation, since its log-prob is well defined for fractional counts, and the prior predictive rounds the number of trials.