Skip to content

Commit

Permalink
DOC: Unwrap long signature lines
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
MSeifert04 committed Mar 27, 2017
1 parent 0a1697f commit 5b0e3aa
Show file tree
Hide file tree
Showing 7 changed files with 369 additions and 166 deletions.
331 changes: 228 additions & 103 deletions doc/source/reference/c-api.array.rst

Large diffs are not rendered by default.

34 changes: 24 additions & 10 deletions doc/source/reference/c-api.iterator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ an incomplete struct.
Construction and Destruction
----------------------------

.. c:function:: NpyIter* NpyIter_New(PyArrayObject* op, npy_uint32 flags, NPY_ORDER order, NPY_CASTING casting, PyArray_Descr* dtype)
.. c:function:: NpyIter* NpyIter_New( \
PyArrayObject* op, npy_uint32 flags, NPY_ORDER order, \
NPY_CASTING casting, PyArray_Descr* dtype)
Creates an iterator for the given numpy array object ``op``.
Expand Down Expand Up @@ -282,7 +284,9 @@ Construction and Destruction
dtype);
Py_DECREF(dtype);
.. c:function:: NpyIter* NpyIter_MultiNew(npy_intp nop, PyArrayObject** op, npy_uint32 flags, NPY_ORDER order, NPY_CASTING casting, npy_uint32* op_flags, PyArray_Descr** op_dtypes)
.. c:function:: NpyIter* NpyIter_MultiNew( \
npy_intp nop, PyArrayObject** op, npy_uint32 flags, NPY_ORDER order, \
NPY_CASTING casting, npy_uint32* op_flags, PyArray_Descr** op_dtypes)
Creates an iterator for broadcasting the ``nop`` array objects provided
in ``op``, using regular NumPy broadcasting rules.
Expand Down Expand Up @@ -620,7 +624,10 @@ Construction and Destruction
This flag has effect only if ``NPY_ITER_COPY_IF_OVERLAP`` is enabled
on the iterator.
.. c:function:: NpyIter* NpyIter_AdvancedNew(npy_intp nop, PyArrayObject** op, npy_uint32 flags, NPY_ORDER order, NPY_CASTING casting, npy_uint32* op_flags, PyArray_Descr** op_dtypes, int oa_ndim, int** op_axes, npy_intp* itershape, npy_intp buffersize)
.. c:function:: NpyIter* NpyIter_AdvancedNew( \
npy_intp nop, PyArrayObject** op, npy_uint32 flags, NPY_ORDER order, \
NPY_CASTING casting, npy_uint32* op_flags, PyArray_Descr** op_dtypes, \
int oa_ndim, int** op_axes, npy_intp* itershape, npy_intp buffersize)
Extends :c:func:`NpyIter_MultiNew` with several advanced options providing
more control over broadcasting and buffering.
Expand Down Expand Up @@ -765,7 +772,8 @@ Construction and Destruction
non-NULL, the function may be safely called without holding
the Python GIL.
.. c:function:: int NpyIter_ResetToIterIndexRange(NpyIter* iter, npy_intp istart, npy_intp iend, char** errmsg)
.. c:function:: int NpyIter_ResetToIterIndexRange( \
NpyIter* iter, npy_intp istart, npy_intp iend, char** errmsg)
Resets the iterator and restricts it to the ``iterindex`` range
``[istart, iend)``. See :c:func:`NpyIter_Copy` for an explanation of
Expand All @@ -792,7 +800,8 @@ Construction and Destruction
non-NULL, the function may be safely called without holding
the Python GIL.

.. c:function:: int NpyIter_ResetBasePointers(NpyIter *iter, char** baseptrs, char** errmsg)
.. c:function:: int NpyIter_ResetBasePointers( \
NpyIter *iter, char** baseptrs, char** errmsg)
Resets the iterator back to its initial state, but using the values
in ``baseptrs`` for the data instead of the pointers from the arrays
Expand Down Expand Up @@ -889,7 +898,8 @@ Construction and Destruction
Gets the ``iterindex`` of the iterator, which is an index matching
the iteration order of the iterator.
.. c:function:: void NpyIter_GetIterIndexRange(NpyIter* iter, npy_intp* istart, npy_intp* iend)
.. c:function:: void NpyIter_GetIterIndexRange( \
NpyIter* iter, npy_intp* istart, npy_intp* iend)
Gets the ``iterindex`` sub-range that is being iterated. If
:c:data:`NPY_ITER_RANGED` was not specified, this always returns the
Expand Down Expand Up @@ -1042,7 +1052,8 @@ Construction and Destruction
Fills ``nop`` flags. Sets ``outwriteflags[i]`` to 1 if
``op[i]`` can be written to, and to 0 if not.
.. c:function:: int NpyIter_CreateCompatibleStrides(NpyIter* iter, npy_intp itemsize, npy_intp* outstrides)
.. c:function:: int NpyIter_CreateCompatibleStrides( \
NpyIter* iter, npy_intp itemsize, npy_intp* outstrides)
Builds a set of strides which are the same as the strides of an
output array created using the :c:data:`NPY_ITER_ALLOCATE` flag, where NULL
Expand Down Expand Up @@ -1096,7 +1107,8 @@ Construction and Destruction
Functions For Iteration
-----------------------
.. c:function:: NpyIter_IterNextFunc* NpyIter_GetIterNext(NpyIter* iter, char** errmsg)
.. c:function:: NpyIter_IterNextFunc* NpyIter_GetIterNext( \
NpyIter* iter, char** errmsg)
Returns a function pointer for iteration. A specialized version
of the function pointer may be calculated by this function
Expand Down Expand Up @@ -1194,7 +1206,8 @@ Functions For Iteration
}
} while (iternext());
.. c:function:: NpyIter_GetMultiIndexFunc *NpyIter_GetGetMultiIndex(NpyIter* iter, char** errmsg)
.. c:function:: NpyIter_GetMultiIndexFunc *NpyIter_GetGetMultiIndex( \
NpyIter* iter, char** errmsg)
Returns a function pointer for getting the current multi-index
of the iterator. Returns NULL if the iterator is not tracking
Expand Down Expand Up @@ -1264,7 +1277,8 @@ functions provide that information.
iteration, in particular if buffering is enabled. This function
may be safely called without holding the Python GIL.
.. c:function:: void NpyIter_GetInnerFixedStrideArray(NpyIter* iter, npy_intp* out_strides)
.. c:function:: void NpyIter_GetInnerFixedStrideArray( \
NpyIter* iter, npy_intp* out_strides)
Gets an array of strides which are fixed, or will not change during
the entire iteration. For strides that may change, the value
Expand Down
34 changes: 24 additions & 10 deletions doc/source/reference/c-api.types-and-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ PyArrayDescr_Type
functions can (and must) deal with mis-behaved arrays. The other
functions require behaved memory segments.

.. c:member:: void cast(void *from, void *to, npy_intp n, void *fromarr, void *toarr)
.. c:member:: void cast( \
void *from, void *to, npy_intp n, void *fromarr, void *toarr)
An array of function pointers to cast from the current type to
all of the other builtin types. Each function casts a
Expand All @@ -446,7 +447,9 @@ PyArrayDescr_Type
a zero is returned, otherwise, a negative one is returned (and
a Python error set).
.. c:member:: void copyswapn(void *dest, npy_intp dstride, void *src, npy_intp sstride, npy_intp n, int swap, void *arr)
.. c:member:: void copyswapn( \
void *dest, npy_intp dstride, void *src, npy_intp sstride, \
npy_intp n, int swap, void *arr)
.. c:member:: void copyswap(void *dest, void *src, int swap, void *arr)
Expand All @@ -472,7 +475,8 @@ PyArrayDescr_Type
``d2``, and -1 if * ``d1`` < * ``d2``. The array object ``arr`` is
used to retrieve itemsize and field information for flexible arrays.
.. c:member:: int argmax(void* data, npy_intp n, npy_intp* max_ind, void* arr)
.. c:member:: int argmax( \
void* data, npy_intp n, npy_intp* max_ind, void* arr)
A pointer to a function that retrieves the index of the
largest of ``n`` elements in ``arr`` beginning at the element
Expand All @@ -481,7 +485,9 @@ PyArrayDescr_Type
always 0. The index of the largest element is returned in
``max_ind``.
.. c:member:: void dotfunc(void* ip1, npy_intp is1, void* ip2, npy_intp is2, void* op, npy_intp n, void* arr)
.. c:member:: void dotfunc( \
void* ip1, npy_intp is1, void* ip2, npy_intp is2, void* op, \
npy_intp n, void* arr)
A pointer to a function that multiplies two ``n`` -length
sequences together, adds them, and places the result in
Expand Down Expand Up @@ -531,7 +537,8 @@ PyArrayDescr_Type
computed by repeatedly adding this computed delta. The data
buffer must be well-behaved.
.. c:member:: void fillwithscalar(void* buffer, npy_intp length, void* value, void* arr)
.. c:member:: void fillwithscalar( \
void* buffer, npy_intp length, void* value, void* arr)
A pointer to a function that fills a contiguous ``buffer`` of
the given ``length`` with a single scalar ``value`` whose
Expand All @@ -546,7 +553,8 @@ PyArrayDescr_Type
and :c:data:`NPY_MERGESORT` are defined). These sorts are done
in-place assuming contiguous and aligned data.
.. c:member:: int argsort(void* start, npy_intp* result, npy_intp length, void *arr)
.. c:member:: int argsort( \
void* start, npy_intp* result, npy_intp length, void *arr)
An array of function pointers to sorting algorithms for this
data type. The same sorting algorithms as for sort are
Expand Down Expand Up @@ -584,15 +592,17 @@ PyArrayDescr_Type
can be cast to safely (this usually means without losing
precision).
.. c:member:: void fastclip(void *in, npy_intp n_in, void *min, void *max, void *out)
.. c:member:: void fastclip( \
void *in, npy_intp n_in, void *min, void *max, void *out)
A function that reads ``n_in`` items from ``in``, and writes to
``out`` the read value if it is within the limits pointed to by
``min`` and ``max``, or the corresponding limit if outside. The
memory segments must be contiguous and behaved, and either
``min`` or ``max`` may be ``NULL``, but not both.
.. c:member:: void fastputmask(void *in, void *mask, npy_intp n_in, void *values, npy_intp nv)
.. c:member:: void fastputmask( \
void *in, void *mask, npy_intp n_in, void *values, npy_intp nv)
A function that takes a pointer ``in`` to an array of ``n_in``
items, a pointer ``mask`` to an array of ``n_in`` boolean
Expand All @@ -601,7 +611,10 @@ PyArrayDescr_Type
in ``mask`` is non-zero, tiling ``vals`` as needed if
``nv < n_in``. All arrays must be contiguous and behaved.
.. c:member:: void fasttake(void *dest, void *src, npy_intp *indarray, npy_intp nindarray, npy_intp n_outer, npy_intp m_middle, npy_intp nelem, NPY_CLIPMODE clipmode)
.. c:member:: void fasttake( \
void *dest, void *src, npy_intp *indarray, npy_intp nindarray, \
npy_intp n_outer, npy_intp m_middle, npy_intp nelem, \
NPY_CLIPMODE clipmode)
A function that takes a pointer ``src`` to a C contiguous,
behaved segment, interpreted as a 3-dimensional array of shape
Expand All @@ -617,7 +630,8 @@ PyArrayDescr_Type
indices smaller than 0 or larger than ``nindarray`` will be
handled.
.. c:member:: int argmin(void* data, npy_intp n, npy_intp* min_ind, void* arr)
.. c:member:: int argmin( \
void* data, npy_intp n, npy_intp* min_ind, void* arr)
A pointer to a function that retrieves the index of the
smallest of ``n`` elements in ``arr`` beginning at the element
Expand Down
Loading

0 comments on commit 5b0e3aa

Please sign in to comment.