Repository navigation
Reject improper Uniform and LogUniform distributions - #604
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #604 +/- ##
==========================================
+ Coverage 79.87% 79.93% +0.06%
==========================================
Files 70 70
Lines 8356 8362 +6
Branches 1516 1519 +3
==========================================
+ Hits 6674 6684 +10
+ Misses 1191 1188 -3
+ Partials 491 490 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dweindl
force-pushed
the
distributions_validate_uniform
branch
from
November 17, 2026 10:11
11ac1aa to
3883ca9
Compare
dweindl
marked this pull request as ready for review
November 17, 2026 11:17
dilpath
approved these changes
Nov 17, 2026
`Uniform` accepted any limits, e.g., `Uniform(0, inf)`, whose pdf is 0, whose cdf is nan, and which fails only when sampled, with numpy's `OverflowError: Range exceeds valid bounds`. `Uniform` now requires finite limits with `low < high` (on the scale of the underlying uniform distribution), and `LogUniform` requires `0 < low < high < inf`. In `petab.v1`, this affects start point sampling for parameters with infinite bounds or with `lowerBound=0` and log-scaled `parameterScaleUniform` priors. These already failed during sampling; they now fail when the `Prior` is created. Estimated parameters with `lowerBound == upperBound` and no prior can no longer be sampled. In `petab.v2`, `Parameter.prior_dist` reports the original prior parameters and bounds if a `uniform` prior does not overlap the parameter bounds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
distributions_validate_uniform
branch
from
November 17, 2026 14:06
3883ca9 to
81653cd
Compare
dweindl
enabled auto-merge
November 17, 2026 14:08
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.
petab.v1.distributions.Uniformaccepted any limits. E.g.,Uniform(0, inf)has pdf 0 and cdf nan, and fails only when sampled, with numpy'sOverflowError: Range exceeds valid bounds.Uniformnow requires finite limits withlow < high(on the scale of the underlying uniform distribution), andLogUniformrequires0 < low < high < inf. Both raise aValueErrorotherwise.Affected
petab.v1use: start point sampling for parameters with infinite bounds, or withlowerBound=0and a log-scaled defaultparameterScaleUniforminitialization prior. These already failed during sampling; they now fail when thePrioris created.low == highis also rejected, so an estimated parameter withlowerBound == upperBoundand no prior can no longer be sampled (v1 and v2). None of the problems in the PEtab benchmark collection are affected.In
petab.v2, invaliduniform/log-uniformpriors are still reported byCheckPriorDistribution, now with a clearer hint. If auniformprior range does not overlap the parameter bounds, the error names the prior parameters and bounds instead of the clipped limits.🤖 Generated with Claude Code