summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMircea Akos Bruma <bruma.mircea.a@gmail.com>2019-03-19 16:13:56 +0100
committerMircea Akos Bruma <bruma.mircea.a@gmail.com>2019-03-19 16:13:56 +0100
commitb34dbf7019e6e045e2c335e25505fb3fc6d591d8 (patch)
tree1cfd996403f06998d8170890291185311a185ccd /doc
parent17b31fdfaf7cca752de9d3590f5caeb08b3f5c18 (diff)
downloadnumpy-b34dbf7019e6e045e2c335e25505fb3fc6d591d8.tar.gz
DOC: Fix c-api function documentation duplication. #13119
Diffstat (limited to 'doc')
-rw-r--r--doc/source/user/c-info.how-to-extend.rst18
1 files changed, 8 insertions, 10 deletions
diff --git a/doc/source/user/c-info.how-to-extend.rst b/doc/source/user/c-info.how-to-extend.rst
index 9738168d2..8016cfcbd 100644
--- a/doc/source/user/c-info.how-to-extend.rst
+++ b/doc/source/user/c-info.how-to-extend.rst
@@ -362,8 +362,7 @@ specific builtin data-type ( *e.g.* float), while specifying a
particular set of requirements ( *e.g.* contiguous, aligned, and
writeable). The syntax is
-.. c:function:: PyObject *PyArray_FROM_OTF( \
- PyObject* obj, int typenum, int requirements)
+:c:func:`PyArray_FROM_OTF`
Return an ndarray from any Python object, *obj*, that can be
converted to an array. The number of dimensions in the returned
@@ -446,7 +445,7 @@ writeable). The syntax is
flags most commonly needed are :c:data:`NPY_ARRAY_IN_ARRAY`,
:c:data:`NPY_OUT_ARRAY`, and :c:data:`NPY_ARRAY_INOUT_ARRAY`:
- .. c:var:: NPY_ARRAY_IN_ARRAY
+ :c:data:`NPY_ARRAY_IN_ARRAY`
Equivalent to :c:data:`NPY_ARRAY_C_CONTIGUOUS` \|
:c:data:`NPY_ARRAY_ALIGNED`. This combination of flags is useful
@@ -464,7 +463,7 @@ writeable). The syntax is
(although normally such output arrays are created from
scratch).
- .. c:var:: NPY_ARRAY_INOUT_ARRAY
+ :c:data:`NPY_ARRAY_INOUT_ARRAY`
Equivalent to :c:data:`NPY_ARRAY_C_CONTIGUOUS` \|
:c:data:`NPY_ARRAY_ALIGNED` \| :c:data:`NPY_ARRAY_WRITEABLE` \|
@@ -487,16 +486,16 @@ writeable). The syntax is
Other useful flags that can be OR'd as additional requirements are:
- .. c:var:: NPY_ARRAY_FORCECAST
+ :c:data:`NPY_ARRAY_FORCECAST`
Cast to the desired type, even if it can't be done without losing
information.
- .. c:var:: NPY_ARRAY_ENSURECOPY
+ :c:data:`NPY_ARRAY_ENSURECOPY`
Make sure the resulting array is a copy of the original.
- .. c:var:: NPY_ARRAY_ENSUREARRAY
+ :c:data:`NPY_ARRAY_ENSUREARRAY`
Make sure the resulting object is an actual ndarray and not a sub-
class.
@@ -523,7 +522,7 @@ creation functions go through this heavily re-used code. Because of
its flexibility, it can be somewhat confusing to use. As a result,
simpler forms exist that are easier to use.
-.. c:function:: PyObject *PyArray_SimpleNew(int nd, npy_intp* dims, int typenum)
+:c:func:`PyArray_SimpleNew`
This function allocates new memory and places it in an ndarray
with *nd* dimensions whose shape is determined by the array of
@@ -535,8 +534,7 @@ simpler forms exist that are easier to use.
memory for the array can be set to zero if desired using
:c:func:`PyArray_FILLWBYTE` (return_object, 0).
-.. c:function:: PyObject *PyArray_SimpleNewFromData( \
- int nd, npy_intp* dims, int typenum, void* data)
+:c:func:`PyArray_SimpleNewFromData`
Sometimes, you want to wrap memory allocated elsewhere into an
ndarray object for downstream use. This routine makes it