summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | ENH: allow numpy.apply_along_axis() to work with ndarray subclasses (#7918)Ben Rowland2016-10-111-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modifies the numpy.apply_along_axis() function so that if it is called with an ndarray subclass, the internal func1d calls receive subclass instances and the overall function returns an instance of the subclass. There are two new tests for these two behaviours.
* | | | MAINT: fix assert_raises_regex when used as a context managerStephan Hoyer2016-09-261-1/+6
|/ / / | | | | | | | | | | | | Formerly, I got DeprecationWarnings about callable being None when I tested on Python 3.
* | | BUG: lib: Simplify (and fix) pad's handling of the pad_widthWarren Weckesser2016-09-171-0/+18
| |/ |/| | | | | | | | | | | | | Simplify the expansion of the pad_width argument by using `broadcast_to()`. This fixes the problem reported in gh-7808, where, for example, `pad_width=((1, 2),)` resulted in an error. Closes gh-7808.
* | TST: Use ComplexWarning suppression only where neededSebastian Berg2016-09-021-2/+6
| |
* | TST: Replace catch_warnings when recording is not enforced in test_nanfuncsSebastian Berg2016-09-021-10/+10
| |
* | TST: Use new warnings context manager in all testsSebastian Berg2016-09-022-35/+27
| | | | | | | | | | | | | | | | In some places, just remove aparently unnecessary filters. After this, all cases of ignore filters should be removed from the tests, making testing (even multiple runs) normally fully predictable.
* | ENH: Remove warning ignoring from nanfuncsSebastian Berg2016-09-022-31/+33
| | | | | | | | | | | | Comment mentions a speedup, but it seems unsure why it should be there. Instead use an error state in divide_by_count. Some extra complex warnings had to be ignored (but those seemed correct)
* | Merge pull request #7936 from goerz/sparse-type-checkStephan Hoyer2016-08-171-0/+35
|\ \ | | | | | | ENH: improve duck typing inside iscomplexobj
| * | ENH: improve duck typing inside iscomplexobjMichael Goerz2016-08-151-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both `iscomplexobj` and `isrealobj` now try to refer to the argument's `dtype` attribute if it exists. This significantly extends the list of types for which `iscomplexobj` returns correct results (including e.g. scipy sparse matrices and pandas objects). Extended the tests of the `iscomplexobj` routine for the following cases: * simple scalars * standard lists (test internal auto-conversion to numpy arrays) * "Duck typing" for objects that define a dtype attribute (either referring to one of the existing numpy dtypes, or a custom dtype, as pandas does) This fixes #7924
* | | ENH: skip or avoid gc/objectmodel differences btwn pypy and cpythonmattip2016-08-152-2/+5
|/ /
* | Merge pull request #7347 from erensezener/generalized_rot90Charles Harris2016-06-222-45/+77
|\ \ | | | | | | ENH Generalized rot90
| * | MAINT: fix indentation and whitespaces of the flip functionEren Sezener2016-03-201-12/+7
| | |
| * | ENH: generalize rot90 with axes kwarg, move to function_base.py, and add testsDenis Alevi2016-03-202-33/+70
| | |
* | | TST: Test that polyfit raises if not enough data for cov estimate.Charles Harris2016-06-151-1/+7
| | | | | | | | | | | | Also a slight refactoring of np.polyfit.
* | | Merge pull request #4073 from endolith/patch-2Charles Harris2016-06-151-1/+25
|\ \ \ | | | | | | | | BUG: change real output checking to test if all imaginary parts are zero
| * | | TST: Set seed for deterministic random testEndolith2015-03-081-103/+6
| | | | | | | | | | | | | | | | also fixed some PEP8 issues
| * | | TST: Fix missing imports, undeterministic testendolith2015-01-251-2/+101
| | | | | | | | | | | | | | | | Change to a deterministic test instead of using rand
| * | | TST: Add tests for np.poly()endolith2015-01-251-0/+22
| | | |
* | | | BUG: fix handling of right edge of final bin.Robert Kern2016-05-251-0/+5
| | | |
* | | | TST: Failing test for histogram.Robert Kern2016-05-241-0/+11
| | | |
* | | | TST: mark two tests in numpy.lib as slow, speeds up numpy.lib tests by 5xRalf Gommers2016-05-162-2/+3
| | | |
* | | | TST: fix test error due to use of deprecated np.testing.rand utility.Ralf Gommers2016-05-161-4/+4
| | | |
* | | | TST: fix test error when saving large array with savez.Ralf Gommers2016-05-161-2/+9
| | | |
* | | | TST: fix test errors for Pathlib usage tests in io.py.Ralf Gommers2016-05-151-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pathlib was only added to the stdlib in Python 3.4, and there it can handle string type input for a file with UTF8 encoding. But the Patlib version on PyPi that can be installed for Python 2.7 doesn't accept strings, gives errors like: ====================================================================== ERROR: test_ndfromtxt (test_io.TestPathUsage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/rgommers/Code/numpy/numpy/testing/decorators.py", line 147, in skipper_func return f(*args, **kwargs) File "/home/rgommers/Code/numpy/numpy/lib/tests/test_io.py", line 1888, in test_ndfromtxt f.write('1 2\n3 4') TypeError: must be unicode, not str
* | | | ENH: linear interpolation of complex values in lib.interpPeter Creasey2016-05-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | lib.interp function now allows interpolation of complex fp with complex128 precision (i.e. equivalent to lib.interp on the real and imaginary parts). Tests are added for the non-periodic and periodic cases.
* | | | Merge pull request #7618 from ahaldane/gradient_docstringCharles Harris2016-05-111-0/+3
|\ \ \ \ | | | | | | | | | | BUG: distance arg of np.gradient must be scalar, fix docstring
| * | | | BUG: distance arg of np.gradient must be scalar, fix docstringAllan Haldane2016-05-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixups to docstring, and disallow non-scalars as the distance args to np.gradient. Fixes #7548, fixes #6847
* | | | | BUG: Cast size to int64 when loading from archivedrasmuss2016-05-091-0/+14
|/ / / / | | | | | | | | | | | | | | | | Prevents overflow errors for large arrays on systems where the default int type is int32.
* | | | ENH: Add support for pathlib.Path objects to save/load functionsWendell Smith2016-04-061-1/+101
| | | |
* | | | Merge pull request #7421 from pwolfram/nancumsumprodStephan Hoyer2016-03-261-1/+106
|\ \ \ \ | | | | | | | | | | ENH: adds np.nancumsum and np.nancumprod
| * | | | ENH: adds np.nancumsum and np.nancumprodPhillip J. Wolfram2016-03-241-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR adds an implementation of `nancumsum` and `nancumprod`. The actual function is a two-liner adapted from `nansum`. Its structure is adapted from PR: https://github.com/numpy/numpy/pull/5418/
* | | | | TST: check reference counts of dtypes after calling bincountJaime Fernandez2016-03-211-4/+19
| | | | |
* | | | | Merge pull request #7341 from inesw/bug-fix-6469Charles Harris2016-03-171-0/+6
|\ \ \ \ \ | | | | | | | | | | | | TST: Add test for #6469
| * | | | | TST: test for #6469Ines Wichert2016-02-291-0/+6
| | | | | |
* | | | | | BUG: Ongoing fixes to PR#7416Joseph Fox-Rabinovitz2016-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed superfluous `ceil` call in automated bin width estimator. Updated tests to reflect modified estimator.
* | | | | | BUG: Incorrect handling of range in `histogram` with automatic bins.Joseph Fox-Rabinovitz2016-03-161-12/+12
| |/ / / / |/| | | | | | | | | | | | | | | | | | | Fixes #7411. Tests and documentation updated. Fixes other small issues with range and bin count computations.
* | | | | BUG: Fix string copying for np.placegfyoung2016-03-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug in string copying in np.place in which replacements strings that were smaller than their replaced elements would only partially replace the element instead of the entire element. Closes gh-6974. Addendum: this commit also appears to have fixed issue with overflow for very large input arrays. Closes gh-7207.
* | | | | Merge pull request #7414 from charris/tweak-corrcoefCharles Harris2016-03-141-3/+12
|\ \ \ \ \ | | | | | | | | | | | | Tweak corrcoef
| * | | | | TST: Check that result of corrcoef are clipped.Charles Harris2016-03-131-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't actually test much, as we don't have any inputs where that was not already the case. But at least it is there and perhaps a fuzz test can be added at a later date.
* | | | | | Merge pull request #7346 from erensezener/generalized_flipCharles Harris2016-03-121-0/+83
|\ \ \ \ \ \ | |/ / / / / |/| | | / / | | |_|/ / | |/| | | Generalized flip
| * | | | ENH: Add generalized flip function and its testsEren Sezener2016-03-121-0/+83
| |/ / /
* | | | MAINT: cleanup np.averageAllan Haldane2016-03-071-0/+23
| | | |
* | | | Merge pull request #7366 from gkBCCN/bug-fix-6542-reloadedCharles Harris2016-03-021-1/+28
|\ \ \ \ | | | | | | | | | | TST: fix #6542, add tests to check non-iterable argument raises in hstack and related functions.
| * | | | TST: Fix #6542: Add tests for non-iterable input...gkBCCN2016-02-291-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...to hstack, vstack, stack, hsplit, vsplit, dsplit, dstack that check that they raise exceptions.
* | | | | BUG: np.irr should return NaN if there are no real solutionsSimon Gibbons2016-02-291-1/+6
|/ / / /
* | | | TST: added a test for constant padding on 4 sides of a 2d arraychiffa2016-02-271-0/+13
|/ / / | | | | | | | | | This test exposes padding bug described in the issue #7353
* | | TST: Fixed shuffle axis in tests.Joseph Fox-Rabinovitz2016-02-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Since shuffle only works along the first dimension, it must be done before reshape to get reasonable looking data. Did not affect the current tests. I noticed while working on some scipy code. Also, made a couple of doc changes to np.random.shuffle.
* | | BUG: Preserve array order in np.deletegfyoung2016-02-191-0/+10
| | | | | | | | | | | | Closes gh-7113.
* | | BUG: Make returned unravel_index arrays writeablegfyoung2016-02-181-0/+6
| | | | | | | | | | | | Closes gh-7269.
* | | ENH: Adding support to the range keyword for estimation of the optimal ↵Varun Nayyar2016-02-131-0/+31
| | | | | | | | | | | | number of bins and associated tests