8000 DOC: add note for clip() special case a_min > a_max See #18782 by xamm · Pull Request #18786 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: add note for clip() special case a_min > a_max See #18782 #18786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 21, 2021
Merged

DOC: add note for clip() special case a_min > a_max See #18782 #18786

merged 5 commits into from
Apr 21, 2021

Conversation

xamm
Copy link
Contributor
@xamm xamm commented Apr 16, 2021

This PR changes the documentation of numpy.clip() to include an example and a note for the special case of a_min greater than a_max. Which is discussed in #18782.

xamm added 2 commits April 16, 2021 11:45
documentation changes are usually not added to release notes
from keyword to positional as suggested by reviewer
numpy/core/fromnumeric.py Outdated Show resolved Hide resolved
Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
@xamm
Copy link
Contributor Author
xamm commented Apr 19, 2021

As a follow up question should there be a regression test for this behavior of clip()?

Like:

def test_clip_special_case(self):
        arr = [-1, 5, 2, 3, 10, -4, -9]
        out = np.clip(arr, 8, 1)
        tgt = [1, 1, 1, 1, 1, 1, 1]
        assert_equal(out, tgt)

@charris charris merged commit f048051 into numpy:main Apr 21, 2021
@charris
Copy link
Member
charris commented Apr 21, 2021

Thanks @xamm .

@xamm xamm deleted the clip-doc-add-note branch April 22, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0