summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #14063 from luispedro/fix_save_duck_checkCharles Harris2019-07-221-0/+38
|\ | | | | BUG: Fix file-like object check when saving arrays
| * TST Test file-like object detection in save/loadLuis Pedro Coelho2019-07-201-0/+38
| |
* | Merge pull request #13964 from colinsnyder/add-recfunctionsCharles Harris2019-07-221-1/+3
|\ \ | |/ |/| BUG, DOC: add new recfunctions to `__all__`
| * fixed unstructured_to_structured in recfunctionsColin Snyder2019-07-201-4/+4
| |
| * exported correct functions and made private the restColin Snyder2019-07-141-5/+7
| |
* | DEP: Speed up WarnOnWrite deprecation in buffer interfaceSebastian Berg2019-07-161-3/+26
|/ | | | | | | | | | | | | | | | | | | | When a buffer interface does not request a writeable buffer, simply pass a read-only one when the warn on write flag is set. This is to give an easier way forward with avoiding the deprecation warnings: Simply do not ask for a writeable buffer. It will break code that expects writeable buffers but does not ask for them specifically a bit harder than would be nice. But since such code probably should ask for it specifically, this is likely fine (an RC release has to find out). The main reason for this is, that this way it plays very will with cython, which requests writeable buffers explicitly and if declared `const` is happy about read-only (so that using `const` is the best way to avoid the warning and makes code cleaner). Closes gh-13929, gh-13974
* BUG: i0 Bessel function regression on array-likes supporting ufuncsSebastian Berg2019-07-041-0/+16
| | | | | | | | | | For array likes supporting UFuncs, `np.abs` would return an array-like, and this is currently not compatible with the use of `np.piecewise`. The simplest fix seems to be to just call asanyarray (which piecewise calls anyway on the array) beforehand. This way we ensure the conditions are also an array. Fixes gh-13894
* BUG: Refcount fixes (#13860)Sebastian Berg2019-07-031-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * BUG: Fix leaking of object descriptor on dtype discovery of `None` * BUG: Fix reference count leak in string discovery code path * BUG: Fix two more datetime related reference count bugs One is leaking only the python integer 1, the other a descriptor. * BUG: Fix bugs in vectorized string functions error paths Fixes reference count issues (a leak) in TestVecString::test_non_existent_method and TestVecString::test_non_string_array * BUG: Fix Reference count leak in in128 C-level tests * BUG: Fix refcount leak in advanced indexing error path * BUG,MAINT: Refactor indexing dtypes handling in mapiter constructor Using borrowed references for the dtypes seems much easier to get the reference counts right. * BUG: Reference leaks in deprecated datetime with timezone coercion * BUG: Refcount issue in nonzero 0-d path * BUG: Fix ufunc.at dtype refcount handling in resolver * BUG: Fix reference count in nditer python op_axes setup * BUG: Reference leak in writebackifcopy non-array error path * BUG: Add missing DECREF in ufunc with dtype type resolution * BUG: Reference count bugs in io functions * BUG: Reference count loss in as_c_array C-side tests * BUG: Leaking of method in object method based ufunc loops The function could possibly be optimized nicely by checking that the method will be the same because the types are identical. OTOH, that may not be correct in dynamically adapted types. * TST: Clean up cyclic ctypes reference to simplify leak debugging If we do not clean it up in this test, the collection can take so long that it affects the following tests when running with reference leak debugging tools (pytest-leaks). * BUG: Reference count of raw data for 0-sized unpickling * TST: Mark tests which must leak references It really may be time to remove this, considering how annoying this is, may want to think about getting rid of that behaviour. Could probably write a multiearraytests C-side function instead. * BUG: Fix refcount leaks in arr.getield and setfield error paths * BUG: Fix refcount issue in wheremask This fix is not the prettiest, since it relies on the wheremask to be formatted to boolean beforehand correctly. * TST: Reset StringConvert after mutating it in tests Or maybe just mark the test? * BUG: Fix missing static for npy_cache_import in umath funcs.inc.src * BUG: Fix refcount in multiternew error path * BUG: Fix npy_ObjectGCD and LCM reference counting * BUG: Decrement already wrapped outputs on failure This is not super pretty, but not sure how to do it much better right now. * FIXUP: iotools StringConverter._mapper * FIXUP: as_c_array tests * FIXUP: String/dtype discovery comment * FIXUP: Nonzero comment * FIXUP: mapiternew -- check error return of dtype creation In principle, at least at this time, this is not possible
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-014-14/+14
|
* ENH: Deprecate writeable broadcast_array (#12609)Matti Picus2019-06-281-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the base is not an array (or generally when the flag of the base array was toggled), it is OK to allow setting the writeable flag to True, as long as any ancestor (especially the last one) is writeable. This commit also slightly change the behaviour of the base attribute. --- * ENH: Deprecate writeable broadcast_array * ENH: Make writeable flag enabling more reliable for non-array bases When the base is not an array (or generally when the flag of the base array was toggled), it is OK to allow setting the writeable flag to True, as long as any ancestor (especially the last one) is writeable. * Update doc/release/1.17.0-notes.rst Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update doc/release/1.17.0-notes.rst Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update numpy/lib/tests/test_stride_tricks.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * Update numpy/core/tests/test_multiarray.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net> * DOC: improve warning (from review)
* Merge branch 'master' into force-zip64Charles Harris2019-06-264-62/+91
|\
| * BUG: further fixup to histogram2d dispatcher.Marten van Kerkwijk2019-06-201-1/+25
| | | | | | | | Now with tests....
| * BUG: ensure i0 does not change the shape.Marten van Kerkwijk2019-06-121-3/+7
| |
| * Merge pull request #13222 from kritisingh1/patch1Matti Picus2019-06-101-57/+58
| |\ | | | | | | DOC: Document/ Deprecate functions exposed in "numpy" namespace
| | * Fix testskritisingh12019-04-101-61/+60
| | |
| | * Issue deprecation warningskritisingh12019-04-051-2/+4
| | |
| * | MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* | | ENH: always use zip64, upgrade pickle protocol to 3mattip2019-05-231-3/+15
|/ /
* | Merge branch 'master' into npy-2.1Matti Picus2019-05-196-54/+168
|\ \
| * \ Merge pull request #10308 from eric-wieser/mask-attr-is-viewMatti Picus2019-05-121-1/+1
| |\ \ | | | | | | | | API: Make MaskedArray.mask return a view, rather than the underlying mask
| | * | API: Make MaskedArray.mask return a view, rather than the underlying maskEric Wieser2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents consumers from reshaping the mask in place, which breaks things As a result, `x.mask is x.mask` returns `False`, but this was already true of `x.data is x.data`. May also be related to gh-10270
| * | | Merge pull request #13433 from mattip/issue13431Sebastian Berg2019-05-121-0/+56
| |\ \ \ | | | | | | | | | | BUG: Handle subarrays in descr_to_dtype
| | * | | MAINT: remove uneeded codemattip2019-05-111-9/+20
| | | | |
| | * | | BUG: parse more subarrays in descr_to_dtypemattip2019-05-031-0/+44
| | | | |
| | * | | BUG: handle subarrays in descr_to_dtypemattip2019-04-301-0/+1
| | |/ /
| * | | Merge pull request #12962 from mattip/unpackbitsCharles Harris2019-05-111-46/+93
| |\ \ \ | | | | | | | | | | ENH: Add 'bitorder' keyword to packbits, unpackbits
| | * | | ENH: changes from reviewmattip2019-05-111-25/+29
| | | | |
| | * | | BUG: parametrize tests, fix for interaction of count, ordermattip2019-05-111-41/+69
| | | | |
| | * | | ENH: add 'order' keyword to packbits, unpackbitsmattip2019-05-111-6/+21
| | | | |
| * | | | Merge pull request #13482 from mattip/durationsSebastian Berg2019-05-111-7/+3
| |\ \ \ \ | | | | | | | | | | | | TEST: add duration report to tests, speed up two outliers
| | * | | | TEST: tweak two slow tests to speed them upmattip2019-05-111-7/+3
| | | | | |
| * | | | | Merge pull request #13332 from eric-wieser/fix-subarray-unstructuredCharles Harris2019-05-111-0/+9
| |\ \ \ \ \ | | |_|/ / / | |/| | | | BUG: Always return views from structured_to_unstructured when possible
| | * | | | BUG: Always return views from structured_to_unstructured when possibleEric Wieser2019-05-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also applies to unstructured_to_structured While producing correct resutls, the test added in this commit would previously make an unecessary copy, causing the assertion to fail. The cause was `astype` was being asked to convert from a subarray of shape `(x, y)` to one of `(x*y,)`, which it cannot do without making a copy. This changes the approach used to skip the step of flattening subarrays to 1d
| * | | | | Merge pull request #13298 from navneet-nmk/diff-errorEric Wieser2019-05-021-0/+3
| |\ \ \ \ \ | | |_|/ / / | |/| | | | ENH: Added clearer exception for np.diff on 0-dimensional ndarray
| | * | | | ENH: add clearer error message for diff(0-d)ayir2019-04-261-0/+3
| | | | | |
| * | | | | BUG: fix unravel_index when dimension is greater than 'intp'psschand2019-05-011-0/+3
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | The PR is: gh13439 Closes gh-9538
* | | | | BUG/ENH: Create npy format 3.0Eric Wieser2019-05-071-0/+25
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version encodes the dtype as utf8 instead of latin1. Unfortunately we need to create a new version to make this change, because we did not limit ourselves to ASCII in versions 1 and 2. Fixes gh-7391
* | | | Merge pull request #8641 from eric-wieser/ix_-preserve-typeMatti Picus2019-04-291-5/+10
|\ \ \ \ | | | | | | | | | | BUG: Preserve types of empty arrays in ix_ when known
| * \ \ \ Merge branch 'master' into ix_-preserve-typeEric Wieser2018-07-3125-1531/+3428
| |\ \ \ \
| * | | | | BUG: Preserve types of empty arrays when knownEric Wieser2017-02-191-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Fixes regression in #5805
* | | | | | Merge pull request #13409 from seberg/fix-unicode-fmt-savetxtMatti Picus2019-04-261-0/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | BUG: (py2 only) fix unicode support for savetxt fmt string
| * | | | | | BUG: (py2 only) fix unicode support for savetxt fmt stringSebastian Berg2019-04-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By now, all that is needed is to also allow unicode strings to pass through. Adds a test for the support which already succeeds on python3. Closes gh-4053 (replaces the old PR)
* | | | | | | Merge pull request #13390 from eric-wieser/quantile-fractionMatti Picus2019-04-251-0/+36
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | ENH: Add support for Fraction to percentile and quantile
| * | | | | | | ENH: Add support for Fraction to percentile and quantileEric Wieser2019-04-231-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With true division available, using `.0` to convert integers to floats offers no value, and harms compatibility with precise rational types.
* | | | | | | | Merge remote-tracking branch 'upstream/master' into fix-1-field-unstructuredEric Wieser2019-04-2316-384/+782
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | | | | | / / | |_|_|_|_|/ / |/| | | | | |
| * | | | | | Merge pull request #12594 from mattip/pypy3-testingTyler Reddy2019-04-221-1/+2
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | DEV, BUILD: add pypy3 to azure CI
| | * | | | | | TEST: update for PyPymattip2019-04-171-1/+2
| | | | | | | |
| * | | | | | | Merge pull request #11684 from mattip/unravel_index-emptyMatti Picus2019-04-181-0/+20
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | BUG: Raise when unravel_index, ravel_multi_index are given empty input
| | * | | | | | | BUG: raise on empty sequence input to unravel_index, ravel_index_multi; ↵mattip2019-03-291-0/+20
| | | |_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | clarify error msg
| * | | | | | | Merge pull request #12889 from ivanov/no-pickles-for-youCharles Harris2019-04-162-7/+10
| |\ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | | BUG: Make allow_pickle=False the default for loading