Skip to content

Commit ad01d2a

Browse files
committed
Switch reshape to shape and drop support for old numpy versions.
1 parent 6027e7c commit ad01d2a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.13.1
10+
rev: v0.14.10
1111
hooks:
1212
- id: ruff-format
1313

@@ -17,14 +17,14 @@ repos:
1717
- id: napari-plugin-checks
1818

1919
- repo: https://github.com/pre-commit/mirrors-mypy
20-
rev: v1.18.2
20+
rev: v1.19.1
2121
hooks:
22-
- id: mypy
23-
additional_dependencies: [numpy, matplotlib]
22+
- id: mypy
23+
additional_dependencies: [numpy>=2, matplotlib]
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
2626
# Ruff version.
27-
rev: 'v0.13.1'
27+
rev: "v0.14.10"
2828
hooks:
2929
- id: ruff
3030

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ packages = find:
2929
install_requires =
3030
matplotlib
3131
napari>=0.5
32-
numpy>=1.23
32+
numpy>=2
3333
tinycss2
3434
python_requires = >=3.11
3535
include_package_data = True

src/napari_matplotlib/tests/helpers.py

Lines changed: 1 addition & 1 deletion
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-
newshape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
18+
shape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
1919
)
2020
return img_arr
2121

0 commit comments

Comments
 (0)