summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests
Commit message (Collapse)AuthorAgeFilesLines
* TST: Add tests for check_fit with deg specified as listJonathan Underwood2016-01-181-0/+9
|
* TST: Add tests for hermefit with deg specified as listJonathan Underwood2016-01-181-0/+31
|
* TST: Add tests for polyfit with deg specified as listJonathan Underwood2016-01-181-0/+27
|
* TST: Add tests for lagfit with deg specified as listJonathan Underwood2016-01-181-0/+16
|
* TST: Add tests for hermfit with deg specified as listJonathan Underwood2016-01-181-0/+31
|
* TST: Add tests for chebfit with deg specified as listJonathan Underwood2016-01-181-0/+31
|
* TST: Add tests for legfit with deg specified as listJonathan Underwood2016-01-181-0/+31
|
* MAINT: Fix blemishes in numpy/polynomial/tests revealed by pyflakes.Charles Harris2014-07-296-13/+31
|
* STY: PEP8 fixes for numpy/polynomial/tests/*.py.Charles Harris2014-07-296-49/+49
| | | | Made conformant with the standards of scipy.
* TST: Add tests for the polynomial classes true division.Charles Harris2014-05-031-22/+54
|
* STY: Make numpy/polynomial/tests/*.py PEP8 compliant.Charles Harris2013-09-039-523/+504
| | | | Run autopep8 on the tests and fixup the results.
* STY: Giant comma spacing fixup.Charles Harris2013-08-189-246/+246
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* BUG: Fix failure to return monic polynomials from roots.Charles Harris2013-07-021-1/+3
| | | | | | | | | | | | | | | | 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.
* BUG: Campanion Matrix was scalar, not matrix for degree 1.Charles Harris2013-06-206-0/+95
| | | | | | | | The companion matrices returned by the various polynomial types was a scalar in the degree one case instead of a 2-D array. Fix that and add a test to check for that result. Closes #3459.
* 2to3: Apply `print` fixer.Charles Harris2013-04-069-9/+9
| | | | | | | 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-289-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-276-18/+18
| | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 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.
* TST: Add Test for column scaling in the polynomial package fits.Charles Harris2013-01-236-0/+25
| | | | | | The test uses the complex set of sample points [1, 1j, -1, -1j] whose squared sum is exactly zero. This would fail before the column scaling was fixed.
* Remove maskna API from ndarray, and all (and only) the code supporting itNathaniel J. Smith2012-06-166-180/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original masked-NA-NEP branch contained a large number of changes in addition to the core NA support. For example: - ufunc.__call__ support for where= argument - nditer support for arbitrary masks (in support of where=) - ufunc.reduce support for simultaneous reduction over multiple axes - a new "array assignment API" - ndarray.diagonal() returning a view in all cases - bug-fixes in __array_priority__ handling - datetime test changes etc. There's no consensus yet on what should be done with the maskna-related part of this branch, but the rest is generally useful and uncontroversial, so the goal of this branch is to identify exactly which code changes are involved in maskna support. The basic strategy used to create this patch was: - Remove the new masking-related fields from ndarray, so no arrays are masked - Go through and remove all the code that this makes dead/inaccessible/irrelevant, in a largely mechanical fashion. So for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that whole block was obviously just dead code if no arrays have masks, and I removed it. Likewise for function arguments like skipna that are useless if there aren't any NAs to skip. This changed the signature of a number of functions that were newly exposed in the numpy public API. I've removed all such functions from the public API, since releasing them with the NA-less signature in 1.7 would create pointless compatibility hassles later if and when we add back the NA-related functionality. Most such functions are removed by this commit; the exception is PyArray_ReduceWrapper, which requires more extensive surgery, and will be handled in followup commits. I also removed the new ndarray.setasflat method. Reason: a comment noted that the only reason this was added was to allow easier testing of one branch of PyArray_CopyAsFlat. That branch is now the main branch, so that isn't an issue. Nonetheless this function is arguably useful, so perhaps it should have remained, but I judged that since numpy's API is already hairier than we would like, it's not a good idea to add extra hair "just in case". (Also AFAICT the test for this method in test_maskna was actually incorrect, as noted here: https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py so I'm not confident that it ever worked in master, though I haven't had a chance to follow-up on this.) I also removed numpy.count_reduce_items, since without skipna it became trivial. I believe that these are the only exceptions to the "remove dead code" strategy.
* TST: Remove docstring from test_class_methods.Charles Harris2012-01-091-17/+1
| | | | And don't use the 'exec' statement to write the tests.
* ENH: Modify test classes to produce more informative test messages.Charles Harris2012-01-091-1/+19
| | | | | | The tests were all generator based and that produced the same message for all the tests when they were run in verbose mode. The quick fix was to use the generator to write named test functions for all the tests.
* TST: Add tests for NA support in the polynomial fitting functions.Charles Harris2012-01-096-0/+175
|
* TST: Add tests for mismatched types, domains, and windows.Charles Harris2012-01-091-0/+39
| | | | | Test that those combinations raise ValueError for the arithmetic operations of the convenience classes.
* TST: Finish moving class tests into test_classes.Charles Harris2012-01-097-750/+448
| | | | | | | There are currently errors that will be fixed if pull #178 goes in. The tests were also changed to use generators, which makes them run noticeably slower but give better error messages and makes the tests a bit cleaner.
* TST: Move more tests into numpy/polynomial/tests/test_classes.pyCharles Harris2012-01-097-429/+245
|
* TST: Add tests for basis and cast static class methods.Charles Harris2012-01-097-377/+202
| | | | | | | A new test file, test_classes, has been added so that conversions between all the class types can be tested. Several tests common to all the classes were also moved to this file. Ideally all the common tests will be moved, but that isn't done yet.
* TST: Add tests for Gauss quadrature and weight functions.Charles Harris2012-01-095-106/+254
|
* BUG: Fix test that was in wrong spot.Charles Harris2012-01-091-4/+4
|
* ENH: Add companion matrix functions.Charles Harris2012-01-091-1/+1
| | | | | | | | | The new companion matrices are related to the old by a similarity transformation that makes them better conditioned for root finding. In particular, the companion matrices for the orthogonal polynomials are symmetric when the zeros of a single polynomial term is wanted. This produces better zeros for use in Gauss quadrature.
* TST: Add tests for multidimensional coefficient array functionality.Charles Harris2012-01-096-395/+1163
| | | | | Test the multi-dimensional coefficient array functionality. Reorganize and cleanup some previous tests.
* BUG: The derivative tests were using incorrect test coefficients.Charles Harris2012-01-096-18/+18
| | | | The coefficients used were [1] + [0]*i instead of [0]*i + [1].
* ENH: Add some tests for polynomial printing.Charles Harris2011-07-161-0/+81
|
* ENH: Change test_trimdeg to test_cutdeg to match method name.Charles Harris2011-03-132-2/+3
|
* BUG: Fix wrong target values. Change Hermite_e to HermiteE, renameCharles Harris2011-03-131-30/+30
| | | | test_trimdeg to test_cutdeg to match method name.
* ENH: Rename test_trimdeg to test_cutdeg to match method and add ability toCharles Harris2011-03-133-3/+15
| | | | run as script.
* ENH: First commit of hermite and laguerre polynomials. The documentation andCharles Harris2011-03-033-0/+1602
| | | | tests still need fixes.
* ENH: Add support for Legendre polynomials.Charles Harris2010-08-172-2/+535
|
* Merge branch 'poly'Charles Harris2010-08-161-13/+13
|
* Merge branch 'poly'Charles Harris2010-08-151-0/+33
|
* ENH: Add {cheb,poly}mulx functions as use them to simplify some code.Charles Harris2010-08-152-0/+16
| | | | Fix some documentation.
* BUG: Fix integration of zero polynomials.Charles Harris2010-08-152-4/+12
| | | | | | Remove checks that prevent use of foreign scalar types for lower bounds and integration constants. Cleanup code a bit.
* BUG: Make mapdomain work for multidimensional arrays as advertized inCharles Harris2010-08-111-1/+17
| | | | the documentation. Fixes ticket #1554.
* Merge branch 'wgt'Charles Harris2010-07-182-18/+76
|
* CHG: Rename reduce method in polytemplate to cutdeg. Reduce is just tooCharles Harris2010-06-072-14/+14
| | | | much like a ufunc and a bit vague.
* CHG: Use [] instead of 'default' to specify the default domain inCharles Harris2010-05-232-4/+6
| | | | Chebyshev.fit and Polynomial.fit. Document the change from numpy 1.4.x.
* ENH: Add reduce method to polynomial.Chebyshev andCharles Harris2010-05-232-0/+16
| | | | | | 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-232-8/+8
| | | | | 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-212-0/+12
| | | | | | | | | 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: Add test for the degree method added to the ChebyshevCharles Harris2010-05-211-0/+3
|