diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-05-26 20:48:02 -0700 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-06-15 11:42:02 -0700 |
commit | baaeb9a16c9c28683db97c4fc3d047e86d32a0c5 (patch) | |
tree | 0070a9e10de564c6d6b7d66548419e684cfca77c /numpy/core/numeric.py | |
parent | 2a6a3931c0af78180fa6984fd09bc0264c156fd0 (diff) | |
download | numpy-baaeb9a16c9c28683db97c4fc3d047e86d32a0c5.tar.gz |
WIP: Add warning context manager and fix min_scalar for new promotion
Even the new promotion has to use the min-scalar logic to avoid
picking up a float16 loop for `np.int8(3) * 3.`.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index bb3cbf054..38d85da6e 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -27,7 +27,7 @@ from .umath import (multiply, invert, sin, PINF, NAN) from . import numerictypes from .numerictypes import longlong, intc, int_, float_, complex_, bool_ from ._exceptions import TooHardError, AxisError -from ._ufunc_config import errstate +from ._ufunc_config import errstate, no_nep50_warning bitwise_not = invert ufunc = type(sin) @@ -2352,7 +2352,7 @@ def isclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False): array([False, True]) """ def within_tol(x, y, atol, rtol): - with errstate(invalid='ignore'): + with errstate(invalid='ignore'), no_nep50_warning(): return less_equal(abs(x-y), atol + rtol * abs(y)) x = asanyarray(a) |