8000 Make AdvancedNew iter more 0-d aware by seberg · Pull Request #3104 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Make AdvancedNew iter more 0-d aware #3104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 1, 2013
Prev Previous commit
Next Next commit
DOC: Add documentation clarifying the use of oa_ndim
  • Loading branch information
seberg committed Mar 3, 2013
commit b66a15e0985eb809f735fb47e3d0ea6317f86406
11 changes: 8 additions & 3 deletions doc/source/reference/c-api.iterator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,12 @@ Construction and Destruction
Extends :cfunc:`NpyIter_MultiNew` with several advanced options providing
more control over broadcasting and buffering.

If 0/NULL values are passed to ``oa_ndim``, ``op_axes``, ``itershape``,
If -1/NULL values are passed to ``oa_ndim``, ``op_axes``, ``itershape``,
and ``buffersize``, it is equivalent to :cfunc:`NpyIter_MultiNew`.

The parameter ``oa_ndim``, when non-zero, specifies the number of
The parameter ``oa_ndim``, when not zero or -1, specifies the number of
dimensions that will be iterated with customized broadcasting.
If it is provided, ``op_axes`` and/or ``itershape`` must also be provided.
If it is provided, ``op_axes`` must and ``itershape`` can also be provided.
The ``op_axes`` parameter let you control in detail how the
axes of the operand arrays get matched together and iterated.
In ``op_axes``, you must provide an array of ``nop`` pointers
Expand All @@ -649,6 +649,11 @@ Construction and Destruction
-1 which means ``newaxis``. Within each ``op_axes[j]`` array, axes
may not be repeated. The following example is how normal broadcasting
applies to a 3-D array, a 2-D array, a 1-D array and a scalar.

**Note**: Before NumPy 1.8 ``oa_ndim == 0` was used for signalling that
that ``op_axes`` and ``itershape`` are unused. This is deprecated and
should be replaced with -1. Better backward compatibility may be
achieved by using :cfunc:`NpyIter_MultiNew` for this case.

.. code-block:: c

Expand Down
0