DEP: deprecate np.round_; add round/min/max to the docs#23302
Merged
charris merged 3 commits intonumpy:mainfrom Mar 1, 2023
Merged
DEP: deprecate np.round_; add round/min/max to the docs#23302charris merged 3 commits intonumpy:mainfrom
np.round_; add round/min/max to the docs#23302charris merged 3 commits intonumpy:mainfrom
Conversation
30833dc to
8f6de14
Compare
The function is more commonly called `round`, both in the array API standard and in other array libraries (e.g., PyTorch has `round` but not around). Plus we have `ndarray.round`. `around` is heavily used, so keep it as an alias - but prefer `round`. For both this switch and for keeping the alias, xref numpygh-13877. Closes numpygh-19717
8f6de14 to
10743b0
Compare
charris
reviewed
Mar 1, 2023
| binwidth = len(binary) | ||
| outwidth = (binwidth if width is None | ||
| else max(binwidth, width)) | ||
| else builtins.max(binwidth, width)) |
Member
There was a problem hiding this comment.
Hope we haven't missed any of these.
Member
Author
There was a problem hiding this comment.
that's why we have tests I'd say:) more seriously, this is set up as spaghetti. numeric importing from fromnumeric, tweaking __module__, and then another special-case import in core/__init__.py for max makes it hard to untangle. maybe I'll really bite that bullet at some point.
Member
|
Thanks Ralf. |
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.
In addition to adding
np.round,np.minandnp.maxto the html docs, this PR makes those the preferred aliases - as discussed/agreed in gh-13877.Closes gh-22617
Closes gh-19717
Closes gh-13877