| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
mathematical functions page
|
|\
| |
| | |
DOC: Two small changes in array.rst:
|
| |
| |
| |
| |
| |
| | |
* Include the return values of `PyArray_RegisterCanCast`
in the description.
* Correct the documentation of `PyArray_Scalar`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Builds on gh-20194. Fixes breakage of SciPy in https://github.com/scipy/scipy/issues/14917
At some point we could flip the default to "warn" instead of "no warning"
* make warning conditional on NUMPY_WARN_IF_NO_MEM_POLICY
* add test, fix example code
* fixes from review
* typo
|
|
|
|
|
|
|
| |
* DOC: add release note and move NEP 49 to Final
* fix link
* fix release note
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
Fix #20117
|
| |
|
| |
|
|
|
|
|
| |
* DOC: add example showing how to convert POSIX timestamps to datetime64
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
|\
| |
| | |
DOC: Deindent some sphinx declarations to avoid warnings.
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
ENH: Add `__class_getitem__` to `ndarray`, `dtype` and `number`
|
| | |
|
| | |
|
|\ \
| | |
| | | |
DOC: Added missing C-API functions
|
| | |
| | |
| | | |
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
| |/
| |
| |
| |
| |
| |
| |
| | |
1. PyArray_CopyObject
2. PyArray_MapIterArray
3. PyArray_MapIterSwapAxes
4. PyArray_MapIterNext
5. PyArray_MapIterArrayCopyIfOverlap
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Created fundamentals doc for explanations in ufunc reference doc
* Move explanatory material on ufuncs and broadcasting from the
reference guide to the ufunc fundamentals and/or broadcasting
document in the user guide
* Added examples for ufunc method arguments
* Reorganized broadcasting duplicate content from ufuncs doc
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
| |
|
| |
|
|\
| |
| | |
MAINT: Refactor UFunc core to use NEP 43 style dispatching
|
| |
| |
| |
| | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The first (big) chunk of a multi-step process to update all ufuncs
to NEP 43 style ufuncs.
This limits itself to normal ufunc calls and sets ufunc.at and
all reduce-like operations to the side. These would add another
level of complexity.
|
| |
| |
| | |
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| |
| |
| |
| | |
PyArray_FinalizeFunc.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds the new axis and ndim attributes to the np.AxisError class, an addition inspired by similar
changes introduced to AttributeError in Python 3.10.
It also provided an excuse to update the classes' documentation and tests, both of which were previously rather lacking.
* ENH: Add the `axis` and `ndim` attributes to `np.AxisError`
* MAINT: Let the new `AxisError` attributes survive pickling
* DOC: Update the `AxisError` documentation
* TST: Update the `AxisError` tests
* DOC: Add a release note
* MAINT: Improve the description of `AxisError`s overloaded constructor
* TST: Fix a few typing test failures
* DOC: Clarify a fix a few parts of the `AxisError` docstrings
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
* DOC: Reguide fix
* DOC: Replace `versionadded` with `versionchanged`
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* DOC: Mention that `AxisError` is a `ValueError` and `IndexError` subclass
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* ENH: Delay assembling of the error message until `__str__` is called
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
* DOC: Update the `AxisError` string representation in its docstring
* DOC: Update `versionadded`-related information
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
* DOC: Fix sphinx warnings
Co-authored-by: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |
|
|
|
|
|
| |
* MAINT: Move masked code 1:1 (does not work)
* MAINT: Fixup code move and small follow-up fixes
|
| |
|
|
|
|
|
|
| |
Document that NeighborhoodIterator will point to the begining
of the data instead of the position pointed by iter on creation
in the special case where data is contiguous.
|
|
|
| |
Fixed unsigned integer aliases.
|
|\
| |
| | |
MAINT: Implement new style promotion for `np.result_type`, etc.
|
| |
| |
| |
| |
| |
| |
| | |
This doesn't serve any purpose anymore. The new code is now always
used. (In very few cases this may lead to small slowdowns, this
should only matter in ufuncs where it doesn't seem to matter enough
to worry about it.)
|
| | |
|
| |
| |
| |
| | |
version needed for random c-api
|
| | |
|