summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: fix incorrect description of raise condition in ↵Clément Robert2023-05-051-1/+1
| | | | numpy.testing.assert_array_less's docstring
* MAINT: Remove gisnan, gisinf, and gisfinite from testing codeSebastian Berg2023-05-031-68/+13
| | | | | | | | | | | These were introduced many years ago when ufuncs were buggy and could return NotImplemented sometimes. This has been fixed for many years, though. I suspect the errstate for `isfinite` is not required so removed it. It was a 12+ year old work-around for warnings that really shouldn't happen to begin with. (The commit mentions `np.isinf(np.inf)` giving a warning, which doesn't make sense, I think.)
* Merge pull request #22493 from mwtoews/maint-openSebastian Berg2023-04-281-3/+3
|\ | | | | MAINT: remove redundant open() modes and io.open() alias
| * MAINT: remove redundant open() modes and io.open() aliasMike Taves2022-10-291-3/+3
| |
* | Merge pull request #22982 from yamadafuyuka/add_fujitsuccompiler_and_SSL2Sebastian Berg2023-03-061-1/+18
|\ \ | | | | | | ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.
| * | ENH: add support for fujitsu C/C++ compiler and SSL2 to numpy.yamadafuyuka2023-03-021-1/+18
| | |
* | | MAINT: testing: Fix some whitespace and minor code issues in utils.pywarren2023-02-161-17/+18
|/ /
* | CI: musllinux_x86_64 (#22864)Andrew Nelson2023-01-201-1/+15
| | | | | | [ci skip]
* | MAINT: Remove all nose testing support.Charles Harris2023-01-191-60/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NumPy switched to using pytest in 2018 and nose has been unmaintained for many years. We have kept NumPy's nose support to avoid breaking downstream projects who might have been using it and not yet switched to pytest or some other testing framework. With the arrival of Python 3.12, unpatched nose will raise an error. It it time to move on. Decorators removed - raises - slow - setastest - skipif - knownfailif - deprecated - parametrize - _needs_refcount These are not to be confused with pytest versions with similar names, e.g., pytest.mark.slow, pytest.mark.skipif, pytest.mark.parametrize. Functions removed - Tester - import_nose - run_module_suite
* | DOC: Add version added information for the strict parameter in ↵Mark Harfouche2023-01-151-0/+2
| | | | | | | | assert_array_equal (#23015)
* | DOC: testing: Fix typo: nulps -> nulpwarren2022-11-181-1/+1
| | | | | | | | [skip actions] [skip travis] [skip azp]
* | TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-111-1/+2
|/
* PERF: Eliminate slow check for pypy during numpy import (#22163)Pieter Eendebak2022-08-231-1/+1
| | | | | | | This PR replaces the import of platform and a call to platform.python_implementation() with a check using sys.implementation.name to improve the numpy import time. The improvement is about 5-10 ms (system dependent). Also see #22061 Co-authored-by: Matti Picus <matti.picus@gmail.com>
* Merge pull request #21795 from hmaarrfk/no_overflow_unsignedSebastian Berg2022-07-061-0/+3
|\ | | | | ENH: Ensure that assertion of unsigned dtypes does not return results
| * BUG: Ensure that assertion of unsigned dtypes does not return resultsMark Harfouche2022-06-291-0/+3
| | | | | | | | that wrapped around.
* | Merge pull request #21626 from seberg/weak-scalarsCharles Harris2022-06-261-2/+9
|\ \ | | | | | | API: Introduce optional (and partial) NEP 50 weak scalar logic
| * | TST: Improve testing setup by introducing a new `weak_promotion` fixtureSebastian Berg2022-06-151-2/+2
| | | | | | | | | | | | Unfortunately, this shows that the rational tests are still broken a bit.
| * | API: Add leading underscore to `no_nep50_warning` and `get/set_promotion_state`Sebastian Berg2022-06-151-5/+5
| | |
| * | API: Enforce float64 precision for `assert_almost_equal`Sebastian Berg2022-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This ensures that the precision is not downcast, which could make a small value zero (for float16 mostly). This lets tests pass that check whether `np.float16(0)` is almost equal to 0, which otherwise fail (because `float16(0.00000001)` will evaluate to 0 exactly.
| * | TST: Make test compatible with new promotion or mark for no-warningsSebastian Berg2022-06-151-0/+3
| | |
| * | WIP: Add warning context manager and fix min_scalar for new promotionSebastian Berg2022-06-151-0/+4
| |/ | | | | | | | | Even the new promotion has to use the min-scalar logic to avoid picking up a float16 loop for `np.int8(3) * 3.`.
* | ENH: Add strict parameter to assert_array_equal. (#21595)Jon Morris2022-06-241-6/+46
|/ | | | | | Fixes #9542 Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
* MAINT: Small rewrite for clarity.Charles Harris2022-06-071-6/+5
|
* STY: Use single backticks around parameter names.Charles Harris2022-06-071-1/+1
|
* Break lines in comments to follow line length limitsSachin Krishnan T V2022-05-231-3/+3
|
* Make double backticks for parameters in docstringSachin Krishnan T V2022-05-231-1/+1
|
* Improve docstring of numpy.testing.assert_allcloseSachin Krishnan T V2022-05-231-0/+13
|
* Remove python <3.6 related thingsBrigitta Sipocz2022-05-171-3/+0
|
* ENH: Suppress over-/underflow RuntimeWarning in assert_array_equal (#21003)Simon Surland Andersen2022-02-081-1/+1
| | | | | | | | | | | * TST: Test suppression of asset_array_equal RuntimeWarning See #18992 * ENH: Suppress over-/underflow warnings on asset_array_equal - Closes #18992 * MAINT: Resolve linting issues of prior commit * MAINT: Simplified ignore and test case of asset_array_equal * MAINT: Removed unused import in test_utils.py
* move get_glibc_version to np.testing; skip 2 more tests for old glibcH. Vetinari2021-12-101-0/+13
|
* ENH: provide a convenience function to replace npy_load_module (#20395)Matti Picus2021-11-191-2/+2
| | | | | | | `load_module` is deprecated since python 3.4 and will be removed in python 3.12. Use `exec_module` instead. Provide a convenience function in `distutils.misc_utils` instead of `npy_load_module` from `compat.py3k`.
* MAINT: Add `IS_PYSTON` to `np.testing.__all__`Bas van Beek2021-11-051-1/+1
|
* 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
|