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

DEP: Proposal to deprecate the msort convenience function #22456

Merged
merged 5 commits into from Oct 20, 2022

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented Oct 20, 2022

This is a proposal to deprecate the msort function, which is currently exposed in the main numpy namespace. The function is a convenience function for performing a sort along the 0-th axis:

b = array(a, subok=True, copy=True)
b.sort(0)
return b

which can be accomplished more idiomatically with np.sort(a, axis=0).

Re: impact assessment per NEP 23 - I have grepped through other major scientific Python libraries (scipy, matplotlib, scikit-image, scikit-learn, networkx) and there were no instances of msort being used. msort is found in astropy in the units subpackage in a listing of subclass-safe functions imported from numpy; though it does not appear to actually be used within astropy and should be straightforward to remove.

Copy link
Member

@mattip mattip left a comment

Choose a reason for hiding this comment

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

one small nit about formatting the warning, otherwise LGTM

rossbar and others added 2 commits October 20, 2022 10:53
Add date to deprecation in comment

Co-authored-by: Matti Picus <matti.picus@gmail.com>
@mattip mattip merged commit df92d35 into numpy:main Oct 20, 2022
@mattip
Copy link
Member

mattip commented Oct 20, 2022

Thanks @rossbar

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.

None yet

2 participants