Skip to content

Commit d437948

Browse files
committed
Update pre-commit hooks
1 parent 9e6c5af commit d437948

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ repos:
2222
- id: napari-plugin-checks
2323

2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.3.0
25+
rev: v1.4.1
2626
hooks:
2727
- id: mypy
2828
additional_dependencies: [numpy, matplotlib]
2929

3030
- repo: https://github.com/charliermarsh/ruff-pre-commit
3131
# Ruff version.
32-
rev: 'v0.0.272'
32+
rev: 'v0.0.275'
3333
hooks:
3434
- id: ruff
3535

examples/features_scatter.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
import napari
77
import numpy as np
8+
import numpy.typing as npt
89
from skimage.measure import regionprops_table
910

1011
# make a test label image
11-
label_image = np.zeros((100, 100), dtype=np.uint16)
12+
label_image: npt.NDArray[np.uint16] = np.zeros((100, 100), dtype=np.uint16)
1213

1314
label_image[10:20, 10:20] = 1
1415
label_image[50:70, 50:70] = 2

src/napari_matplotlib/tests/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def fig_to_array(fig: Figure) -> npt.NDArray[np.uint8]:
1313
with BytesIO() as io_buf:
1414
fig.savefig(io_buf, format="raw")
1515
io_buf.seek(0)
16-
img_arr = np.reshape(
16+
img_arr: npt.NDArray[np.uint8] = np.reshape(
1717
np.frombuffer(io_buf.getvalue(), dtype=np.uint8),
1818
newshape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
1919
)

src/napari_matplotlib/tests/scatter/test_scatter_features.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_features_scatter_widget_2D(
3636
def make_labels_layer_with_features() -> (
3737
Tuple[npt.NDArray[np.uint16], Dict[str, Any]]
3838
):
39-
label_image = np.zeros((100, 100), dtype=np.uint16)
39+
label_image: npt.NDArray[np.uint16] = np.zeros((100, 100), dtype=np.uint16)
4040
for label_value, start_index in enumerate([10, 30, 50], start=1):
4141
end_index = start_index + 10
4242
label_image[start_index:end_index, start_index:end_index] = label_value

0 commit comments

Comments
 (0)