diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-07-27 20:44:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 20:44:03 +0300 |
commit | 6df71138184f26cd87bb086acb1e6b3dc1be4bbf (patch) | |
tree | cba03c2d8a1aad4a5b20c4d076085e4fb506ea11 /doc/source/reference/c-api | |
parent | 7e72cb9ab766fd69804eba922f58f5c4d95f88d1 (diff) | |
parent | cee9c7cd0ce90b94097f9f34f17b7ad18d3d54d3 (diff) | |
download | numpy-6df71138184f26cd87bb086acb1e6b3dc1be4bbf.tar.gz |
Merge pull request #19565 from cmarmo/temp-fix-beyond-basics
DOC: Fix sphinx warnings in c-info.beyond-basics.rst
Diffstat (limited to 'doc/source/reference/c-api')
-rw-r--r-- | doc/source/reference/c-api/array.rst | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst index cb2f4b645..d943ba533 100644 --- a/doc/source/reference/c-api/array.rst +++ b/doc/source/reference/c-api/array.rst @@ -151,6 +151,16 @@ and its sub-types). `numpy.ndarray.item` is identical to PyArray_GETITEM. +.. c:function:: int PyArray_FinalizeFunc(PyArrayObject* arr, PyObject* obj) + + The function pointed to by the CObject + :obj:`~numpy.class.__array_finalize__`. + The first argument is the newly created sub-type. The second argument + (if not NULL) is the "parent" array (if the array was created using + slicing or some other operation where a clearly-distinguishable parent + is present). This routine can do anything it wants to. It should + return a -1 on error and 0 otherwise. + Data access ^^^^^^^^^^^ @@ -1250,8 +1260,8 @@ Converting data types function returns :c:data:`NPY_FALSE`. -New data types -^^^^^^^^^^^^^^ +User-defined data types +^^^^^^^^^^^^^^^^^^^^^^^ .. c:function:: void PyArray_InitArrFuncs(PyArray_ArrFuncs* f) @@ -1295,6 +1305,13 @@ New data types *descr* can be cast safely to a data-type whose type_number is *totype*. +.. c:function:: int PyArray_TypeNumFromName( \ + char const *str) + + Given a string return the type-number for the data-type with that string as + the type-object name. + Returns ``NPY_NOTYPE`` without setting an error if no type can be found. + Only works for user-defined data-types. Special functions for NPY_OBJECT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |