summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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