summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polytemplate.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Remove the polytemplate.py file.Charles Harris2014-05-061-927/+0
|
* MAINT: Comparison deprecation followup fixesSebastian Berg2014-05-041-2/+2
| | | | | | | Makes the identity check `a = np.array([np.nan], dtype=object)` `a == a`, etc. a deprecation/futurewarning instead of just changing it. Also fixes some smaller things.
* DEP: Deprecate that comparisons ignore errors.Sebastian Berg2014-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | This means that for example broadcasting errors get raised. The array_equiv function is changed to explicitely test if broadcasting is possible. It may be nice to do this test differently, but I am not sure if that is possible. Create a FutureWarning for comparisons to None, which should result in areal elementwise (object) comparisons. Slightly adepted a wrong test. Poly changes: Some changes in the polycode was necessary, the one is probably a bug fix, the other needs to be thought over, since len check is not perfect maybe, since it is more liekly to raise raise an error. Closes gh-3759 and gh-1608
* BUG: Fix __truediv__ bug in polytemplate.py file.Charles Harris2014-05-031-17/+10
| | | | | The use of polytemplate is deprecated, this fix is only for a backport if needed.
* DEP: Deprecate the numpy/polnomial/polytemplate.py module.Charles Harris2014-03-261-0/+6
| | | | Make the version of its removal Numpy 1.10.0.
* BUG: Set __hash__ = None for non-hashable classes.Charles Harris2013-08-281-0/+2
| | | | | | | | | | Because neither poly1d nor the Polynomial package polynomial classes are immutable, hence not reliably hashable, they should signal that by setting __hash__ = None. This also fixes the warning Overriding __eq__ blocks inheritance of __hash__ in 3.x that is given when the command `python2.7 -3 -c"import numpy"` is run.
* BUG: Fix failure to return monic polynomials from roots.Charles Harris2013-07-021-2/+12
| | | | | | | | | | | | | | | | This bug affected the various polynomial class methods fromroots due to the ability to specify both window and domain. In that circumstance the roots are mapped from the domain to the window by the substitution `x = off + scl*x`. The polynomial that was being generated was monic in the window before substitution, but if scl was not one it was not monic considered as a function of the variable x in the domain. The fix is to divide the generated coefficients by `scl ** deg` so that the scaling of the highest degree term after substitution is canceled. It might be better to make the scaling optional in the future, but this fix makes the result match the documentation. Closes #3467.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-2/+2
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* SPELL: Spellcheck the modules. Clarify an example.Charles Harris2012-01-091-1/+1
|
* ENH: Add support for NA to the least squares fitting routines.Charles Harris2012-01-091-2/+3
|
* BUG: The polynomial convenience classes let different types interact.Charles Harris2012-01-091-39/+60
| | | | | | | | | In particular for arithmetic where one could end up with a Polynomial type with Chebyshev coefficients after an addition. It is unlikely that that would be done on purpose. The PolyDomain error message was also replaced by a TypeError with an appropriate message. That seems like a better choice.
* HACK: Make __array_priority__ = 1000.Charles Harris2012-01-091-2/+3
| | | | | | | | | | | This works around changes in the treatment of __array_priority__ that were part of commit 32b32c2. Previously the rop's of the right hand object were called whenever it had the __array_priority__ attribute and was not an ndarray or derived thereof. After the change the object needed to have greater priority, in this case > 0. It isn't clear that the new behavior is the correct one and if it is reverted then setting __array_priority__ back to 0 will provide a test for that decision.
* ENH: Add static methods basis and cast to the polynomial classes.Charles Harris2012-01-091-9/+80
| | | | | | | | | The new basis method is a convenient way to return an instance of the basis function of given degree for the class. It is intended mostly for pedagogical purposes. The new cast method provides an alternate way to convert an instance of one polynomial class to another. It complements the convert instance method.
* BUG: Fix regression in printing polynomials.Charles Harris2011-07-161-6/+4
|
* ENH: Add the polynomial module to the documentation.Charles Harris2011-06-201-11/+29
| | | | | | | | | | | Also: 1. Note that the polynomial package is preferred over poly1d. 2. Remove deprecation of mapparms in __init__.py as it interferes with the documention of the method of the same name. This is probably safe as it is unlikely to be used yet. 3. Make some improvements to the documentation in polytemplate.
* ENH: A window attribute in polytemplate. This is helpful in defining theCharles Harris2011-03-131-129/+250
| | | | | | mappings for the Hermite and Laguerre polynomials where the domains have infinite bounds. The window allows one to specify the interval that the domain maps to instead of using the default domain as was done before.
* DOC: fix some formatting errors in polynomial docs.rgommers2011-03-031-26/+26
|
* Merge branch 'poly'Charles Harris2010-08-171-3/+3
|
* Merge branch 'poly'Charles Harris2010-08-151-2/+2
| | | | | | Conflicts: numpy/polynomial/chebyshev.py numpy/polynomial/polynomial.py
* Merge branch 'wgt'Charles Harris2010-07-181-36/+70
|
* CHG: Rename reduce method in polytemplate to cutdeg. Reduce is just tooCharles Harris2010-06-071-2/+2
| | | | much like a ufunc and a bit vague.
* CHG: Use [] instead of 'default' to specify the default domain inCharles Harris2010-05-231-4/+5
| | | | Chebyshev.fit and Polynomial.fit. Document the change from numpy 1.4.x.
* ENH: Add reduce method to polynomial.Chebyshev andCharles Harris2010-05-231-1/+34
| | | | | | polynomial.Polynomial. This method behaves like truncate except it takes the degree of the result instead of the number of coefficients.
* REV: Revert the changes to the truncate method of Polynomial and Chebyshev.Charles Harris2010-05-231-19/+18
| | | | | On second thought it was a bad idea to make such a radical change to existing behaviour. It was also hard to document the variations ;)
* CHG: Change the default domain for the fit class method of theCharles Harris2010-05-211-4/+7
| | | | | | | | | Chebyshev and Polynomial classes to None. Add 'default' as a possible value of the domain argument to specify the default domain. This change fits better with my experience with this method. I feel it is safe to make this change at this late date because the functions seem little used as yet and I would like to get them 'right' before folks catch on to their presence.
* ENH: Change deriv and integ method documentation of the Chebyshev andCharles Harris2010-05-211-6/+4
| | | | Polynomial classes to reflect the enhanced behaviour of the base functions.
* CHG: Change the truncate method of the Chebyshev and Polynomial classesCharles Harris2010-05-211-12/+14
| | | | | | to take degree instead of length. This seems to fit better with normal usage. I feel this change is safe at this time because these new classes seem to be little used as yet.
* ENH: Add degree method to the Chebyshev and Polynomial classes.Charles Harris2010-05-211-0/+4
|
* ENH: Make Chebyshev and Polynomial classes dominate ndarrays.Charles Harris2010-03-081-0/+3
|
* BUG: Fix bug in lbnd implementation of the integ method of the Chebyshev andCharles Harris2010-02-271-4/+4
| | | | Polynomial classes.
* more docstring updates from pydoc website (thanks to everyone who contributed!)Jarrod Millman2010-02-171-1/+9
|
* 3K: polynomial: Python3 friendlier templatePauli Virtanen2009-12-061-2/+8
|
* More fixes to least squares method documentation in Polynomial andCharles Harris2009-11-151-6/+6
| | | | Chebyshev.
* Improve documention of the fit method of the Cheybshev and PolynomialCharles Harris2009-11-151-2/+43
| | | | classes.
* Add support for chebyshev series and polynomials.Charles Harris2009-11-141-0/+556
New modules chebyshev and polynomial are added. The new polynomial module is not compatible with the current polynomial support in numpy, but is much like the new chebyshev module. The most noticeable difference to most will be that coefficients are specified from low to high power, that the low level functions do *not* accept the Chebyshev and Polynomial classes as arguements, and that the Chebyshev and Polynomial classes include a domain. Mapping between domains is a linear substitution and the two classes can be converted one to the other, allowing, for instance, a Chebyshev series in one domain to be expanded as a polynomial in another domain. The new modules are not automatically imported into the numpy namespace, they must be explicitly brought in with a "import numpy.polynomial" statement.