From 85813a9a2eb163582cb518f0fe5d632b662ad0c7 Mon Sep 17 00:00:00 2001 From: rgommers Date: Thu, 3 Mar 2011 14:04:50 +0800 Subject: DOC: fix some formatting errors in polynomial docs. --- numpy/polynomial/chebyshev.py | 8 +++---- numpy/polynomial/legendre.py | 15 ++++-------- numpy/polynomial/polytemplate.py | 52 ++++++++++++++++++++-------------------- 3 files changed, 35 insertions(+), 40 deletions(-) (limited to 'numpy') diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py index ea064a695..5fb28ea07 100644 --- a/numpy/polynomial/chebyshev.py +++ b/numpy/polynomial/chebyshev.py @@ -1344,12 +1344,12 @@ def chebpts1(npts): Parameters ---------- - npts: int + npts : int Number of sample points desired. Returns ------- - pts: ndarray + pts : ndarray The Chebyshev points of the second kind. Notes @@ -1375,12 +1375,12 @@ def chebpts2(npts): Parameters ---------- - npts: int + npts : int Number of sample points desired. Returns ------- - pts: ndarray + pts : ndarray The Chebyshev points of the second kind. Notes diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py index f09f3dc17..3d7bbb521 100644 --- a/numpy/polynomial/legendre.py +++ b/numpy/polynomial/legendre.py @@ -65,8 +65,6 @@ legtrim = pu.trimcoef def poly2leg(pol) : """ - poly2leg(pol) - Convert a polynomial to a Legendre series. Convert an array representing the coefficients of a polynomial (relative @@ -463,7 +461,7 @@ def legmulx(cs): .. math:: - xP_i(x) = ((i + 1)*P_{i + 1}(x) + i*P_{i - 1}(x))/(2i + 1) + xP_i(x) = ((i + 1)*P_{i + 1}(x) + i*P_{i - 1}(x))/(2i + 1) """ # cs is a trimmed copy @@ -564,12 +562,12 @@ def legdiv(c1, c2): Parameters ---------- c1, c2 : array_like - 1-d arrays of Legendre series coefficients ordered from low to + 1-D arrays of Legendre series coefficients ordered from low to high. Returns ------- - [quo, rem] : ndarrays + quo, rem : ndarrays Of Legendre series coefficients representing the quotient and remainder. @@ -683,8 +681,8 @@ def legder(cs, m=1, scl=1) : Parameters ---------- - cs: array_like - 1-d array of Legendre series coefficients ordered from low to high. + cs : array_like + 1-D array of Legendre series coefficients ordered from low to high. m : int, optional Number of derivatives taken, must be non-negative. (Default: 1) scl : scalar, optional @@ -887,9 +885,6 @@ def legval(x, cs): -------- legfit - Examples - -------- - Notes ----- The evaluation uses Clenshaw recursion, aka synthetic division. diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py index 37f0018d0..2106ad84e 100644 --- a/numpy/polynomial/polytemplate.py +++ b/numpy/polynomial/polytemplate.py @@ -345,12 +345,12 @@ class $name(pu.PolyBase) : Parameters ---------- - domain : {None, array_like} - The domain of the new series type instance. If the value is is - ``None``, then the default domain of `kind` is used. - kind : {None, class} + 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. + 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 + should be converted. If kind is None, then the class of the current instance is used. Returns @@ -359,14 +359,14 @@ class $name(pu.PolyBase) : The returned class can be of different type than the current instance and/or have a different domain. - Examples - -------- - Notes ----- Conversion between domains and class types can result in numerically ill defined series. + Examples + -------- + """ if kind is None : kind = $name @@ -390,11 +390,11 @@ class $name(pu.PolyBase) : off, scl : floats or complex The mapping function is defined by ``off + scl*x``. - Notes: - ------ + Notes + ----- If the current domain is the interval ``[l_1, r_1]`` and the default interval is ``[l_2, r_2]``, then the linear mapping function ``L`` is - defined by the equations: + defined by the equations:: L(l_1) = l_2 L(r_1) = r_2 @@ -491,8 +491,8 @@ class $name(pu.PolyBase) : See Also -------- - `${nick}int` : similar function. - `${nick}der` : similar function for derivative. + ${nick}int : similar function. + ${nick}der : similar function for derivative. """ off, scl = self.mapparms() @@ -521,8 +521,8 @@ class $name(pu.PolyBase) : See Also -------- - `${nick}der` : similar function. - `${nick}int` : similar function for integration. + ${nick}der : similar function. + ${nick}int : similar function for integration. """ off, scl = self.mapparms() @@ -538,8 +538,8 @@ class $name(pu.PolyBase) : See Also -------- - `${nick}roots` : similar function - `${nick}fromroots` : function to go generate series from roots. + ${nick}roots : similar function + ${nick}fromroots : function to go generate series from roots. """ roots = ${nick}roots(self.coef) @@ -552,8 +552,8 @@ class $name(pu.PolyBase) : Here y is the value of the polynomial at the points x. This is intended as a plotting aid. - Paramters - --------- + Parameters + ---------- n : int, optional Number of point pairs to return. The default value is 100. @@ -577,9 +577,9 @@ class $name(pu.PolyBase) : """Least squares fit to data. Return a `$name` instance that is the least squares fit to the data - `y` sampled at `x`. Unlike ${nick}fit, the domain of the returned + `y` sampled at `x`. Unlike `${nick}fit`, the domain of the returned instance can be specified and this will often result in a superior - fit with less chance of ill conditioning. See ${nick}fit for full + fit with less chance of ill conditioning. See `${nick}fit` for full documentation of the implementation. Parameters @@ -591,7 +591,7 @@ class $name(pu.PolyBase) : points sharing the same x-coordinates can be fitted at once by passing in a 2D-array that contains one dataset per column. deg : int - Degree of the fitting polynomial + Degree of the fitting polynomial. domain : {None, [beg, end], []}, optional Domain to use for the returned $name instance. If ``None``, then a minimal domain that covers the points `x` is chosen. If @@ -671,14 +671,14 @@ class $name(pu.PolyBase) : If ``p`` is the returned $name object, then ``p(x) == x`` for all values of x. - Parameters: - ----------- + Parameters + ---------- domain : array_like The resulting array must be if the form ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of the domain. - Returns: - -------- + Returns + ------- identity : $name object """ -- cgit v1.2.1