Skip to content

Commit c515310

Browse files
committed
Fix sphinx warnings in c-info.beyond-basics.
1 parent 978bbe7 commit c515310

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

doc/source/reference/c-api/array.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,14 @@ New data types
12781278
registered (checked only by the address of the pointer), then
12791279
return the previously-assigned type-number.
12801280
1281+
.. c:function:: int PyArray_TypeNumFromName( \
1282+
char const *str)
1283+
1284+
Given a string return the type-number for the data-type with that string as
1285+
the type-object name.
1286+
Returns NPY_NOTYPE without setting an error if no type can be found.
1287+
Only works for user-defined data-types.
1288+
12811289
.. c:function:: int PyArray_RegisterCastFunc( \
12821290
PyArray_Descr* descr, int totype, PyArray_VectorUnaryFunc* castfunc)
12831291
@@ -2555,6 +2563,10 @@ Broadcasting (multi-iterators)
25552563
through all of the elements (of the broadcasted result), otherwise
25562564
it evaluates FALSE.
25572565
2566+
.. c:function:: int PyArray_MultiIter_SIZE(PyObject* multi)
2567+
2568+
Returne the size of the multi-iterator object.
2569+
25582570
.. c:function:: int PyArray_Broadcast(PyArrayMultiIterObject* mit)
25592571
25602572
This function encapsulates the broadcasting rules. The *mit*

doc/source/user/c-info.beyond-basics.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ iterators so that all that needs to be done to advance to the next element in
172172
each array is for PyArray_ITER_NEXT to be called for each of the inputs. This
173173
incrementing is automatically performed by
174174
:c:func:`PyArray_MultiIter_NEXT` ( ``obj`` ) macro (which can handle a
175-
multiterator ``obj`` as either a :c:expr:`PyArrayMultiObject *` or a
175+
multiterator ``obj`` as either a :c:expr:`PyArrayMultiIterObject *` or a
176176
:c:expr:`PyObject *`). The data from input number ``i`` is available using
177177
:c:func:`PyArray_MultiIter_DATA` ( ``obj``, ``i`` ) and the total (broadcasted)
178178
size as :c:func:`PyArray_MultiIter_SIZE` ( ``obj``). An example of using this
@@ -330,7 +330,7 @@ function :c:func:`PyArray_RegisterCanCast` (from_descr, totype_number,
330330
scalarkind) should be used to specify that the data-type object
331331
from_descr can be cast to the data-type with type number
332332
totype_number. If you are not trying to alter scalar coercion rules,
333-
then use :c:data:`NPY_NOSCALAR` for the scalarkind argument.
333+
then use :c:enumerator:`NPY_NOSCALAR` for the scalarkind argument.
334334
335335
If you want to allow your new data-type to also be able to share in
336336
the scalar coercion rules, then you need to specify the scalarkind
@@ -340,7 +340,7 @@ available to that function). Then, you can register data-types that
340340
can be cast to separately for each scalar kind that may be returned
341341
from your user-defined data-type. If you don't register scalar
342342
coercion handling, then all of your user-defined data-types will be
343-
seen as :c:data:`NPY_NOSCALAR`.
343+
seen as :c:enumerator:`NPY_NOSCALAR`.
344344
345345
346346
Registering a ufunc loop
@@ -472,7 +472,7 @@ The __array_finalize\__ method
472472
members are filled in. Finally, the :obj:`~numpy.class.__array_finalize__`
473473
attribute is looked-up in the object dictionary. If it is present
474474
and not None, then it can be either a CObject containing a pointer
475-
to a :c:func:`PyArray_FinalizeFunc` or it can be a method taking a
475+
to a ``PyArray_FinalizeFunc`` or it can be a method taking a
476476
single argument (which could be None).
477477
478478
If the :obj:`~numpy.class.__array_finalize__` attribute is a CObject, then the pointer

numpy/core/include/numpy/ndarraytypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,8 @@ typedef struct {
13081308
#define PyArray_MultiIter_NOTDONE(multi) \
13091309
(_PyMIT(multi)->index < _PyMIT(multi)->size)
13101310

1311+
#define PyArray_MultiIter_SIZE(multi) \
1312+
_PyMIT(multi)->size
13111313

13121314
/*
13131315
* Store the information needed for fancy-indexing over an array. The

0 commit comments

Comments
 (0)