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.
Thanks! There's already a PR for this: plotly/plotly.py#5890 · Replace np.float_ with… (the one-line fix plus a regression test). It was closed until this issue is triaged, so it can be reopened if the maintainers decide it's worth fixing. No need for a duplicate.
Thanks for flagging #5890 — I saw it before opening this one. #5890 was closed with a request to open an issue first, and #5893 is that issue, so #5899 re-proposes the same fix against it (same one-line change and the same regression test, plus a changelog entry). Happy to close #5899 if maintainers would rather reopen #5890 — just let me know which one you prefer.
Activity
FullStraing commentedon Nov 23, 2026
I'll open a PR for this — the one-line fix plus a regression test.
youssef-elaasri commentedon Nov 23, 2026
Thanks! There's already a PR for this: plotly/plotly.py#5890 · Replace np.float_ with… (the one-line fix plus a regression test). It was closed until this issue is triaged, so it can be reopened if the maintainers decide it's worth fixing. No need for a duplicate.
FullStraing commentedon Nov 24, 2026
Thanks for flagging #5890 — I saw it before opening this one. #5890 was closed with a request to open an issue first, and #5893 is that issue, so #5899 re-proposes the same fix against it (same one-line change and the same regression test, plus a changelog entry). Happy to close #5899 if maintainers would rather reopen #5890 — just let me know which one you prefer.