diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-08-04 16:45:12 -0600 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-08-04 16:45:12 -0600 |
commit | 1596415c32f6008fcacc14a3a5394787aeb44265 (patch) | |
tree | d360fa51313280b81326828b933d8927d292529e /numpy/polynomial/polyutils.py | |
parent | 3b91f476fbbecbd111f10efd0aae1df8eed5d667 (diff) | |
parent | b3e3567544dc2b41e1bcc89157b977cf12ef2efb (diff) | |
download | numpy-1596415c32f6008fcacc14a3a5394787aeb44265.tar.gz |
Merge branch 'main' into array-api
Diffstat (limited to 'numpy/polynomial/polyutils.py')
-rw-r--r-- | numpy/polynomial/polyutils.py | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py index d81ee9754..3b0f0a9e5 100644 --- a/numpy/polynomial/polyutils.py +++ b/numpy/polynomial/polyutils.py @@ -4,15 +4,6 @@ Utility classes and functions for the polynomial modules. 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 --------------- @@ -21,14 +12,6 @@ Warning objects 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 --------- @@ -50,8 +33,8 @@ import warnings 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 @@ -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 # @@ -509,7 +463,7 @@ def _fromroots(line_f, mul_f, roots): The ``<type>line`` function, such as ``polyline`` mul_f : function(array_like, array_like) -> ndarray The ``<type>mul`` function, such as ``polymul`` - roots : + roots See the ``<type>fromroots`` functions for more detail """ if len(roots) == 0: @@ -537,7 +491,7 @@ def _valnd(val_f, c, *args): ---------- val_f : function(array_like, array_like, tensor: bool) -> array_like The ``<type>val`` function, such as ``polyval`` - c, args : + c, args See the ``<type>val<n>d`` functions for more detail """ args = [np.asanyarray(a) for a in args] @@ -567,7 +521,7 @@ def _gridnd(val_f, c, *args): ---------- val_f : function(array_like, array_like, tensor: bool) -> array_like The ``<type>val`` function, such as ``polyval`` - c, args : + c, args See the ``<type>grid<n>d`` functions for more detail """ for xi in args: @@ -586,7 +540,7 @@ def _div(mul_f, c1, c2): ---------- mul_f : function(array_like, array_like) -> array_like The ``<type>mul`` function, such as ``polymul`` - c1, c2 : + c1, c2 See the ``<type>div`` functions for more detail """ # c1, c2 are trimmed copies @@ -646,7 +600,7 @@ def _fit(vander_f, x, y, deg, rcond=None, full=False, w=None): ---------- vander_f : function(array_like, int) -> ndarray The 1d vander function, such as ``polyvander`` - c1, c2 : + c1, c2 See the ``<type>fit`` functions for more detail """ x = np.asarray(x) + 0.0 @@ -732,12 +686,12 @@ def _pow(mul_f, c, pow, maxpower): Parameters ---------- - vander_f : function(array_like, int) -> ndarray - The 1d vander function, such as ``polyvander`` - pow, maxpower : - See the ``<type>pow`` functions for more detail mul_f : function(array_like, array_like) -> ndarray The ``<type>mul`` function, such as ``polymul`` + c : array_like + 1-D array of array of series coefficients + pow, maxpower + See the ``<type>pow`` functions for more detail """ # c is a trimmed copy [c] = as_series([c]) |