summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* add another call to gc.collect in break_cyclesmattip2021-10-031-2/+2
|
* For Pyston the refcount of "immortal" objects is set to ~infinityslepton2021-07-071-1/+2
|
* MAINT: Remove two private functions from `__all__`Bas van Beek2021-06-061-3/+1
|
* DOC: Use: from numpy.testing import ...Tim Hoffmann2021-04-131-5/+5
| | | | | | | | | | | | instead of `import numpy.testing as npt`. - all of NumPy's own tests themselves use the from-import variant - There's `import numpy.typing as npt` around in some places so we should not abbreviate another module import with `npt`. Optional further enhancement: If this is a convention we also want users to adopt, this should be mentioned in the module docstring of `numpy.testing`.
* Merge pull request #18642 from seberg/splitup-faster-argparsing-optimize-asarrayMatti Picus2021-03-211-11/+13
|\ | | | | ENH: Use new argument parsing for array creation functions
| * ENH: Use new argument parsing for array creation functionsSebastian Berg2021-03-181-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array creation functions have the most to gain: 1. np.asarray is 4 times faster and commonly used. 2. Other functions are wrapped using __array_function__ in Python making it more difficult This commit (unfortunatly) has to do a few things: * Modify __array_function__ C-side dispatching to accomodate the fastcall argument convention. * Move asarray, etc. to C after removing all "fast paths" from np.array (simplifying the code) * Fixup imports, since asarray was imported directly in a few places * Replace some places where `np.array` was probably used for speed instead of np.asarray or similar. (or by accident in 1 or 2 places)
* | MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-3/+3
|/
* DOC: Fix a couple of reference to verbatim and vice versaMatthias Bussonnier2020-12-181-1/+1
| | | | | | | | | | | | | | | | This update a coupe of references (single backticks) that actually are not to verbatim/code (double backticks); and a couple of verbatim to reference when they do actually exists and can be resolved in context. I probably missed other; and stayed simple but spoted a few other inconsistencies that I did not fix: - some ``...`` could actually be :math:`...` but not always clear if it would be better. - some intervals are [``...``], other are ``[...]`` I guess they could be discussed individually; it was mostly the failing references that bothered me.
* Fix AttributeError: 'bool' object has no attribute 'ndim'Christoph Gohlke2020-12-031-1/+1
|
* minor typographic changeJakob2020-10-241-1/+1
|
* more fixesJakob2020-10-231-4/+4
|
* fix quotation marksJakob2020-10-231-1/+1
|
* fix typoJakob2020-10-231-1/+1
|
* mostly string conversionsJakob2020-10-231-44/+40
|
* TST: fix tests for windows + PyPymattip2020-07-301-1/+2
|
* TST: Add new tests for array coercion (#16571)Sebastian Berg2020-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Add traceback-skip to `assert_array_compare` * TST: Add tests for arraycoercion These tests have many xfails (some technically maybe not correct), which describe in detail what will change when merging the array-coercion changes; since all of those xfails are going to be removed. * TST: Add test for empty sequences * TST: Add tests for bad self-mutating sequence inputs to np.array These should never happen and rightly should lead to undefined behaviour (and preferably errors), but they excercise some more tricky code branches and should probably not crash. * Simplify the "all scalars" logic (hardcode) and fix complex cases * MAINT: Some cleanup, and xfail pypy PyPy seems to have issues with int(numpy_complex), maybe because it gives a warning during conversion (python does not define it). So simply mark it as xfail, it should work in my branch. Also some smaller cleanups. * TST: Add some further test, re-add missing rational * MAINT: Make rationals optional, because they fail some tests currently The failures will go away, since this must again be related to implemetning int() and float(). * Update numpy/conftest.py * MAINT: Fix strings and use pytest.param to clean things up * TST: Add tests for 0-D array-like input to np.array() corner-cases * TST: Improve parameterization IDs to get better printing at -vv
* DOC: Improve assert_warns docstring with exampleSeth Troisi2020-06-011-3/+16
|
* DOC: Update assert_warns parameter listSeth Troisi2020-05-281-5/+3
|
* DOC: Add missing bracket (gh-16051)Chunlin2020-04-251-2/+2
| | | Add missing closing brackets, script to generate the list in the PR gh-16051.
* BUG: fix doctest exception messagesmattip2020-02-281-5/+12
|
* DOC: Reword docstring for assert_equal (gh-15614)Harshal Prakash Patankar2020-02-191-1/+1
|
* BUG: Ignore differences in NAN representation for computing ULP differencesRaghuveer Devulapalli2020-02-181-2/+17
|
* STY,MAINT: avoid 'multiple imports on one line' (flake8 E401)Mike Taves2020-01-281-1/+3
| | | | | | * PEP 8: "Imports should usually be on separate lines" * Where modified, sort imported modules alphabetically * Clean-up unused imports from these expanded lines
* STY: use `with open` when possibleSeth Troisi2020-01-211-6/+4
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-12/+2
|
* TST: move _no_tracing to testing._privatemattip2020-01-151-0/+21
|
* MAINT: Implement keyword-only arguments as syntaxEric Wieser2020-01-061-2/+1
| | | | Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* Merge pull request #15178 from rgommers/maxulp-msgCharles Harris2020-01-021-2/+3
|\ | | | | TST: improve assert message of assert_array_max_ulp
| * TST: improve assert message of assert_array_max_ulpRalf Gommers2019-12-261-2/+3
| | | | | | | | | | | | It was not showing the max difference before, which makes it hard to judge whether something is seriously wrong, or the test precision simply needs to be bumped by a little.
* | MAINT: better way of indicating whether numpy was built with ILP64 BLASPauli Virtanen2020-01-011-2/+2
|/
* ENH: update BLAS symbol suffix/prefix handling in cblasfuncs & linalgPauli Virtanen2019-12-141-1/+1
| | | | Revise the BLAS name mangling to support the general scheme.
* TST: testing: check requires_memory immediately before the test + ignore ↵Pauli Virtanen2019-12-081-1/+24
| | | | MemoryErrors
* TST: fix up issues in requires_memory decoratorPauli Virtanen2019-12-041-5/+6
| | | | Fix wrong multiplier for /proc/meminfo, and do style cleanups.
* TST: linalg: add smoke test for 64-bit blasPauli Virtanen2019-12-011-1/+3
|
* TST: add pytest machinery to specify memory requirements for testsPauli Virtanen2019-12-011-0/+70
|
* ENH: add isinf, isnan, fmin, fmax loops for datetime64, timedelta64 (#14841)Matti Picus2019-11-211-15/+27
| | | | | | | | `np.datetime('NaT')` should behave more like `float('Nan')`. Add needed infrastructure so `np.isinf(a)` and `np.isnan(a)` will run on `datetime64` and `timedelta64` dtypes. Also added specific loops for `numpy.fmin` and `numpy.fmax` that mask `NaT`.
* DOC: testing: Note handling of scalars in assert_array_equal and assert_equal.Warren Weckesser2019-11-201-5/+22
|
* assert_array_compareMaxwell Aladago2019-09-061-7/+8
|
* BUG: Fixed maximum relative error reporting in assert_allclose (gh-13802)CakeWithSteak2019-09-051-2/+7
| | | | | | Fixed maximum relative error reporting in assert_allclose: In cases where the two arrays have zeros at the same positions it will no longer report nan as the max relative error
* DEP: numpy.testing.rand (#14325)Maxwell Aladago2019-08-221-18/+1
| | | * Deprecation: numpy.testing.rand
* ENH: Improve mismatch message of np.testing.assert_array_equal (#14203)Tim Hoffmann2019-08-151-2/+5
| | | | | The original message included "Mismatch: 33.3%". It's not obvious what this percentage means. This commit changes the text to "Mismatched elements: 1 / 3 (33.3%)".
* MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-1/+1
|
* MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-2/+2
| | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* BUG: special case object arrays when printing rel-, abs-errormattip2019-05-271-4/+12
|
* Merge pull request #13518 from hmaarrfk/faster_array_compareEric Wieser2019-05-121-4/+3
|\ | | | | MAINT: implement assert_array_compare without converting array to python list
| * Ensure that reduced is a 1D arrayMark Harfouche2019-05-121-1/+1
| |
| * Fixup: address eric-wieser's commentsMark Harfouche2019-05-121-5/+3
| |
| * MNT: implement assert_array_compare without converting array to python list.Mark Harfouche2019-05-091-4/+5
| |