Skip to content

Commit

Permalink
STY: Rename NPY_ITER_DONT_REVERSE_AXES to NPY_ITER_DONT_NEGATE_STRIDE…
Browse files Browse the repository at this point in the history
…S to be more intuitive
  • Loading branch information
mwiebe committed Jan 29, 2011
1 parent ab3dcf8 commit 7bead6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/neps/new-iterator-ufunc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ Construction and Destruction
orders enforce the particular iteration pattern. When using
``NPY_KEEPORDER``, if you also want to ensure that the iteration is
not reversed along an axis, you should pass the flag
``NPY_ITER_DONT_REVERSE_AXES``.
``NPY_ITER_DONT_NEGATE_STRIDES``.

Any of the ``NPY_CASTING`` enum values may be passed to ``casting``.
The values include ``NPY_NO_CASTING``, ``NPY_EQUIV_CASTING``,
Expand Down Expand Up @@ -796,7 +796,7 @@ Construction and Destruction
This flag is incompatible with ``NPY_ITER_C_INDEX``,
``NPY_ITER_F_INDEX``, and ``NPY_ITER_COORDS``.

``NPY_ITER_DONT_REVERSE_AXES``
``NPY_ITER_DONT_NEGATE_STRIDES``

This only affects the iterator when NPY_KEEPORDER is specified
for the order parameter. By default with NPY_KEEPORDER, the
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/include/numpy/ndarraytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ typedef void (*NpyIter_GetCoords_Fn )(NpyIter *iter,
/* Delay allocation of buffers until first Reset* call */
#define NPY_ITER_DELAY_BUFALLOC 0x00000800
/* When NPY_KEEPORDER is specified, disable reversing negative-stride axes */
#define NPY_ITER_DONT_REVERSE_AXES 0x00001000
#define NPY_ITER_DONT_NEGATE_STRIDES 0x00001000

/*** Per-operand flags that may be passed to the iterator constructors ***/

Expand Down
4 changes: 2 additions & 2 deletions numpy/core/src/multiarray/ctors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ PyArray_CopyAnyIntoOrdered(PyArrayObject *dst, PyArrayObject *src,
*/
dst_iter = NpyIter_New(dst, NPY_ITER_WRITEONLY|
NPY_ITER_NO_INNER_ITERATION|
NPY_ITER_DONT_REVERSE_AXES|
NPY_ITER_DONT_NEGATE_STRIDES|
NPY_ITER_REFS_OK,
order,
NPY_NO_CASTING,
Expand All @@ -2299,7 +2299,7 @@ PyArray_CopyAnyIntoOrdered(PyArrayObject *dst, PyArrayObject *src,
}
src_iter = NpyIter_New(src, NPY_ITER_READONLY|
NPY_ITER_NO_INNER_ITERATION|
NPY_ITER_DONT_REVERSE_AXES|
NPY_ITER_DONT_NEGATE_STRIDES|
NPY_ITER_REFS_OK,
order,
NPY_NO_CASTING,
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/new_iterator.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ NpyIter_MultiNew(npy_intp niter, PyArrayObject **op_in, npy_uint32 flags,
* If there's an output being allocated, we must not negate
* any strides.
*/
if (!any_allocate && !(flags&NPY_ITER_DONT_REVERSE_AXES)) {
if (!any_allocate && !(flags&NPY_ITER_DONT_NEGATE_STRIDES)) {
npyiter_flip_negative_strides(iter);
}
itflags = NIT_ITFLAGS(iter);
Expand Down

0 comments on commit 7bead6a

Please sign in to comment.