Repository navigation
BF: Exclude complex infinities from finite_range - #1588
Merged
Merged
Conversation
effigies
approved these changes
Nov 7, 2026
effigies
left a comment
Member
There was a problem hiding this comment.
This looks like a straightforward fix, thanks.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1588 +/- ##
==========================================
- Coverage 95.49% 95.49% -0.01%
==========================================
Files 209 209
Lines 30123 30123
Branches 5201 5201
==========================================
- Hits 28766 28765 -1
Misses 928 928
- Partials 429 430 +1 ☔ View full report in Codecov by Harness. 🚀 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.
finite_rangeexplicitly supports complex arrays, but its fast path tests extrema against real +/- infinity. A complex value such asinf+1jis unequal to real infinity, so it is incorrectly accepted as finite. An infinite imaginary component can leak into the reported range in the same way.Use
isfinitefor both extrema before taking the fast path. Extend the existing parameterized range tests with positive/negative real infinities, an infinite imaginary component and an all-nonfinite complex array; the existing checks exercise both return signatures and flattened inputs.Validation: the four new cases fail on the original implementation while 21 finite-range controls pass. After the fix, the scaling, arraywriter and volumeutils test modules pass (106 passed, 68 numeric cast/overflow warnings in existing tests). Ruff lint and formatting checks and git diff --check pass. Python 3.12.14 and NumPy 2.5.4. The full package suite was not run.