Skip to content

Commit d251d1f

Browse files
committed
Revert shape → newshape and suppress deprecation warning.
1 parent 65f3c6b commit d251d1f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ filterwarnings = [
1414
"ignore:`np.bool8` is a deprecated alias for `np.bool_`:DeprecationWarning",
1515
# Coming from pydantic via napari
1616
"ignore:Pickle, copy, and deepcopy support will be removed from itertools in Python 3.14.:DeprecationWarning",
17+
# Until we stop supporting older numpy versions (<2.1)
18+
"ignore:(?s).*`newshape` keyword argument is deprecated.*$:DeprecationWarning",
1719
]
1820
qt_api = "pyqt6"
1921
addopts = [

src/napari_matplotlib/tests/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def fig_to_array(fig: Figure) -> npt.NDArray[np.uint8]:
1515
io_buf.seek(0)
1616
img_arr: npt.NDArray[np.uint8] = np.reshape(
1717
np.frombuffer(io_buf.getvalue(), dtype=np.uint8),
18-
shape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
18+
newshape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
1919
)
2020
return img_arr
2121

0 commit comments

Comments
 (0)