@@ -1949,7 +1949,7 @@ Calculation
1949
1949
1950
1950
.. tip::
1951
1951
1952
- Pass in :c:data:`NPY_MAXDIMS ` for axis in order to achieve the same
1952
+ Pass in :c:data:`NPY_RAVEL_AXIS ` for axis in order to achieve the same
1953
1953
effect that is obtained by passing in ``axis=None`` in Python
1954
1954
(treating the array as a 1-d array).
1955
1955
@@ -2968,7 +2968,7 @@ to.
2968
2968
Convert a Python object, *obj*, representing an axis argument to
2969
2969
the proper value for passing to the functions that take an integer
2970
2970
axis. Specifically, if *obj* is None, *axis* is set to
2971
- :c:data:`NPY_MAXDIMS ` which is interpreted correctly by the C-API
2971
+ :c:data:`NPY_RAVEL_AXIS ` which is interpreted correctly by the C-API
2972
2972
functions that take axis arguments.
2973
2973
2974
2974
.. c:function:: int PyArray_BoolConverter(PyObject* obj, npy_bool* value)
@@ -3411,14 +3411,26 @@ Other constants
3411
3411
3412
3412
.. c:macro:: NPY_MAXDIMS
3413
3413
3414
+ The maximum number of dimensions that may be used by NumPy.
3415
+ This is set to 64 and was 32 before NumPy 2.
3416
+
3414
3417
.. note::
3415
- NumPy used to have a maximum number of dimensions set to 32 and now 64.
3416
- This was/is mostly useful for stack allocations. We now ask you to
3417
- define (and test) such a limit in your own project if needed.
3418
+ We encourage you to avoid ``NPY_MAXDIMS``. A future version of NumPy
3419
+ may wish to remove any dimension limitation (and thus the constant).
3420
+ The limitation was created mainly a simplification for the liberal use
3421
+ of small stack allocations as scratch space.
3422
+
3423
+ If your algorithm has a reasonable maximum number of dimension you
3424
+ could check and use that locally.
3418
3425
3419
3426
.. c:macro:: NPY_MAXARGS
3420
3427
3421
- The maximum number of array arguments that can be used in functions.
3428
+ The maximum number of array arguments that can be used in in some
3429
+ functions. This used to be 32 before NumPy 2 and is now 64.
3430
+
3431
+ .. note::
3432
+ You should never use this. We may remove it in future versions of
3433
+ NumPy.
3422
3434
3423
3435
.. c:macro:: NPY_FALSE
3424
3436
@@ -3438,6 +3450,14 @@ Other constants
3438
3450
The return value of successful converter functions which are called
3439
3451
using the "O&" syntax in :c:func:`PyArg_ParseTuple`-like functions.
3440
3452
3453
+ .. c:macro:: NPY_RAVEL_AXIS
3454
+
3455
+ Some NumPy functions (mainly the C-entrypoints for Python functions)
3456
+ have an ``axis`` argument. This macro may be passed for ``axis=None``.
3457
+
3458
+ .. note::
3459
+ This macro is a NumPy version dependent at runtime.
3460
+
3441
3461
3442
3462
Miscellaneous Macros
3443
3463
~~~~~~~~~~~~~~~~~~~~
0 commit comments