diff options
Diffstat (limited to 'numpy/polynomial')
-rw-r--r-- | numpy/polynomial/__init__.py | 11 | ||||
-rw-r--r-- | numpy/polynomial/polytemplate.py | 40 |
2 files changed, 36 insertions, 15 deletions
diff --git a/numpy/polynomial/__init__.py b/numpy/polynomial/__init__.py index 851bde109..48c679ce1 100644 --- a/numpy/polynomial/__init__.py +++ b/numpy/polynomial/__init__.py @@ -298,10 +298,13 @@ def getdomain(x) : from numpy.polynomial.polyutils import getdomain return getdomain(x) -@deprecate(message='Please import mapparms from numpy.polynomial.polyutils') -def mapparms(old, new) : - from numpy.polynomial.polyutils import mapparms - return mapparms(old, new) +# Just remove this function as it screws up the documentation of the same +# named class method. +# +#@deprecate(message='Please import mapparms from numpy.polynomial.polyutils') +#def mapparms(old, new) : +# from numpy.polynomial.polyutils import mapparms +# return mapparms(old, new) @deprecate(message='Please import mapdomain from numpy.polynomial.polyutils') def mapdomain(x, old, new) : diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py index 657b48508..3763123dc 100644 --- a/numpy/polynomial/polytemplate.py +++ b/numpy/polynomial/polytemplate.py @@ -25,6 +25,10 @@ import numpy as np class $name(pu.PolyBase) : """A $name series class. + $name instances provide the standard Python numerical methods '+', + '-', '*', '//', '%', 'divmod', '**', and '()' as well as the listed + methods. + Parameters ---------- coef : array_like @@ -60,10 +64,10 @@ class $name(pu.PolyBase) : Notes ----- - It is important to specify the domain for many uses of graded polynomial, - for instance in fitting data. This is because many of the important - properties of the polynomial basis only hold in a specified interval and - thus the data must be mapped into that domain in order to benefit. + It is important to specify the domain in many cases, for instance in + fitting data, because many of the important properties of the + polynomial basis only hold in a specified interval and consequently + the data must be mapped into that interval in order to benefit. Examples -------- @@ -408,13 +412,12 @@ class $name(pu.PolyBase) : def copy(self) : """Return a copy. - A new instance of $name is returned that has the same - coefficients and domain as the current instance. + Return a copy of the current $name instance. Returns ------- new_instance : $name - New instance of $name with the same coefficients and domain. + Copy of current instance. """ return self.__class__(self.coef, self.domain, self.window) @@ -514,12 +517,15 @@ class $name(pu.PolyBase) : Parameters ---------- domain : array_like, optional - The domain of the new series type instance. If the value is None, - then the default domain of `kind` is used. + The domain of the converted series. If the value is None, + the default domain of `kind` is used. kind : class, optional The polynomial series type class to which the current instance should be converted. If kind is None, then the class of the current instance is used. + window : array_like, optional + The window of the converted series. If the value is None, + the default window of `kind` is used. Returns ------- @@ -767,9 +773,21 @@ class $name(pu.PolyBase) : @staticmethod def fromroots(roots, domain=$domain, window=$domain) : - """Return $name object with specified roots. + """Return $name instance with specified roots. + + Returns an instance of $name representing the product + ``(x - r[0])*(x - r[1])*...*(x - r[n-1])``, where ``r`` is the + list of roots. - See ${nick}fromroots for full documentation. + Parameters + ---------- + roots : array_like + List of roots. + + Returns + ------- + object : $name + Series with the specified roots. See Also -------- |