-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
API: deprecate compat and selected lib utils #23830
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
Conversation
68a0d89
to
63b5edc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up @mtsokol! A few comments to tweak the approach.
a82a435
to
376b840
Compare
376b840
to
2f36ac5
Compare
Hi @rgommers,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, and is very close to mergeable - only two more comments.
b119f44
to
83636a6
Compare
83636a6
to
22d9ffb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now and all green, in it goes. Thanks again @mtsokol!
I'll squash-merged this so it's easy to backport to 1.26.x once that branch gets created. @charris I think this is the first PR that should end up in 1.26.0. Do you have a preference for how to set milestone/labels here to keep track of things for that release? |
It turns out My understanding is that NEP 52 aims at cleaning up the main namespace. I would have expected that I see a two main ways forward (there may be others):
As a side-comment, the list of undocumented functions in the main namespace from #12385 is from November 2018 and is not fully accurate, for example #13847 added documentation for other functions, like |
@lesteve it looks to me like I agree that this deprecation probably should have mentioned the suggested alternative. |
Adding the forward link: gh-24154 un-deprecates |
Hi @rgommers,
Here I share a WIP PR with a deprecation of a few positions mentioned in #23537 for the purpose of cleaning up main namespace API.
Here I deprecate
compat
module raising a warn on import, and deprecate some functions fromlib
(listed in #12385). Functions are deprecated in such way: When they are imported from the main namespace a warn is printed, when they are called an exception is raised, saying that these methods are expired and they can be used directly fromnumpy.lib
(the financial functions are deprecated this way).When these functions are imported directly from
numpy.lib
ornumpy.lib.utils
and called a warn is raised.