Skip to content

Commit

Permalink
Merge pull request #18963 from hollycorbett/polybase_deprecated_removal
Browse files Browse the repository at this point in the history
DEP: remove PolyBase from np.polynomial.polyutils
  • Loading branch information
charris committed May 11, 2021
2 parents ae317fd + 2adb6bc commit 74a65e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 53 deletions.
8 changes: 8 additions & 0 deletions doc/release/upcoming_changes/18963.expired.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Remove deprecated ``PolyBase`` and unused ``PolyError`` and ``PolyDomainError``
-------------------------------------------------------------------------------

The class ``PolyBase`` has been removed (deprecated in numpy 1.9.0). Please use
the abstract ``ABCPolyBase`` class instead.

Furthermore, the unused ``PolyError`` and ``PolyDomainError`` exceptions are
removed from the `numpy.polynomial`.
50 changes: 2 additions & 48 deletions numpy/polynomial/polyutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
.. autosummary::
:toctree: generated/
PolyError base class for this sub-package's errors.
PolyDomainError raised when domains are mismatched.
Warning objects
---------------
Expand All @@ -21,14 +12,6 @@
RankWarning raised in least-squares fit for rank-deficient matrix.
Base class
----------
.. autosummary::
:toctree: generated/
PolyBase Obsolete base class for the polynomial classes. Do not use.
Functions
---------
Expand All @@ -50,8 +33,8 @@
import numpy as np

__all__ = [
'RankWarning', 'PolyError', 'PolyDomainError', 'as_series', 'trimseq',
'trimcoef', 'getdomain', 'mapdomain', 'mapparms', 'PolyBase']
'RankWarning', 'as_series', 'trimseq',
'trimcoef', 'getdomain', 'mapdomain', 'mapparms']

#
# Warnings and Exceptions
Expand All @@ -61,35 +44,6 @@ class RankWarning(UserWarning):
"""Issued by chebfit when the design matrix is rank deficient."""
pass

class PolyError(Exception):
"""Base class for errors in this module."""
pass

class PolyDomainError(PolyError):
"""Issued by the generic Poly class when two domains don't match.
This is raised when an binary operation is passed Poly objects with
different domains.
"""
pass

#
# Base class for all polynomial types
#

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

#
# Helper functions to convert inputs to 1-D arrays
#
Expand Down
5 changes: 0 additions & 5 deletions numpy/polynomial/polyutils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ from typing import List
__all__: List[str]

class RankWarning(UserWarning): ...
class PolyError(Exception): ...
class PolyDomainError(PolyError): ...

# NOTE: Deprecated
# class PolyBase: ...

def trimseq(seq): ...
def as_series(alist, trim=...): ...
Expand Down

0 comments on commit 74a65e1

Please sign in to comment.