summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #11573 from tylerjereddy/broadcast_arrays_kw_testMatti Picus2018-08-211-1/+13
|\ | | | | TST: add broadcast_arrays() kwarg unit test for TypeError
| * MAINT: Use raw strings for regexesEric Wieser2018-08-201-1/+1
| |
| * TST: add broadcast_arrays() kwarg unit test for TypeErrorTyler Reddy2018-08-011-1/+13
| | | | | | | | | | | | | | | | | | * broadcast_arrays() is now tested for the case when an invalid keyword argument is used; the appropriate error string content is also tested for * the TypeError message produced in the above case has been restored to the correct value in Python 3
* | MAINT: reformat line spacing before test methodsmattip2018-08-192-3/+0
| |
* | Merge pull request #11778 from eric-wieser/histogram-overflowCharles Harris2018-08-181-0/+14
|\ \ | | | | | | BUG: Avoid signed overflow in histogram
| * | BUG: Avoid signed overflow in histogramEric Wieser2018-08-181-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | When dividing the range between first and last, the formula `(x - first) / (last - first)` is used, where `last >= first` This falls apart if the types of these variables are signed integers, in which case overflow can occur. The solution is to force the subtraction result to be unsigned. This is a regression in 1.15.0
* | | Merge pull request #11774 from charris/fix-intersect1dCharles Harris2018-08-171-7/+18
|\ \ \ | | | | | | | | BUG: Fix regression in intersect1d.
| * | | BUG: Fix regression in intersect1d.Charles Harris2018-08-171-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was failing for non-ndarray objects that defined that defined __array__, in particular `xarray.DataArray`. Fix by calling asanyarray on the inputs, which was done implicitly before. Closes #11772.
* | | | Merge pull request #11715 from QuLogic/no-networkCharles Harris2018-08-171-2/+2
|\ \ \ \ | |/ / / |/| | | TST: Fix urlopen stubbing.
| * | | TST: Fix urlopen stubbing.Elliott Sales de Andrade2018-08-151-2/+2
| | |/ | |/| | | | | | | | | | setup/teardown doesn't work, but setup_module/teardown_module does, at least in pytest.
* | | BUG: Fix regression in loadtxt for bz2 text files in Python 2.Charles Harris2018-08-101-1/+22
|/ / | | | | | | | | | | | | | | | | | | | | Text bz2 files are not well supported in Python2, and, following the NumPy upgrade in text handling, loadtxt was raising an error when they were detected. This led to problems for those few who were using such files. This patch is a quick fix that issues a RuntimeWarning, then opens those files under the assumption that they are latin1 encoded. Caveat emptor. Closes #11633.
* | Merge pull request #11503 from jor-/masterMatti Picus2018-08-011-2/+10
|\ \ | | | | | | MAINT: improve error message for isposinf and isneginf on complex values
| * | API: isposinf and isneginf now raise TypeError instead of ValueError for ↵Joscha Reimer2018-07-301-2/+2
| | | | | | | | | | | | complex values
| * | TEST: numpy.lib.ufunclike: isposinf and isneginf are tested with complex ↵Joscha Reimer2018-07-271-2/+10
| | | | | | | | | | | | values whether exception is raised
| * | Revert "TEST: isposinf and isneginf is now also tested with complex values"Joscha Reimer2018-07-261-19/+17
| | | | | | | | | | | | This reverts commit cd8ffcf11f7d31e383d81112c4bb342ac0269fc8.
| * | TEST: isposinf and isneginf is now also tested with complex valuesJoscha Reimer2018-07-051-17/+19
| | |
* | | Merge pull request #11638 from eric-wieser/remove-ma.expand_dimsRalf Gommers2018-07-311-0/+9
|\ \ \ | | | | | | | | ENH: Make expand_dims work on subclasses
| * | | TST: Add tests for expand_dimsEric Wieser2018-07-301-0/+9
| | | |
* | | | Merge pull request #11637 from eric-wieser/simplify-angleCharles Harris2018-07-311-0/+10
|\ \ \ \ | | | | | | | | | | ENH: np.angle: Remove unnecessary multiplication, and allow subclasses to pass through
| * | | | ENH: np.angle: Preserve subclassesEric Wieser2018-07-301-0/+10
| |/ / /
* | | | Merge pull request #11522 from jzwinck/fix-load-empty-npzJulian Taylor2018-07-291-0/+7
|\ \ \ \ | | | | | | | | | | BUG: fix np.load() of empty .npz file
| * | | | BUG: fix np.load() of empty .npz fileJohn Zwinck2018-07-071-0/+7
| | |/ / | |/| | | | | | | | | | Fixes #9989
* | | | Merge pull request #9022 from eric-wieser/reduce-hides-errorMarten van Kerkwijk2018-07-271-1/+2
|\ \ \ \ | |_|/ / |/| | | BUG: don't silence __array_wrap__ errors in ufunc.reduce
| * | | BUG/MAINT: Handle errors in __array_wrap__ the same way in ufunc.reduce as ↵Eric Wieser2018-06-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | in ufunc.__call__ Previously they were silenced
* | | | MAINT: Convert the doctest in `numpy/lib/tests/test_polynomial.py` to ↵Krzysztof Chomski2018-07-141-82/+68
| | | | | | | | | | | | | | | | regular tests. (#GH9416).
* | | | Merge pull request #11084 from mattip/test-documentationRalf Gommers2018-07-131-1/+1
|\ \ \ \ | | | | | | | | | | DOC: link to TESTS.rst.txt testing guidelines document, tweaks
| * | | | DOC: link to TESTS.rst.txt testing guidelines document, tweak testing docsmattip2018-06-251-1/+1
| | | | |
* | | | | Merge pull request #11464 from eric-wieser/monotonicityCharles Harris2018-07-081-0/+12
|\ \ \ \ \ | | | | | | | | | | | | BUG: Don't convert inputs to `np.float64` in digitize
| * | | | | BUG: Don't convert inputs to `np.float64` in digitizeEric Wieser2018-07-061-0/+12
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts digitize to a pure-python function that falls back on searchsorted. Performance doesn't really matter here anyway - if you care about performance, then you should just call searchsorted directly, rather than checking the order of the bins. Partially fixes gh-11022
* | | | | Merge pull request #11531 from eric-wieser/histogramdd-density-no-deprecationCharles Harris2018-07-082-11/+11
|\ \ \ \ \ | |/ / / / |/| | | | ENH: Add density argument to histogramdd.
| * | | | MAINT: Rename histogramdd's normed argument to density, to match histogramEric Wieser2018-07-082-11/+11
| | | | | | | | | | | | | | | | | | | | Fixes gh-4371
* | | | | Merge pull request #11396 from pimdh/masterEric Wieser2018-06-291-0/+15
|\ \ \ \ \ | | | | | | | | | | | | TST: Added regression test for #11395
| * | | | | TST: Added regression test for #11395Pim de Haan2018-06-211-0/+15
| | |/ / / | |/| | |
* | | | | BUG: fix interpolation with inf and NaN presentJack Vreeken2018-06-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Values like NaN and inf would result in wrong interpolated values on exactly matching sampling points. To produce the correct behavior, we add an additional check to avoid interpolation when handling such a point. Closes #11439
* | | | | Merge pull request #11428 from eric-wieser/deprecate-normed-1.15.0Charles Harris2018-06-271-0/+4
|\ \ \ \ \ | |/ / / / |/| | | | BUG: Fix incorrect deprecation logic for histogram(normed=...) (master)
| * | | | BUG: Fix incorrect deprecation logic for histogram(normed=...)Eric Wieser2018-06-261-0/+4
| | | | | | | | | | | | | | | | | | | | Fixes #11426, which was introduced in #11323 and #11352
* | | | | Merge pull request #11373 from eric-wieser/histogramdd-densityCharles Harris2018-06-181-0/+36
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / TST: Show that histogramdd's normed argument is histogram's density
| * | | TST: Show that histogramdd's normed argument is histogram's densityEric Wieser2018-06-171-0/+36
| | |/ | |/| | | | | | | Relevant to gh-4371
* | | DEP: Actually deprecate the normed argument to histogramEric Wieser2018-06-151-19/+27
|/ / | | | | | | Documenting this argument at such length gives it authenticity it does not deserve.
* | MAINT: push back multifield copy->view changes to 1.16Allan Haldane2018-06-111-2/+14
|/
* Merge pull request #11122 from mhvk/assert-array-comparison-with-maskedCharles Harris2018-06-071-0/+4
|\ | | | | BUG,MAINT: Ensure masked elements can be tested against nan and inf.
| * MAINT: clean up assert_array_compare a bit further.Marten van Kerkwijk2018-06-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This brought to light two bugs in tests, which are fixed here, viz., that a sample ndarray subclass that tested propagation of an added parameter was incomplete, in that in propagating the parameter in __array_wrap__ it assumed it was there on self, but that assumption could be broken when a view of self was taken (as is done by x[~flagged] in the test routine), since there was no __array_finalize__ defined. The other subclass bug counted, incorrectly, on only needing to provide one type of comparison, the __lt__ being explicitly tested. But flags are compared with __eq__ and those flags will have the same subclass.
* | BUG: delimiter/comments in genfromtxt should be encodedAllan Haldane2018-05-301-0/+5
| | | | | | | | Fixes #11028
* | BUG: Avoid deprecated non-tuple indexingEric Wieser2018-05-281-1/+10
| | | | | | | | np.ogrid was not tested anyway, so this was not caught.
* | Merge pull request #11105 from eric-wieser/take_along_axis-strictMarten van Kerkwijk2018-05-281-1/+91
|\ \ | | | | | | ENH: Add (put|take)_along_axis
| * | ENH: Add (put|take)_along_axis as described in #8708Eric Wieser2018-05-251-1/+91
| |/ | | | | | | This is the reduced version that does not allow any insertion of extra dimensions
* | ENH: Modify intersect1d to return common indices (#10684)Christopher2018-05-251-1/+40
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * added function commonpts1d * Update arraysetops.py * Update arraysetops.py * modified intersect1d to return common indices Proposed this idea in previous pull request (https://github.com/numpy/numpy/pull/10683) and made suggested changes for implementing this idea to have relevant common indices that correspond to the values in the intersection of the two arrays. * update intersect1d with suggested changes * implemented return_indices options for intersect1d I've tested out the above code and for the ~10 different test sets I've tried it's worked thus far. It's probably not the cleanest implementation but it works and is vectorized. * cleaned up structure for intersect1d * fixed copy-paste error, added second test, changed a conditional * Testing return_indices in intersect1d * formatting * created separate test function for intersect1d indices, added spaces after commas * fixed up example and some style * fixed style * style change * removed one example * removed extra space * added version number for return_indices * added 'return_indices' keyword for np.intersect1d * fixed formatting * updated return_indices entry * fixed some typos and style * added bit about first instance of a value being used * STY: Fix comment formats * DOC: missing space * DOC: correct parameter names in docstring * made suggested changes * fixed a mistake from previous update also added documentation for comm1, comm2 to match doc from np.unique * added in tests for 2d inputs * STY: Add missing spaces around commas * TST: Correct array to actually be unique * STY: Spaces at beginning of comments
* Merge pull request #11010 from mhvk/poly-matrix-tests-to-matrixlibCharles Harris2018-05-155-118/+63
|\ | | | | Move remaining Matrix tests to matrixlib
| * MAINT: move matrix tests in lib to matrixlib.Marten van Kerkwijk2018-04-295-118/+63
| |
* | Merge pull request #11023 from eric-wieser/histogramdd-no-fuzzCharles Harris2018-05-141-3/+38
|\ \ | | | | | | BUG: np.histogramdd loses precision on its inputs, leading to incorrect results