Skip to content
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

DOC: Clarify docstring of masked_equal and masked_values #22436

Merged
merged 3 commits into from Nov 21, 2022

Conversation

cmarmo
Copy link
Contributor

@cmarmo cmarmo commented Oct 13, 2022

This pull request clarifies the documentation of the functions masked_equal and masked_values.
It is supposed to fix #5408.

With respect to the issue description, the example of masked_equal was already modified to be consistent with the implementation.

  • I have made explicit the behavior of fill_value for masked_equal
  • I have added an example in masked_values to clarify its difference with respect to masked_equal (as the homogenization of the fill_value implementation made this difference less explicit, ...in my opinion,... :) )

Thanks for considering this PR.

numpy/ma/core.py Outdated
@@ -2085,6 +2085,8 @@ def masked_equal(x, value, copy=True):
`condition` = (x == value). For floating point arrays,
consider using ``masked_values(x, value)``.

The fill_value is set to `value`.
Copy link
Member

@charris charris Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isolated paragraph/sentence doesn't make sense. Could you try rewriting the whole thing together with the previous paragraph?

Copy link
Contributor Author

@cmarmo cmarmo Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope it is more explicit now.

@cmarmo
Copy link
Contributor Author

cmarmo commented Nov 20, 2022

Hello, this is supposed to fix a very old issue... I'm a closember fan... :)
Thanks for your attention. ❤️

numpy/ma/core.py Outdated Show resolved Hide resolved
@seberg
Copy link
Member

seberg commented Nov 21, 2022

OK, doc test was successful and it LGTM now. Thanks.

@seberg seberg merged commit f92c90c into numpy:main Nov 21, 2022
34 of 42 checks passed
@cmarmo cmarmo deleted the doc-masked-equal branch Nov 21, 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.

inconsistency in masked_equal method docs and implementation
3 participants