Skip to content

Commit

Permalink
DOC: Add release snippets for iteration changes (numpy#28081)
Browse files Browse the repository at this point in the history
* DOC: Add release snippets for iteration changes

Adds a snippet (maybe long?) for iteration order changes and a brief
bullet point about the new public function.

* DOC: fixup bullet point formatting

[skip azp] [skip cirrus] [skip actions]

* Address review comments

[skip azp] [skip cirrus] [skip actions]
  • Loading branch information
seberg authored Jan 2, 2025
1 parent dfb0005 commit f3e78d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/release/upcoming_changes/27883.c_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `NpyIter_GetTransferFlags` is now available to check if
the iterator needs the Python API or if casts may cause floating point
errors (FPE). FPEs can for example be set when casting ``float64(1e300)``
to ``float32`` (overflow to infinity) or a NaN to an integer (invalid value).
17 changes: 17 additions & 0 deletions doc/release/upcoming_changes/27883.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Changes to the main iterator and potential numerical changes
------------------------------------------------------------
The main iterator, used in math functions and via ``np.nditer`` from Python
and ``NpyIter`` in C, now behaves differently for some buffered iterations.
This means that:

* The buffer size used will often be smaller than the maximum buffer sized
allowed by the ``buffersize`` parameter.
* The "growinner" flag is now honored with buffered reductions when no operand
requires buffering.

For ``np.sum()`` such changes in buffersize may slightly change numerical
results of floating point operations.
Users who use "growinner" for custom reductions could notice
changes in precision (for example, in NumPy we removed it from
``einsum`` to avoid most precision changes and improve precision
for some 64bit floating point inputs).

0 comments on commit f3e78d7

Please sign in to comment.