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

Remove deprecated PolyBase from np.polynomial.polyutils #15658

Closed
rossbar opened this issue Feb 27, 2020 · 6 comments
Closed

Remove deprecated PolyBase from np.polynomial.polyutils #15658

rossbar opened this issue Feb 27, 2020 · 6 comments
Labels
07 - Deprecation component: numpy.polynomial sprintable Issue fits the time-frame and setting of a sprint

Comments

@rossbar
Copy link
Contributor

rossbar commented Feb 27, 2020

np.polynomial.polyutils defines a PolyBase class that, according to the source, was deprecated back in v1.9.0:

class PolyBase:
"""
Base class for all polynomial types.
Deprecated in numpy 1.9.0, use the abstract
ABCPolyBase class instead. Note that the latter
requires a number of virtual functions to be
implemented.
"""
pass

I am wondering if it can be removed from the code base. v1.9 was quite some time ago, though I'm not sure this proposal is in line with whatever the official deprecation policy is. For what it's worth, PolyBase does not appear to be used within the numpy code base anymore, so the question is whether downstream libraries have had sufficient time (and notification) to remove PolyBase from their codebases.

@seberg
Copy link
Member

seberg commented Mar 5, 2020

Would be OK to try I think. We could also use the module __getattr__ to deprecate the name itself for now and wait until 3.7 is a required dependency. Its very slow, but probably not much of an issue, and I assume we need the module __getattr__ for other polynomial cleanup soon in any case.

@rossbar
Copy link
Contributor Author

rossbar commented Mar 10, 2020

The getattr idea is an interesting one. We'll see if there are other names in the polynomial/poly1d cleanup that could benefit from this.

@BvB93
Copy link
Member

BvB93 commented May 5, 2021

Another option would be to add a PolyBase.__init_subclass__ method that issues a warning upon subclassing.

@charris
Copy link
Member

charris commented May 5, 2021

to remove PolyBase from their codebases.

I thought it unlikely anyone was using it at the time, but played it safe. It can probably be removed without causing problems.

@mattip mattip added the sprintable Issue fits the time-frame and setting of a sprint label May 6, 2021
@hollycorbett
Copy link

I can pick up this one

hollycorbett pushed a commit to hollycorbett/numpy that referenced this issue May 10, 2021
Addresses issue numpy#15658 by removing PolyBase class.  Happy to submit alternative PR using getattr approach instead if desired.
@charris
Copy link
Member

charris commented Jun 14, 2022

Closing as completed.

@charris charris closed this as completed Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
07 - Deprecation component: numpy.polynomial sprintable Issue fits the time-frame and setting of a sprint
Projects
None yet
Development

No branches or pull requests

6 participants