summaryrefslogtreecommitdiff
path: root/numpy/testing/_private
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-195-1732/+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>
* ENH: reorder includes for system installationsmattip2022-07-201-1/+1
|
* 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-242-6/+50
|/ | | | | | 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
|
* MAINT: Split `numpy.typing` into a public and private componentBas van Beek2022-03-181-1/+1
| | | | i.e. `numpy.typing` and `numpy._typing`
* 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
* Merge pull request #20885 from BvB93/param_specCharles Harris2022-01-241-15/+17
|\ | | | | TYP,ENH: Improve typing with the help of `ParamSpec`
| * ENH: Improve typing with the help of `ParamSpec`Bas van Beek2022-01-241-15/+17
| |
* | Merge pull request #20831 from bwoodsend/numpy-testing-depends-on-distutilsRalf Gommers2022-01-201-2/+2
|\ \ | |/ |/| BUG: Avoid importing numpy.distutils on import numpy.testing (#20769)
| * BUG: Avoid importing numpy.distutils on import numpy.testing (#20769)bwoodsend2022-01-161-2/+2
| | | | | | | | | | Move the offending imports into the functions that use them so that numpy.distutils is only loaded if those functions are required.
* | MAINT, DOC: discard repeated wordsDimitri Papadopoulos2022-01-131-1/+1
| |
* | MAINT, DOC: fix new typos detected by codespellDimitri Papadopoulos2022-01-121-1/+1
|/
* STY: Use subscriptable `collections.abc` types over the generic aliases in …Bas van Beek2021-12-231-4/+2
|
* STY: Use subscriptable `builtins` types over the generic aliases in `typing`Bas van Beek2021-12-231-27/+22
|
* 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 missing annotations for `IS_PYSTON`Bas van Beek2021-11-051-0/+1
|
* MAINT: Add `IS_PYSTON` to `np.testing.__all__`Bas van Beek2021-11-051-1/+1
|
* BUG: fix test c-extension compilation inside a venvmattip2021-10-281-1/+1
|
* ENH: Configurable allocator (#17582)Matti Picus2021-10-251-0/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes gh-17467. Adds a public struct to hold memory manipulation routines PyDataMem_Handler and two new API functions PyDataMem_SetHandler to replace the current routines with the new ones, and PyDataMem_GetHandlerName to get the string name of the current routines (either globally or for a specific ndarray object). This also changes the size of the ndarray object to hold the PyDataMem_Handler active when it was created so subsequent actions on its data memory will remain consistent. Tests and documentation are included. Along the way, I found some places in the code where the current policy is inconsistent (all data memory handling should have gone through npy_*_cache not PyDataMem_*) so even if this is rejected it might improve the cache handling. The PyDataMem_Handler has fields to override memcpy, these are currently not implemented: memcpy in the code base is untouched. I think this PR is invasive enough as-is, if desired memcpy can be handled in a follow-up PR. * ENH: add and use global configurable memory routines * ENH: add tests and a way to compile c-extensions from tests * fix allocation/free exposed by tests * DOC: document the new APIs (and some old ones too) * BUG: return void from FREE, also some cleanup * MAINT: changes from review * fixes from linter * setting ndarray->descr on 0d or scalars mess with FREE * make scalar allocation more consistent wrt np_alloc_cache * change formatting for sphinx * remove memcpy variants * update to match NEP 49 * ENH: add a python-level get_handler_name * ENH: add core.multiarray.get_handler_name * Allow closure-like definition of the data mem routines * Fix incompatible pointer warnings * Note PyDataMemAllocator and PyMemAllocatorEx differentiation Co-authored-by: Matti Picus <matti.picus@gmail.com> * Redefine default allocator handling * Always allocate new arrays using the current_handler * Search for the mem_handler name of the data owner * Sub-comparisons don't need a local mem_handler * Make the default_handler a valid PyDataMem_Handler * Fix PyDataMem_SetHandler description (NEP discussion) * Pass the allocators by reference * Implement allocator context-locality * Fix documentation, make PyDataMem_GetHandler return const * remove import of setuptools==49.1.3, doesn't work on python3.10 * Fix refcount leaks * fix function signatures in test * Return early on PyDataMem_GetHandler error (VOID_compare) * Add context/thread-locality tests, allow testing custom policies * ENH: add and use global configurable memory routines * ENH: add tests and a way to compile c-extensions from tests * fix allocation/free exposed by tests * DOC: document the new APIs (and some old ones too) * BUG: return void from FREE, also some cleanup * MAINT: changes from review * fixes from linter * setting ndarray->descr on 0d or scalars mess with FREE * make scalar allocation more consistent wrt np_alloc_cache * change formatting for sphinx * remove memcpy variants * update to match NEP 49 * ENH: add a python-level get_handler_name * ENH: add core.multiarray.get_handler_name * Allow closure-like definition of the data mem routines * Fix incompatible pointer warnings * Note PyDataMemAllocator and PyMemAllocatorEx differentiation Co-authored-by: Matti Picus <matti.picus@gmail.com> * Redefine default allocator handling * Always allocate new arrays using the current_handler * Search for the mem_handler name of the data owner * Sub-comparisons don't need a local mem_handler * Make the default_handler a valid PyDataMem_Handler * Fix PyDataMem_SetHandler description (NEP discussion) * Pass the allocators by reference * remove import of setuptools==49.1.3, doesn't work on python3.10 * fix function signatures in test * try to fix cygwin extension building * YAPF mem_policy test * Less empty lines, more comments (tests) * Apply suggestions from code review (set an exception and) Co-authored-by: Matti Picus <matti.picus@gmail.com> * skip test on cygwin * update API hash for changed signature * TST: add gc.collect to make sure cycles are broken * Implement thread-locality for PyPy Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * Update numpy/core/tests/test_mem_policy.py Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * fixes from review * update circleci config * fix test * make the connection between OWNDATA and having a allocator handle more explicit * improve docstring, fix flake8 for tests * update PyDataMem_GetHandler() from review * Implement allocator lifetime management * update NEP and add best-effort handling of error in PyDataMem_UserFREE * ENH: fix and test for blindly taking ownership of data * Update doc/neps/nep-0049.rst Co-authored-by: Elias Koromilas <elias.koromilas@gmail.com>
* add another call to gc.collect in break_cyclesmattip2021-10-031-2/+2
|
* STY: Use the PEP 457 positional-only syntax in the stub filesBas van Beek2021-08-311-9/+14
|
* MAINT: Drop .pyi code-paths specific to Python 3.7Bas van Beek2021-08-301-5/+3
|
* For Pyston the refcount of "immortal" objects is set to ~infinityslepton2021-07-071-1/+2
|
* ENH: Add dtype support to `np.testing`Bas van Beek2021-06-061-17/+52
|