Repository navigation
Add support for np.min and np.max to handle scalar inputs #10408 - #10435
Merged
Merged
Conversation
swap357
requested changes
Feb 14, 2026
swap357
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the PR, @davidmartinez-esc !
I've reviewed it and left some comments below
swap357
reviewed
Feb 18, 2026
swap357
left a comment
Contributor
There was a problem hiding this comment.
one duplication to address, rest looks very good now
swap357
approved these changes
Feb 19, 2026
swap357
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Thank you for your contributions to numba, @davidmartinez-esc much appreciated.
Contributor
Author
|
Thanks for your guidance in this process and your feedback :D Have a nice day :) |
7 of 17 tasks
mitre88
added a commit
to mitre88/numba
that referenced
this pull request
Mar 4, 2026
Previously, np.var and np.std would fail with a TypingError when called with scalar inputs. This adds scalar handling following the same pattern used in np.mean (PR numba#10428) and np.min/np.max (PR numba#10435). For scalars, variance and standard deviation are always 0.0 (consistent with NumPy behavior). Integer and boolean scalars return np.float64(0.0), float scalars preserve their type, and complex scalars return np.float64(0.0). Partially addresses numba#10408 Co-Authored-By: Claude Opus 4.6 <[email protected]>
2 tasks
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.
Added support for the np.min and np.max for scalar inputs.
I implemented the case for two functions mainly because their dual nature.
Have a nice day.
#10408