Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73be58f

Browse files
committed
DOC: Add errstate changes release note and note to setbufsize.
1 parent fab91cd commit 73be58f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* Being fully context and thread-safe, ``np.errstate`` can only
2+
be entered once now. It is possible to enter it again after
3+
exiting first.
4+
* ``np.setbufsize`` is now tied to ``np.errstate()``: Leaving an
5+
``np.errstate`` context will also reset the ``bufsize``.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``np.errstate()`` is now faster and context safe
2+
------------------------------------------------
3+
The `np.errstate` context manager/decorator is now faster and
4+
safer. Previously, it was not context save and had (rarely)
5+
issues with thread-safety.

numpy/core/_ufunc_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ def setbufsize(size):
156156
"""
157157
Set the size of the buffer used in ufuncs.
158158
159+
.. versionchanged:: 2.0
160+
The scope of setting the buffer is tied to the `np.errstate` context.
161+
Exiting a ``with errstate():` will also restore the bufsize.
162+
159163
Parameters
160164
----------
161165
size : int

0 commit comments

Comments
 (0)