Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Restore MaskedArray.hardmask documentation #20810

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 4 commits into from
Jan 18, 2022

Conversation

hmeine
Copy link
Contributor

@hmeine hmeine commented Jan 13, 2022

Fix #19331 by properly documenting the purpose of MaskedArray.hardmask

This documentation got completely lost when switching to :autoattribute: 
in 2f41bb2; all remaining documentation 
made circular references to other aspects of hard vs. soft, without any 
explanation of what this means.
The API is a little unusual here; IMO a more pythonic behavior would've
been not to return self, because self is already modified (cf.
`ndarray.sort()`, for instance).  But at least I wanted to make this
behavior a little more clear in the documentation.
@hmeine hmeine changed the title Hardmask docs Restore MaskedArray.hardmask documentation Jan 13, 2022
@hmeine
Copy link
Contributor Author

hmeine commented Jan 13, 2022

(I just force-pushed an update fixing lines that were a single character too long.)

@melissawm
Copy link
Member

Thanks @hmeine ! Would it be too much trouble to add an example, showing unmasking by assignment in the soft case and a hard mask preventing that? Other than that, LGTM :)

@hmeine
Copy link
Contributor Author

hmeine commented Jan 14, 2022

Yes, I had already prepared one, anyhow, and just had to find out how to properly include it in the docstring.

In fact, I still don't know how to make the linter happy; wouldn't the doctests fail if I manually wrapped the output from the python interpreter (line 3616)?

@charris charris changed the title Restore MaskedArray.hardmask documentation DOC: Restore MaskedArray.hardmask documentation Jan 15, 2022
@charris charris added the component: numpy.ma masked arrays label Jan 15, 2022
@melissawm
Copy link
Member

This looks good, thanks @hmeine !

@melissawm melissawm merged commit 643677a into numpy:main Jan 18, 2022
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.

Mask hardness is not well defined
3 participants