summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | MAINT, ENH [#10736] Add interpolation methods to quantileabel2021-11-041-36/+141
| | | | | | | | | | | | | | | | | | | | - Added the missing linear interpolation methods. - Updated the existing unit tests. - Added pytest.mark.xfail for boolean arrays See - https://github.com/numpy/numpy/pull/19857#issuecomment-919258693 - https://github.com/numpy/numpy/issues/19154
* | ENH: Check that the lengths of the inputs to histogram2d are the same. (#20228)Jérome Eertmans2021-11-021-0/+10
| | | | | | | | | | | | | | Improves exception message when inputs have different shapes. Closes gh-20050 Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | Merge pull request #20071 from alessiamarcolini/refactorCharles Harris2021-10-224-7/+2
|\ \ | | | | | | MAINT: Remove unused imports and remove duplicated tests
| * | MAINT: remove unused importsAlessia Marcolini2021-10-084-7/+2
| |/
* | BUG: lib: Fix error raised by insert.warren2021-10-201-0/+5
|/ | | | | | | | | | | | | | | | | | When `insert` is given a single out-of-bounds index in a list, e.g. np.insert([0, 1, 2], [99], [3, 4]) # 99 is out of bounds a TypeError was being raised because of a bug in the formatting of the message. Before this change, the error is TypeError: %i format: a number is required, not list After, we get the expected IndexError: index [99] is out of bounds for axis 0 with size 3
* Merge pull request #20027 from BvB93/nanfuncCharles Harris2021-10-041-0/+151
|\ | | | | ENH: Add missing parameters to the `nan<x>` functions
| * TST: Add tests for the new `nan<x>` function parametersBas van Beek2021-10-041-0/+103
| |
| * TST: Add a test for comparing the signatures of `nan<x>` and `<x>` functionsBas van Beek2021-10-041-0/+48
| |
* | TST: Add more tests for `np.kaiser`Bas van Beek2021-09-301-0/+21
| |
* | BUG: Fix the `lib.function_base` window functions ignoring extended ↵Bas van Beek2021-09-301-13/+73
|/ | | | precision float dtypes
* MAINT: lib: Check that the dtype given to fromregex is structured.warren2021-09-221-0/+8
| | | | | | | | | | In fromregex, add a check that verifies that the given dtype is a structured datatype. This avoids confusing error messages that can occur when the given data type is not structured. Also tweaked the code in the Examples section. Closes gh-8891.
* BUG: ensure np.median does not drop subclass for NaN result.Marten van Kerkwijk2021-09-141-0/+10
| | | | | | | | Currently, np.median is almost completely safe for subclasses, except if the result is NaN. In that case, it assumes the result is a scalar and substitutes a NaN with the right dtype. This PR fixes that, since subclasses like astropy's Quantity generally use array scalars to preserve subclass information such as the unit.
* MAINT: Make parameters match label.Charles Harris2021-09-131-1/+1
|
* TST: Fix a couple of `pytest` id labelsBas van Beek2021-09-131-3/+3
| | | | Co-Authored-By: Charles Harris <charlesr.harris@gmail.com>
* TST: Expand/rewrite the `test_allnans` testsBas van Beek2021-09-111-79/+115
| | | | Parametrize w.r.t. the axis, array dimensionality and dtype
* TST: Expand `TestNanFunctions_NumberTypes` with 0d arraysBas van Beek2021-09-091-12/+17
|
* TST: Make nanfunc test ignore overflow instead of xfailing testSebastian Berg2021-09-071-3/+1
| | | | | | This makes the test more precise, and I ran into having to broaden the xfails otherwise, because right now reduce-likes incorrectly faile to give floating point warnings (and I was fixing that).
* TST: Add more tests for `nanmedian`, `nanquantile` and `nanpercentile`Bas van Beek2021-09-031-0/+17
|
* TST: Expand the old `TestNanFunctions_IntTypes` test with non-integer number ↵Bas van Beek2021-09-031-71/+52
| | | | types
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-3/+3
|
* MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-012-8/+7
|
* Merge pull request #19627 from ankitdwivedi23/ankitd/vectorize-ignore-whitespaceCharles Harris2021-08-161-0/+15
|\ | | | | BUG: Ignore whitespaces while parsing gufunc signatures
| * dummy change to kick off another buildAnkit Dwivedi2021-08-081-1/+1
| |
| * fix lint errorsAnkit Dwivedi2021-08-071-1/+2
| |
| * add tests to check if whitespaces are ignored in gufunc signaturesAnkit Dwivedi2021-08-071-0/+14
| |
* | ENH: Allow `np.fromregex` to accept `os.PathLike` implementationsBas van Beek2021-08-161-2/+4
|/
* Merge pull request #19615 from rossbar/rm-deprecated-npyio-fnsCharles Harris2021-08-061-22/+0
|\ | | | | MAINT: Proposal to expire three deprecated functions in numpy.lib.npyio
| * Rm numpy.lib.npyio.mafromtxt.Ross Barnowski2021-08-051-11/+0
| |
| * Rm numpy.lib.npyio.ndfromtxt.Ross Barnowski2021-08-051-11/+0
| |
* | Merge pull request #19612 from BvB93/testCharles Harris2021-08-061-1/+5
|\ \ | |/ |/| TST: Bump the python 3.10 test version from beta4 to rc1
| * TST: Skip `test_lookfor` in 3.10rc1Bas van Beek2021-08-061-1/+5
| | | | | | | | Broken in rc1 as of bpo-44524
* | PERF: Speed-up common case of loadtxt()ing non-hex floats. (#19598)Antony Lee2021-08-051-0/+22
|/ | | | | | | | | | | | | * PERF: Speed-up common case of loadtxt()ing non-hex floats. `python runtests.py --bench bench_io` reports a ~5-10% perf gain. * TST: Add tests to check fromhex not called unintentionally. Adds regression tests to check that the logic surrounding when the default floatconv applies the fromhex conversion does not change. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #19356 from mhvk/functionbase-vectorize-refactorSebastian Berg2021-07-061-1/+21
|\ | | | | API: Ensure np.vectorize outputs can be subclasses.
| * API: Ensure np.vectorize outputs can be subclasses.Marten van Kerkwijk2021-06-261-1/+21
| | | | | | | | | | | | | | As is, this is true for the ufunc case, but not for the gufunc case, even if the underlying function does produce a subclass. Given the care taken to ensure inputs are kept as subclasses, this is almost certainly an oversight, which is here corrected.
* | BUG: Do not raise deprecation warning for all nans in unique (#19301)Thomas J. Fan2021-06-291-0/+11
|/ | | | | This PR adjusts np.unique for the edge cases where all values are nan. Fixes gh-19300
* ENH: support major version larger than 9 in numpy.lib.NumpyVersionKenichi Maehashi2021-06-101-1/+1
|
* API: Delay string and number promotion deprecation/future warningSebastian Berg2021-06-041-2/+1
| | | | | | | | | | Unfortunately, this seems to cause some pain in pandas at least to circumvent the warning. Delaying may complicate the creation of ufuncs for strings, but otherwise should not be a big problem. We have to make sure that we can reimplement the change quickly though, it is an important change in my opinion.
* TST: Update the `poly1d.__getitem__` and `__eq__` testsBas van Beek2021-05-281-5/+26
|
* TST: Update the `np.nanmedian` tests for all-nan arraysBas van Beek2021-05-221-16/+34
| | | | Test multiple dtypes in the `test_allnans` + a minor refactor
* Merge pull request #16987 from scimax/masterCharles Harris2021-05-191-0/+18
|\ | | | | ENH: Phase unwrapping generalized to arbitrary interval size
| * Add missing whitespaceEric Wieser2020-09-141-0/+1
| |
| * Updated incorrect argument in tests. boundary correction for int and float.Max Kellermeier2020-08-211-5/+6
| | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * Update numpy/lib/tests/test_function_base.pyscimax2020-08-201-1/+1
| | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * Tests added according to #14877, obsolete comments removed.Max Kellermeier2020-08-021-1/+17
| |
* | BUG: Prevent nan being used in percentile (gh-18831)Kevin Sheppard2021-04-221-0/+22
| | | | | | | | | | Reject NaN as a percentile/quantile value. Previously NaNs could pass the range check `0 <= q <= 1`. closes #18830
* | review commentsDCtheTall2021-04-051-6/+13
| |
* | rm commentDCtheTall2021-03-311-1/+0
| |
* | Add tests np.meshgrid for higher dimensional grids.DCtheTall2021-03-311-0/+15
| |
* | MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-1/+1
| |
* | API: make piecewise subclass safe using use zeros_like.Marten van Kerkwijk2021-02-221-0/+8
| | | | | | | | | | | | Subclass input of piecewise was already respected, so it seems more logical to ensure the output is the same subclass (possibly just an oversight that it was not done before).