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
{{ message }}
Repository navigation
rescale_intensity in imshow_utils uses np.float_, removed in NumPy 2 #5893
plotly/express/imshow_utils.py (vendored from scikit-image) still returns np.float_ in _output_dtype. NumPy 2.0 removed it, so:
importnumpyasnpfromplotly.express.imshow_utilsimportrescale_intensityrescale_intensity(np.arange(4, dtype=np.uint8), out_range=(0, 1))
# AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.
To be upfront about impact: px.imshow only calls it with out_range=np.uint8, so nothing breaks through the public API. I found this with a static checker, not from a user report, and I didn't find external code that calls rescale_intensity with a pair. It only affects direct callers of this helper. It's the one alias left over from #3997, which removed the other deprecated NumPy types from this file.
The fix is a one-line change (#5890). If it isn't worth the review time, feel free to close both.
Activity