summaryrefslogtreecommitdiff
path: root/doc/source/reference/c-api/array.rst
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-10-22 11:36:08 +0300
committerGitHub <noreply@github.com>2020-10-22 11:36:08 +0300
commit395b754902c6a31ee34d4a985bf612d712c25b08 (patch)
tree75aeea3756f538951f4c2df3e59b4d7511e015e6 /doc/source/reference/c-api/array.rst
parent84626f2cdf1e14fcd5acfad5169afbe6830a0bed (diff)
parent44b7698b9bba6b9212498e3659cede7d14a8b79a (diff)
downloadnumpy-395b754902c6a31ee34d4a985bf612d712c25b08.tar.gz
Merge pull request #17570 from takanori-pskq/i13114-feature-version
DOC: Add the entry for ``NPY_FEATURE_VERSION``
Diffstat (limited to 'doc/source/reference/c-api/array.rst')
-rw-r--r--doc/source/reference/c-api/array.rst28
1 files changed, 16 insertions, 12 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index 3a024e203..68547fd45 100644
--- a/doc/source/reference/c-api/array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -3139,21 +3139,31 @@ calling the function). That's why several functions are provided to check for
numpy versions. The macros :c:data:`NPY_VERSION` and
:c:data:`NPY_FEATURE_VERSION` corresponds to the numpy version used to build the
extension, whereas the versions returned by the functions
-PyArray_GetNDArrayCVersion and PyArray_GetNDArrayCFeatureVersion corresponds to
-the runtime numpy's version.
+:c:func:`PyArray_GetNDArrayCVersion` and :c:func:`PyArray_GetNDArrayCFeatureVersion`
+corresponds to the runtime numpy's version.
The rules for ABI and API compatibilities can be summarized as follows:
- * Whenever :c:data:`NPY_VERSION` != PyArray_GetNDArrayCVersion, the
+ * Whenever :c:data:`NPY_VERSION` != ``PyArray_GetNDArrayCVersion()``, the
extension has to be recompiled (ABI incompatibility).
- * :c:data:`NPY_VERSION` == PyArray_GetNDArrayCVersion and
- :c:data:`NPY_FEATURE_VERSION` <= PyArray_GetNDArrayCFeatureVersion means
+ * :c:data:`NPY_VERSION` == ``PyArray_GetNDArrayCVersion()`` and
+ :c:data:`NPY_FEATURE_VERSION` <= ``PyArray_GetNDArrayCFeatureVersion()`` means
backward compatible changes.
ABI incompatibility is automatically detected in every numpy's version. API
incompatibility detection was added in numpy 1.4.0. If you want to supported
many different numpy versions with one extension binary, you have to build your
-extension with the lowest NPY_FEATURE_VERSION as possible.
+extension with the lowest :c:data:`NPY_FEATURE_VERSION` as possible.
+
+.. c:macro:: NPY_VERSION
+
+ The current version of the ndarray object (check to see if this
+ variable is defined to guarantee the ``numpy/arrayobject.h`` header is
+ being used).
+
+.. c:macro:: NPY_FEATURE_VERSION
+
+ The current version of the C-API.
.. c:function:: unsigned int PyArray_GetNDArrayCVersion(void)
@@ -3437,12 +3447,6 @@ Other constants
The maximum number of array arguments that can be used in functions.
-.. c:macro:: NPY_VERSION
-
- The current version of the ndarray object (check to see if this
- variable is defined to guarantee the numpy/arrayobject.h header is
- being used).
-
.. c:macro:: NPY_FALSE
Defined as 0 for use with Bool.