Skip to content

DEP: Proposal to deprecate the msort convenience function#22456

Merged
mattip merged 5 commits intonumpy:mainfrom
rossbar:deprecate-msort
Oct 20, 2022
Merged

DEP: Proposal to deprecate the msort convenience function#22456
mattip merged 5 commits intonumpy:mainfrom
rossbar:deprecate-msort

Conversation

@rossbar
Copy link
Copy Markdown
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
Copy Markdown
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 <[email protected]>
@mattip mattip merged commit df92d35 into numpy:main Oct 20, 2022
@mattip
Copy link
Copy Markdown
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.

2 participants