Skip to content

ENH: Add new numpy.ma.* aliases - #21998

Closed
bsipocz wants to merge 3 commits into
numpy:mainfrom
bsipocz:ma_add_aliases
Closed

bsipocz wants to merge 3 commits into
numpy:mainfrom
bsipocz:ma_add_aliases

Conversation

@bsipocz

@bsipocz bsipocz commented Jul 16, 2022

Copy link
Copy Markdown
Member

This is the stashed and rebased version of #17480 which contained some conflicting changes as #19899 has already added some of the aliases.

The first commit is purely the cleaned up previous PR, that is now closed, I'll follow-up with potentially necessary changes once CI has run.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess the main high-level question for me is: do we really want to expand the suite of ma creation functions? AFAIK the original motivation for this was actually fixing broken links in the docs, not users asking for masked versions of ones, zeros, etc. Broken doc links seems like a weak motivation for expanding the API footprint, especially in the ma package, which is notorious for subtle divergences from its ndarray counterparts. OTOH if these creation functions address actual use-cases or fulfill user needs, then 👍 .

@bsipocz

bsipocz commented Jul 20, 2022

Copy link
Copy Markdown
Member Author

@rossbar - I don't have a specific need for these, was doing issue and PR triage. If the decision is to not extend then we should go back and tell it to multiple PR authors, and close off issues, too so people know that there is a decision.

OTOH, a solution for broken links should be figured out, too, it's not OK to keep them around broken because the actual underlying code is not supposed to contain functionality that is linked to, but that is a separate, and maybe already fixed issue.

@rossbar

rossbar commented Jul 20, 2022

Copy link
Copy Markdown
Contributor

If the decision is to not extend then we should go back and tell it to multiple PR authors, and close off issues, too so people know that there is a decision.

Yeah I just want to make sure that the motivation for this particular case makes sense. I don't want to imply that we shouldn't add any new functions to np.ma. If it's just broken links in the docs in this case, it might be better just to switch the link targets to their non-ma counterparts. I'm not sure what the protocol is for adding ma versions of core functions... usually we encourage pinging the mailing list for API additions, but maybe not in this case? Thoughts @mattip @charris ?

OTOH, a solution for broken links should be figured out, too, it's not OK to keep them around broken because the actual underlying code is not supposed to contain functionality that is linked to, but that is a separate, and maybe already fixed issue.

Agreed, IIRC this is an unpleasant side-effect of the docstring munging in the _convert2ma class. There may be a documentation-specific solution involving modifying this class that might fix even more broken links in the ma docs.

@bsipocz

bsipocz commented Jul 20, 2022

Copy link
Copy Markdown
Member Author

My sole motivation was to wrap up almost ready PRs, e.g. #17480 which needed a rebase to pick up new CI and resolve conflicts, but otherwise was ready to go, based on the comments. Another similar one is #17500 which was separated out from #17480.

Note that I've already closed #17480 as it was conflicting, some of the aliases have been already been added, but basically, this one and #17500 have to go hand in hand, either close both as unwanted puppies/extensions of np.ma (absolutely valid decision) or merge them sometimes in the near future.

@bsipocz bsipocz added the triage review Issue/PR to be discussed at the next triage meeting label Jul 25, 2022
@mattip

mattip commented Jul 27, 2022

Copy link
Copy Markdown
Member

I am inclined to close this and not merge it until there is a clear use case for these functions. Is there anyone who is championing the additions and can point to their use-case for them?

@mattip mattip added 57 - Close? Issues which may be closable unless discussion continued and removed triage review Issue/PR to be discussed at the next triage meeting labels Jul 27, 2022
@InessaPawson

Copy link
Copy Markdown
Member

I am inclined to close this and not merge it until there is a clear use case for these functions. Is there anyone who is championing the additions and can point to their use-case for them?

@mattip Shall we ask on the mailing list?

@mattip

mattip commented Aug 8, 2022

Copy link
Copy Markdown
Member

I started a mailing list discussion

@mattip

mattip commented Aug 24, 2022

Copy link
Copy Markdown
Member

Thanks @bsipocz. The mailing list did not bring up any use cases, so let's close this and try to fix the documentation in a different way.

@mattip mattip closed this Aug 24, 2022
@bsipocz

bsipocz commented Aug 24, 2022

Copy link
Copy Markdown
Member Author

Thanks @mattip. I suppose then the same logic applies to #17500 and we should close that one, too.

@InessaPawson InessaPawson added triaged Issue/PR that was discussed in a triage meeting and removed 57 - Close? Issues which may be closable unless discussion continued labels Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

01 - Enhancement component: numpy.ma masked arrays triaged Issue/PR that was discussed in a triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants