summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * 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
| | | * | | | | | BUG: load fails when using pickle without allow_pickle=TruePaul Ivanov2019-04-162-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a partial mitigation of #12759. see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
| | * | | | | | | Merge branch 'master' into poly1d-fixes-fixes-fixes-fixesEric Wieser2019-04-1625-1866/+4732
| | |\ \ \ \ \ \ \ | | | |/ / / / / /
| | | * | | | | | TST: unit test for gh-13200Tyler Reddy2019-04-131-1/+14
| | | | |/ / / / | | | |/| | | |
| | | * | | | | TST: fix up test_structured_paddedTyler Reddy2019-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * minor reviewer adjustments in PR 13301: in test_structured_padded it is necessary to perform the seek after writing to the file, and to specify a fmt option to match the expected result
| | | * | | | | BUG: Fix crash when calling savetxt on a padded arrayEric Wieser2019-04-111-1/+11
| | | | |_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a general rule, _every_ use of `.descr` is broken. Fixes #13297
| | | * | | | update testskikocorreoso2019-04-091-9/+7
| | | | | | |
| | | * | | | fix test namekikocorreoso2019-04-091-1/+1
| | | | | | |
| | | * | | | address comments on #9355kikocorreoso2019-03-301-0/+42
| | | |/ / /
| | | * | | DOC: correction to numpy.pad docstring (#13149)Gregory R. Lee2019-03-251-1/+0
| | | | | | | | | | | | | | | | | | * DOC: fix mistatement in numpy.pad docstring
| | | * | | MAINT: Rewrite numpy.pad without concatenate (gh-11358)Lars Grueter2019-03-251-48/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Add support for constant, edge, linear_ramp to new numpy.pad Passes unit tests: - TestConstant - TestEdge - TestZeroPadWidth - TestLegacyVectorFunction - TestNdarrayPadWidth - TestUnicodeInput - TestLinearRamp * MAINT: Simplify diff / change order of functions * MAINT: Revert to old handling of keyword-only arguments * ENH: Add support for stat modes * ENH: Add support for "reflect" mode * MAINT: Remove _slice_column * ENH: Add support for "symmetric" mode * MAINT: Simplify mode "linear_ramp" Creating the linear ramp as an array with 1-sized dimensions except for the one given by `axis` allows implicit broadcasting to the needed shape. This seems to be even a little bit faster that doing this by hand and allows the simplicifaction of the algorithm. Note: Profiling and optimization will be done again at a later stage. * MAINT: Reorder arguments of a sum and fix typo Addresses feedback raised in PR. * ENH: Add support for "wrap" mode This completes the first draft of the complete rewrite meaning all unit tests should pass from this commit onwards. * MAINT: Merge functions for "reflect" and "symmetric" mode The set functions were nearly the same, apart from some index offsets. Merging them reduces code duplication. * TST: Add regression test for gh-11216 The rewrite in past commits fixed this bug. * BUG: Fix edge case for _set_wrap_both when pad_amt contains 0. And include test to protect against regression. * MAINT: Simplify and optimize pad modes Major changes & goals: Don't deal with pad area in the front and back separately. This modularity isn't needed and makes handling of the right edge more awkward. All modes now deal with the left and right side at the same time. Move the creation of the linear ramps fully to its own function which behaves like a vectorized version of linspace. Separate calculation and application of the pad area where possible. This means that _get_edges can be reused for _get_linear_ramps. Combine _normalize_shape and _validate_lengths in a single function which should handles common cases faster. Add new mode "empty" which leaves the padded areas undefined. Add documentation where it was missing. * TST: Don't use np.empty in unit tests * MAINT: Reorder workflow in numpy.pad and deal with empty dimensions Only modes "constant" and "empty" can extend dimensions of size 0. Deal with this edge case gracefully for all other modes either fail or return empty array with padded non-zero dimensions. Handle default values closer to their actual usage. And validate keyword arguments that must be numbers. * MAINT: Add small tweaks to control flow and documentation * BUG: Ensure wrap mode works if right_pad is 0 * ENH: Use reduced region of interest for iterative padding When padding multiple dimensions iteratively corner values are unnecessarily overwritten multiple times. This function reduces the working area for the first dimensions so that corners are excluded. * MAINT: Restore original argument order in _slice_at_axis * MAINT: Keep original error message of broadcast_to * MAINT: Restore old behavior for non-number end_values. * BENCH: Make the pad benchmark pagefault in setup * ENH/TST: Preserve memory layout (order) of the input array and add appropriate unit test. * STY: Revert cosmetical changes to reduce diff * MAINT: Pin dtype to float64 for np.pad's benchmarks * MAINT: Remove redundant code path in _view_roi * MAINT/TST: Provide proper error message for unsupported modes and add appropriate unit test. * STY: Keep docstrings consistent and fix typo. * MAINT: Simplify logical workflow in pad * MAINT: Remove dtype argument from _linear_ramp The responsibility of rounding (but without type conversion) is not really need in _linear_ramp and only makes it a little bit harder to reason about. * DOC: Add version tag to new argument "empty" * MAINT: Default to C-order for padded arrays unless the input is F-contiguous. * MAINT: Name slice of original area consistently for all arguments describing the same thing. * STY: Reduce vertical space * MAINT: Remove shape argument from _slice_at_axis Simplifies calls to this function and the function itself. Using `(...,)` instead should keep this unambiguous. This change is not compatible with Python 2.7 which doesn't support this syntax outside sequence slicing. If that is wanted one could use `(Ellipsis,)` instead. * TST: Test if end_values of linear_ramp are exact which was not given in the old implementation `_arange_ndarray`. * DOC: Improve comments and wrap long line * MAINT: Refactor index_pair to width_pair Calling the right value an index is just plain wrong as it can't be used as such. * MAINT: Make _linear_ramp compatible with size=0 * MAINT: Don't rely on negative indices for slicing Calculating the proper positive index of the start of the right pad area makes it possible to omit the extra code paths for a width of 0. This should make the code easier to reason about. * MAINT: Skip calculation of right_stat if identical If the input area for both sides is the same we don't need to calculate it twice. * TST: Adapt tests from gh-12789 to rewrite of pad * TST: Add tests for mode "empty" * TST: Test dtype persistence for all modes * TST: Test exception for unsupported modes * TST: Test repeated wrapping for each side individually. Reaches some only partially covered if-statments in _set_wrap_both. * TST: Test padding of empty dimension with constant * TST: Test if end_values of linear_ramp are exact which was not given in the old implementation `_arange_ndarray`. (Was accidentally overwritten during the last merge). * TST: Test persistence of memory layout Adapted from an older commit 3ac4d2a1b9b258d65f8d2b5f8f25f88e3a0e8f58 which was accidentally overwritten during the last merge. * MAINT: Simplify branching in _set_reflect_both Reduce branching and try to make the calculation of the various indices easier to understand. * TST: Parametrize TestConditionalShortcuts class * TST: Test empty dimension padding for all modes * TST: Keep test parametrization ordered Keep parametrization ordered, otherwise pytest-xdist might believe that different tests were collected during parallelization causing test failures. * DOC: Describe performance improvement of np.pad as well as the new mode "empty" in release notes (see gh-11358). * DOC: Remove outdated / misleading notes These notes are badly worded or actually misleading. For a better explanation on how these functions work have a look at the context and comments just above the lines calling these functions.
| | | * | | Fix array dispatcherStefan van der Walt2019-03-151-1/+1
| | | | | |
| | | * | | ENH: Make `mode` parameter default to `constant` (padding by zero)Stefan van der Walt2019-03-131-4/+3
| | | | | |
| | | * | | Merge pull request #8131 from wrwrwr/deprecate-formattingMatti Picus2019-03-101-0/+46
| | | |\ \ \ | | | | | | | | | | | | | | BUG: Fix help() formatting for deprecated functions.
| | | | * | | BUG: Fix help() formatting for deprecated functions.wrwrwr2019-02-171-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #8058.