8000 API: Bump NPY_MAXDIMS to 64 and NPY_MAXARGS to 128 by seberg · Pull Request #24072 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

API: Bump NPY_MAXDIMS to 64 and NPY_MAXARGS to 128 #24072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC: Add release notes for NPY_MAXDIMS and NPY_MAXARG change
  • Loading branch information
seberg committed Jun 28, 2023
commit e6dc43ee9e3ab1cf8ccdcf1b84e6cd249474c741
16 changes: 16 additions & 0 deletions doc/release/upcoming_changes/24071.compatibility.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
``NPY_MAXARGS`` and ``NPY_MAXDIMS`` increased
---------------------------------------------
``NPY_MAXDIMS`` is now 64 and ``NPY_MAXARGS`` is 128, downstream should
not run into issues due to this, as these are typically only used for stack
allocations, such as::

npy_intp shape[NPY_MAXDIMS];

so that an increase is safe. It will increase the stack usage a little.

There is however a possible bigger complication if a downstream library uses
one of these in its public headers.
The library user and library might compile against different versions of
NumPy and thus break ABI compatibility.
In this event the downstream library will have to hard-code the old value or
itself force downstream to recompile (if viable).
3 changes: 3 additions & 0 deletions doc/release/upcoming_changes/24071.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Maximu number of dimensions increased to 64
* The maximum number of operands for some operations such as
``einsum`` was increased to 128 (or close to it).
0