summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #10501 from msornay/fromregex-bytesEric Wieser2018-02-201-1/+8
|\ \ \ | | | | | | | | BUG: fromregex: asbytes called on regexp objects
| * | | BUG: fromregex: asbytes called on regexp objectsMathieu Sornay2018-02-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | When calling fromregex() with a binary stream and a regular expression object, asbytes() was called on the regexp object, resulting in an incorrect regular expression being compiled and used.
* | | | BUG: Revert sort optimization in np.unique.Charles Harris2018-02-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optimization was to sort integer subarrays by treating them as strings of unsigned bytes. That worked fine for finding the unique subarrays, but the sort order of the results could be unexpected. Closes #10495.
* | | | Merge pull request #10324 from eric-wieser/histogram-range-comparisonCharles Harris2018-02-081-0/+47
|\ \ \ \ | | | | | | | | | | BUG: Fix crashes when using float32 values in uniform histograms
| * | | | BUG: Fix crashes when using float32 values in uniform histogramsEric Wieser2018-02-021-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #8123, closes #9189, fixes #10319 This is a workaround to #10322, not a fix for it. Adds tests for cases where bounds are more precise than the data, which led to inconsistencies in the optimized path.
* | | | | Merge pull request #10401 from eric-wieser/fix-10394Charles Harris2018-02-061-0/+7
|\ \ \ \ \ | | | | | | | | | | | | BUG: Resize bytes_ columns in genfromtxt
| * | | | | BUG: Resize bytes_ columns in genfromtxtEric Wieser2018-01-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Fixes gh-10394, due to regression in gh-10054
* | | | | | MAINT: Use AxisError in swapaxesEric Wieser2018-02-031-2/+2
| | | | | |
* | | | | | BUG: nan_to_num does not return scalars for scalar integer input (#10441)Matheus Vieira Portela2018-02-011-2/+16
| | | | | |
* | | | | | BUG: Fixed polydiv for Complex Numbers (#10473)Deepak Kumar Gouda2018-01-301-0/+8
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | This previously failed with: TypeError: Cannot cast ufunc subtract output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'
* | | | | Merge pull request #10342 from anaskhan96/union1d-fixCharles Harris2018-01-181-0/+8
|\ \ \ \ \ | | | | | | | | | | | | BUG: arrays not being flattened in `union1d`
| * | | | | STY: Break some long lines.Charles Harris2018-01-181-1/+2
| | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | adding a reference to the related issueAnas Khan2018-01-101-0/+1
| | | | | |
| * | | | | adding new tests for union1dAnas Khan2018-01-091-0/+6
| | | | | |
* | | | | | Merge pull request #10294 from xoviat/pytest-cleanupEric Wieser2018-01-091-6/+6
|\ \ \ \ \ \ | |/ / / / / |/| | | | | MAINT: pytest cleanups
| * | | | | MAINT: cleanup yield testsxoviat2018-01-061-6/+6
| | | | | |
* | | | | | More misc. typosluz.paz2018-01-042-5/+5
| |_|/ / / |/| | | | | | | | | Found via `codespell`
* | | | | ENH: Allow ptp to take an axis tuple and keepdimsEric Wieser2017-12-281-0/+3
|/ / / /
* | | | ENH: Add support for datetimes to histogramsEric Wieser2017-12-261-0/+25
| | | | | | | | | | | | | | | | Currently only supported for explicit bins
* | | | BUG: Allow nan values in the data when the bins are explicitEric Wieser2017-12-241-0/+25
| | | | | | | | | | | | | | | | | | | | Fixes gh-7503 Closes gh-8984
* | | | BUG: Fix misleading error when coercing to arrayEric Wieser2017-12-241-0/+11
| | | | | | | | | | | | | | | | Closes gh-7864
* | | | Merge branch 'master' into move_histogramEric Wieser2017-12-181-0/+5
|\ \ \ \
| * | | | ENH: Allow np.r_ to accept 0d arraysEric Wieser2017-12-111-0/+5
| |/ / / | | | | | | | | | | | | Fixes gh-9233
* | | | MAINT: Move histogram and histogramdd into their own moduleEric Wieser2017-12-102-512/+527
|/ / / | | | | | | | | | | | | | | | | | | 800 self-contained lines are easily enough to go in their own file, as are the 500 lines of tests. For compatibility, the names are still available through `np.lib.function_base.histogram` and `from np.lib.function_base import *` For simplicity of imports, all of the unqualified `np.` names are now qualified
* | | MAINT: Various minor code cleanups.Charles Harris2017-11-242-62/+73
| | | | | | | | | | | | Minor cleanups of old code to reflect more modern usage.
* | | MAINT: Refactor some code in npyio.py.Charles Harris2017-11-211-2/+0
| | |
* | | ENH: Add encoding option to numpy text IO.Julian Taylor2017-11-212-93/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies loadtxt and genfromtxt in several ways intended to add unicode support for text files by adding an `encoding` keyword to np.load, np.genfromtxt, np.savetxt, and np.fromregex. The original treatment of the relevant files was to open them as byte files, whereas they are now opened as text files with an encoding. When read, they are decoded to unicode strings for Python3 compatibility, and when written, they are encoded as specified. For backward compatibility, the default encoding in both cases is latin1.
* | | ENH: Make `np.in1d()` work for unorderable object arrays (#9999)Jörg Döpfert2017-11-181-0/+31
| | |
* | | ENH: Add `order=` keyword to `np.eye()` (#9996)Danny Hermes2017-11-121-0/+9
| | | | | | | | | Fixes #9995
* | | ENH: add Decimal support to numpy.lib.financial (#9952)Garry Polley2017-11-111-61/+238
| | | | | | | | | | | | | | | Adds support for Decimal to the rate, pv, fv, pmt, ppmt, ipmt, mirr, npv functions Closes #9781
* | | BUG: Throw an error if too many functions are given to piecewiseEric Wieser2017-10-231-0/+10
| | | | | | | | | | | | Especially necessary given the strange heuristics that decay the number of conditions to 1
* | | TST: Add test for 0d conditions in np.piecewiseEric Wieser2017-10-221-0/+6
| | |
* | | MAINT/BUG: Remove special-casing for 0d arrays, now that indexing with a ↵Eric Wieser2017-10-211-1/+1
| | | | | | | | | | | | | | | | | | single boolean is ok Also fix the test added in gh-4792, which didn't make sense, but passed anyway
* | | Merge pull request #9065 from eric-wieser/deprecate-bincountCharles Harris2017-10-181-2/+2
|\ \ \ | | | | | | | | DEP: 0 should be passed to bincount, not None
| * | | MAINT: improve wording of error messagesEric Wieser2017-10-171-2/+2
| | | |
* | | | BUG: Allow `unravel_index(0, ())` to return ()Eric Wieser2017-10-171-1/+12
|/ / / | | | | | | | | | Fixes gh-580
* | | Merge pull request #9294 from b-carter/fix_histogram_monotonicity_checkEric Wieser2017-09-241-0/+8
|\ \ \ | | | | | | | | BUG: Fixes histogram monotonicity check for unsigned bin values
| * | | TST: add test for unsigned bins monotonicity check, see #9222Brandon Carter2017-06-241-0/+8
| | | |
* | | | Merge pull request #9408 from eric-wieser/gradient-fixCharles Harris2017-09-211-1/+8
|\ \ \ \ | | | | | | | | | | BUG: various fixes to np.gradient
| * | | | BUG: Only allow 1d distance arraysEric Wieser2017-07-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2d arrays would work, but in unpredictable and undocumented ways. This at least makes gh-9401 give a better error message.
| * | | | BUG: Allow 0d arrays instead of scalars in gradientEric Wieser2017-07-131-1/+4
| | | | | | | | | | | | | | | | | | | | This fixes gh-8292
* | | | | ENH Better error message for savetxt when X.ndim > 2Nelle Varoquaux2017-09-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | savetxt does not support saving arrays of dimension 0 or higher than 2. This pull request improves the message of the error raised.
* | | | | ENH: Align data in np.save() at 64 bytes (#9025)John Zwinck2017-09-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, saving format version 1 would align to 16 bytes, and saving version 2 would align improperly (bug #8085). Alignment is now always at least 64 bytes in either version, which supports memory mapping of the saved files on Linux, where mmap() offset must be a multiple of the page size. Why 64 bytes? Simply because we don't know of a case where more is needed. AVX alignment is 32 bytes; AVX-512 is 64. Fixes #8085, closes #8598.
* | | | | TST: Fix/Remove old unit tests for structure assignmentAllan Haldane2017-09-071-2/+2
| | | | |
* | | | | BUG: fix padding an empty array in reflect mode.Iryna Shcherbina2017-09-011-0/+7
| | | | | | | | | | | | | | | | | | | | Check that axes with non-zero padding are non-empty.
* | | | | BUG: fix infinite loop when creating np.pad on an empty arrayIryna Shcherbina2017-08-241-0/+4
| | | | |
* | | | | Merge pull request #9524 from charris/add_init_to_test_directoriesCharles Harris2017-08-121-0/+0
|\ \ \ \ \ | | | | | | | | | | | | TST, MAINT: Add `__init__.py` files to tests directories.
| * | | | | TST, MAINT: Add `__init__.py` files to tests directories.Charles Harris2017-08-061-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows pytest to run with duplicate test file names. Note that `python <path-to-test-file>` no longer works with this change, nor will a simple `pytest numpy`, because numpy is imported from the numpy repository. However, `python runtests.py` and `>>> numpy.test()` are still available.
* | | | | | MAINT: Use moveaxis instead of rollaxis internally (#9475)Nico Schlömer2017-08-101-2/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | Also add a hint to the documentation advising the use of moveaxis over rollaxis. Tests for rollaxis are left alone.
* | | | | Merge pull request #9522 from eric-wieser/stop-using-obj2sctypeCharles Harris2017-08-061-1/+7
|\ \ \ \ \ | | | | | | | | | | | | BUG: Fix problems with obj2sctype