summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9524 from charris/add_init_to_test_directoriesCharles Harris2017-08-121-0/+0
|\ | | | | TST, MAINT: Add `__init__.py` files to tests directories.
| * TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-0/+0
| | | | | | | | | | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* | MAINT: Use moveaxis instead of rollaxis internally (#9475)Nico Schlömer2017-08-101-2/+2
|/ | | | | Also add a hint to the documentation advising the use of moveaxis over rollaxis. Tests for rollaxis are left alone.
* Merge pull request #9522 from eric-wieser/stop-using-obj2sctypeCharles Harris2017-08-061-1/+7
|\ | | | | BUG: Fix problems with obj2sctype
| * BUG: Don't allow an array to be passed as the dtype argumentEric Wieser2017-08-061-1/+7
| |
* | Merge pull request #9505 from eric-wieser/fix-issubdtypeCharles Harris2017-08-063-6/+6
|\ \ | |/ |/| BUG: issubdtype is inconsistent on types and dtypes
| * MAINT: Stop using the undocumented coercion-then-downcast feature of subdtypeEric Wieser2017-08-053-6/+6
| |
* | MAINT: Remove `level=` keyword from test arguments.Charles Harris2017-08-052-19/+17
|/ | | | | | I don't know what that argument was used for, but it showis up in old tests and is not explicitly used within the tests. I assume it was part of an old testing framework and is now longer needed.
* MAINT/DOC: Use builtin when np.{x} is builtins.{x}.Eric Wieser2017-08-055-36/+36
| | | | | | | This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
* MAINT: Changed diff to use iterative instead of recursive approachJoseph Fox-Rabinovitz2017-07-311-0/+53
| | | | | | | | | | | | | TST: Added tests for `n` parameter Added test for `datetime64` type change Added tests for axis normalization Added test for subtype handling DOC: Minor updates to docs: Added explanation for `n==0` Added documentation describing `datetime64` handling Updated formatting Added call to normalize_axis_index
* Merge pull request #9434 from charris/remove-unittest-dependenciesCharles Harris2017-07-2417-328/+327
|\ | | | | Remove unittest dependencies
| * TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-2417-328/+327
| |
* | BUG: float16 is promoted to float64 by gradientEric Wieser2017-07-131-0/+6
|/ | | | This isn't the case for `diff`
* Merge pull request #9362 from charris/rearrange-testing-moduleCharles Harris2017-07-062-4/+2
|\ | | | | ENH: Rearrange testing module to isolate nose dependency.
| * MAINT: Rearrange files in numpy/testing module.Charles Harris2017-07-042-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that.
* | TST: join_by now works for dtypes with padding tooEric Wieser2017-07-011-0/+16
| | | | | | | | Once again, thanks to not using .descr
* | TST: Add failing test for mismatch of key typeEric Wieser2017-07-011-1/+16
| |
* | BUG: stack_arrays fails for subdtypesEric Wieser2017-07-011-0/+29
| | | | | | | | Again, fixed by not using descr
* | BUG: recfunctions.join_by fails when key is a subdtypeEric Wieser2017-07-011-0/+14
| | | | | | | | | | | | | | | | | | It seems that working with .descr is a generally terrible idea. Instead we introduce `get_fieldspec`, which returns a list of 2-tuples, encapsulating subdtypes. This also means that np.core.test_rational.rational survives a roundtrip - its .descr is 'V8', which ddoesn't survive
* | BUG: recfunctions.join_by fails for colliding values with different dtypesEric Wieser2017-07-011-0/+13
|/ | | | Fixes #9338
* TST: Verify that join_by doesn't choke on subdtypesEric Wieser2017-06-271-0/+10
|
* BUG: Switched to xor for bool arrays in diff, added corresponding testsEgor Panfilov2017-06-171-1/+11
|
* BUG: KeyboardInterrupt is swallowed all over the placeEric Wieser2017-06-033-5/+5
| | | | Bare except is very rarely the right thing
* BUG: have as_strided() keep custom dtypesAntoine Pitrou2017-05-241-0/+8
| | | | Fixes issue #9161
* BUG: set default type for empty index array to `numpy.intp` (#9142)Konrad Kapp2017-05-201-0/+10
| | | | Fixes #9137
* DEP: Deprecate incorrect behavior of expand_dims.Charles Harris2017-05-171-1/+22
| | | | | | | | | | | Expand_dims works as documented when the index of the inserted NewAxis in the resulting array satisfies -a.ndim - 1 <= index <= a.ndim. However, when index > a.ndim index is replaced by a.ndim and, when index < -a.ndim - 1, it is replaced by index + a.ndim + 1, which may be negative and results in incorrect placement. The latter two cases are now deprecated. Closes #9100.
* Merge pull request #9070 from ahaldane/silence_join_byEric Wieser2017-05-101-1/+14
|\ | | | | BUG: Preserve field order in join_by, avoids FutureWarning
| * BUG: Preserve field order in join_by, avoids FutureWarningAllan Haldane2017-05-091-1/+14
| | | | | | | | Fixes #8940
* | ENH: Spelling fixesVille Skyttä2017-05-092-3/+3
|/
* ENH: add divmod support to NDArrayOperatorsMixinStephan Hoyer2017-05-071-37/+55
|
* BUG: np.r_['r',...] crashes on scalarsEric Wieser2017-05-051-0/+5
|
* BUG: np.r_['rc'] is treated as np.r_['r'], not an errorEric Wieser2017-05-051-0/+2
|
* TST: Add some tests for passing r and c to r_Eric Wieser2017-05-051-0/+13
|
* BUG: Remove mutable state from AxisConcatenatorEric Wieser2017-05-051-0/+11
| | | | Fixes #8815
* ENH: Add isin, genereralizing in1d to ND arrays (#8423)B R S Recht2017-05-051-1/+41
| | | | | | This fixes gh-8331 Also update the docs for arraysetops to remove the outdated "1D" from the description, which was already incorrect for np.unique.
* ENH: add __pos__ to NDArrayOperatorsMixinStephan Hoyer2017-04-301-1/+1
|
* Merge pull request #9013 from eric-wieser/fix-nanfuncsCharles Harris2017-04-281-0/+12
|\ | | | | BUG: Fix np.lib.nanfunctions on object arrays
| * BUG: Fix incorrect behavior of nanfunctions on object arraysEric Wieser2017-04-291-0/+12
| | | | | | | | Fixes gh-8974 and gh-9008
* | Merge pull request #8996 from eric-wieser/fix-ufunclikeMarten van Kerkwijk2017-04-271-1/+33
|\ \ | |/ |/| BUG/DEP: Make ufunclike functions more ufunc-like
| * BUG: Return scalars from ufunclike objectsEric Wieser2017-04-261-0/+25
| | | | | | | | | | | | No need to reinvent the wheel here - the ufunc machinery will handle the out arguments Fixes #8993
| * DEP: Deprecate calling the `out` argument `y`Eric Wieser2017-04-261-1/+8
| | | | | | | | Fixes gh-8995
* | ENH: NDArrayOperatorsMixin calls ufuncs directly, like ndarrayStephan Hoyer2017-04-271-10/+7
| | | | | | | | | | | | | | | | | | * ENH: NDArrayOperatorsMixin calls ufuncs directly, like ndarray Per our discussion in https://github.com/numpy/numpy/pull/8247#discussion_r112825050 * add back in accidentally dropped __repr__
* | BUG: Fix ArrayLike(NDArrayOperatorsMixin) operations with object()Stephan Hoyer2017-04-271-6/+20
| |
* | ENH: Add NDArrayOperatorsMixin mixin class.Stephan Hoyer2017-04-271-0/+189
|/ | | | | | This mixin class provides an easy way to implement arithmetic operators that defer to __array_ufunc__ like numpy.ndarray in non-ndarray subclasses.
* Merge pull request #6632 from mcmtroffaes/feature/fromfile-ioopen-bugCharles Harris2017-04-141-2/+3
|\ | | | | TST/BUG: fromfile - fix test and expose bug with io class argument
| * BUG: npy_PyFile_Dup2 - fix PyFile_AsFile failing on io style classesMatthias C. M. Troffaes2016-09-081-2/+3
| | | | | | | | | | | | | | | | | | | | This bug only manifests itself in the Python 2 code path. Falls back to the current Python 3 code path also on Python 2 because the Python 3 code path is written precisely to handle this situation. Also fix tests, and clarify in the documentation that the current implementation requires the stream to be seekable.
* | Merge pull request #8643 from eric-wieser/fix-8642Eric Wieser2017-04-111-0/+15
|\ \ | | | | | | BUG: Fix double-wrapping of object scalars
| * | BUG: Fix double-wrapping of object scalarsEric Wieser2017-04-061-0/+15
| | | | | | | | | | | | Fixes #8642
* | | MAINT: Use _validate_axis inside _ureduceEric Wieser2017-03-282-16/+19
| | | | | | | | | | | | This fixes an omission where duplicate axes would only be detected when positive
* | | MAINT: Reuse _validate_axis in np.gradientEric Wieser2017-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | This also means that its axis argument invokes operator.index like others do. _validate_axis currently accepts lists of axes, which is a bug.