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

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.

< 8000 span data-view-component="true">

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
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