summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | 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
| * | | | BUG: histogramdd fails on large integersEric Wieser2018-04-301-0/+12
| | | | | | | | | | | | | | | | | | | | This is due to gh-11022.
| * | | | ENH: Disable fuzzing on histogram boundariesEric Wieser2018-04-301-3/+26
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a fuzzy rounded comparison was used for the rightmost bin of histogramdd. It's not clear why this was done, and it resulted in surprising behavior. This also removes the restriction that bin edges must be floats, and allows integer arrays to be passed (and returned) Fixes gh-10864
* | | | BUG: Fix padding with large integersLars G2018-05-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old way of creating the padded array padded with wrong values for large integers because the new prepended / appended array was implicitly created with dtype float64: >>> (np.zeros(1) + (2 ** 64 - 1)).astype(np.uint64) array([0], np.uint64) >>> (np.zeros(1) + (2 ** 63 - 1)).astype(np.int64) array([-9223372036854775808])
* | | | MAINT: Misc. typos (#11005)luzpaz2018-04-304-7/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* | | Merge pull request #10199 from chunweiyuan/quantileStephan Hoyer2018-04-232-0/+58
|\ \ \ | | | | | | | | ENH: Quantile
| * | | ENH: Adding np.quantile() and np.nanquantile(). #10199Chun-Wei Yuan2018-04-162-0/+58
| | | |
* | | | MAINT, DOC: Fix typos (#10958)Nicholas Nadeau, P.Eng., AVS2018-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixed doc typo * fixed lib typos * fixed lapack_lite typos * Revert "fixed lapack_lite typos" This reverts commit e7dada860cb73af190234402508ab79965ecd079.
* | | | Merge pull request #10891 from eric-wieser/assert-no-cyclesCharles Harris2018-04-211-11/+2
|\ \ \ \ | | | | | | | | | | TST: Extract a helper function to test for reference cycles
| * | | | TST: Extract a helper function to test for reference cyclesEric Wieser2018-04-121-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also means we can now test that our test is actually able to detect the type of failure we expect Trying to give myself some tools to debug the failure at https://github.com/numpy/numpy/pull/10882/files#r180813166
* | | | | ENH: Extend np.flip to work over multiple axesJunjie Bai2018-04-171-3/+33
| | | | | | | | | | | | | | | | | | | | Closes #10847
* | | | | BUG: fix crash in numpy.genfromtxt(..., names=True, comments=None) (#10822)Raunak Shah2018-04-161-0/+7
| |/ / / |/| | | | | | | | | | | Fixes gh-10780
* | | | Merge pull request #10875 from mattip/fix-issue7895Charles Harris2018-04-151-0/+40
|\ \ \ \ | | | | | | | | | | BUG: fix savetxt, loadtxt for '+-' in complex
| * | | | BUG: fix savetxt, loadtxt for '+-' in complexmattip2018-04-101-0/+40
| | | | |
* | | | | TST: reactivate module docstring tests, fix float formattingmattip2018-04-151-18/+18
| |/ / / |/| | |
* | | | ENH: Improve histogram bins="auto" for data with little variance (#10739)Varun Nayyar2018-04-091-0/+18
|/ / / | | | | | | Now falls back on sturges estimator when the IQR is zero
* | | STY: Some PEP8 fixes in lib/tests/test_twodim_base.py.Charles Harris2018-04-081-16/+17
| | |
* | | TST: Remove yield tests in lib/tests/test_twodim_base.py.Charles Harris2018-04-081-12/+12
| | |
* | | TST: Remove yield tests from lib/tests/test_index_tricks.py.Charles Harris2018-04-081-65/+71
| | |
* | | MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-0624-151/+41
| | | | | | | | | | | | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* | | TST: Switch to using pytest markersCharles Harris2018-04-046-41/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* | | TST: Rename some compiled c test modulesCharles Harris2018-03-241-1/+1
| | | | | | | | | | | | | | | | | | The renamed C modules provide low level functions for testing. The rename marks them as private functions and makes them invisible to pytest by default.
* | | MAINT: Remove use of unittest in NumPy tests.xoviat2018-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes a few left over uses of unittest. The main changes apart from removal of Test case are: * `setUp` replaced by nose and pytest compatible `setup` * `tearDown` replaced by nose and pytest compatible `teardown` * `assertRaises` replaced by `assert_raises` * `assertEqual` replaced by `assert_equal` The last two are in `numpy/testings/tests/test_utils.py`, so may seem a but circular, but at least are limited to those two functions. The use of `setup` and `teardown`, can be fixed up with the pytest equivalents after we have switched to pytest.
* | | Merge pull request #10666 from dfreese/fix/covcomplexCharles Harris2018-03-161-1/+3
|\ \ \ | | | | | | | | BUG: fix complex casting error in cov with aweights
| * | | BUG: fix complex casting error in cov with aweightsDavid Freese2018-02-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using cov with a complex input and with aweights specified, cov will error as a result of trying to cast a complex value into a float64. This comes about since average is used to calculate the sum of the weights from aweights. average returns the sum of weights as the same type as its result, not the weights type. For a complex input m, and any type for aweights, this would result in a complex value for fact. It appears the primary purpose of np.float64(fact) is to provide a NaN value from the divide when fact is an integer zero. This has been replaced by using numpy.divide to replicate the same behavior, but to also handle complex types.
* | | | ENH: Add np.histogram_bin_edges (#10591)Kirit Thadaka2018-03-151-1/+15
| | | | | | | | | | | | | | | | | | | | Fixes #10183 Documentation is copied from np.histogram
* | | | Fix low-hanging Pypy compatibility issues (#10737)Pauli Virtanen2018-03-122-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TST: skip refcount-requiring tests if sys.refcount is missing * ENH: io: add refcheck=False to a safe .resize() call The array is allocated immediately above, and the resize always succeeds so it is not necessary to check it. Fixes Pypy compatibility. * TST: remove unused code * TST: factor skipif(not HAS_REFCOUNT) into a separate decorator
* | | | BUG/MAINT: Remove special handling of 0d arrays and scalars in interpEric Wieser2018-02-251-2/+11
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | These are now handled generically by the underlying C function This fixes the period argument for 0d arrays. Now never returns a pure-python scalar, which matches the behaviour of most of numpy. Rework of b66a200a4a1e98f1955c8a774e4ebfb4588dab5b