summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authortakanori-pskq <takanori17h@gmail.com>2020-10-22 17:01:47 +0900
committertakanori-pskq <takanori17h@gmail.com>2020-10-22 17:01:47 +0900
commit44b7698b9bba6b9212498e3659cede7d14a8b79a (patch)
tree998c9096e572e1a2c6e433deb72d8e30f6e9c33b /doc/source/reference
parentd87800a3c619a9cd051b5fac63a8486b48fb1c1c (diff)
downloadnumpy-44b7698b9bba6b9212498e3659cede7d14a8b79a.tar.gz
DOC: Fixup
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/c-api/array.rst33
1 files changed, 16 insertions, 17 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index ff8e911bf..c737690d4 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,17 +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_FEATURE_VERSION
-
- The current version of the API. :c:data:`NPY_FEATURE_VERSION` changes
- whenever the API changes (e.g. a function is added).
-
.. c:macro:: NPY_FALSE
Defined as 0 for use with Bool.