You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return the number of significant digits to %g-format *value*, assuming that
it is known with an error of *delta*.
"""
if delta == 0:
if value == 0:
# if both value and delta are 0, np.spacing below returns 5e-324
# which results in rather silly results
return 3
# delta = 0 may occur when trying to format values over a tiny range;
# in that case, replace it by the distance to the closest float.
> delta = abs(np.spacing(value))
^^^^^^^^^^^^^^^^^
E RuntimeWarning: invalid value encountered in spacing
lib\matplotlib\cbook.py:2238: RuntimeWarning
Possibly related to the numpy 2.3 release from yesterday.
The test in question is indeed passing np.nan through to np.spacing (eventually), but I'm unsure why it started failing now. Probably NumPy 2.3 is related as you say.
Activity
QuLogic commentedon Jun 11, 2025
The test in question is indeed passing
np.nanthrough tonp.spacing(eventually), but I'm unsure why it started failing now. Probably NumPy 2.3 is related as you say.