Repository navigation
Conversation
For truncated distributions, `cdf` returned values below 0 or above 1 outside the truncation range. It now returns 0 below the lower and 1 at or above the upper truncation limit. `ppf` of truncated distributions now returns NaN for quantiles outside [0, 1], consistent with the untruncated case. `pdf`, `cdf` and `ppf` of truncated distributions now also accept lists. Fixes PEtab-dev#602. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
fix_truncated_cdf
branch
from
November 17, 2026 20:59
8844049 to
d6f4652
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #608 +/- ##
==========================================
+ Coverage 80.03% 80.11% +0.08%
==========================================
Files 70 70
Lines 8419 8424 +5
Branches 1541 1541
==========================================
+ Hits 6738 6749 +11
+ Misses 1189 1183 -6
Partials 492 492 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Depending on truncation and log-transformation, these methods returned either NumPy scalars or 0-d arrays for scalar input. They now consistently return NumPy scalars for scalar input and arrays for array-like input, matching the type annotations and scipy. Lists are now accepted for all distributions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For truncated distributions, `pdf(nan)` returned 0, because NaN failed the truncation range check. It now returns NaN, as for untruncated distributions and scipy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
For truncated distributions,
Distribution.cdfreturned values below 0 or above 1 outside the truncation range. It now returns 0 below the lower and 1 at or above the upper truncation limit (also fixescdf(trunc_high)being1 - 1e-16).Additionally:
ppfreturns NaN for quantiles outside [0, 1], as in the untruncated case (previously returned finite values outside the truncation range).pdf,cdfandppfnow consistently return NumPy scalars for scalar input and arrays for array-like input, matching the type annotations and scipy. Previously, depending on truncation and log-transformation, scalar input sometimes produced 0-d arrays.pdf,cdfandppfaccept lists for all distributions.pdf(nan)returns NaN instead of 0, as for untruncated distributions and scipy.Fixes #602.
🤖 Generated with Claude Code