Skip to content

Commit 384e1d7

Browse files
ci(pre-commit.ci): autoupdate (#148)
* ci(pre-commit.ci): autoupdate updates: - [github.com/crate-ci/typos: typos-dict-v0.12.4 → v1.30.0](crate-ci/typos@typos-dict-v0.12.4...v1.30.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.9](astral-sh/ruff-pre-commit@v0.9.4...v0.9.9) - [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](pre-commit/mirrors-mypy@v1.14.1...v1.15.0) * change typos * fix typos * update pre-commit --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Talley Lambert <[email protected]>
1 parent 371a878 commit 384e1d7

11 files changed

+18
-19
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ ci:
55

66
repos:
77
- repo: https://github.com/abravalheri/validate-pyproject
8-
rev: v0.23
8+
rev: v0.24
99
hooks:
1010
- id: validate-pyproject
1111

1212
- repo: https://github.com/crate-ci/typos
13-
rev: typos-dict-v0.12.4
13+
rev: v1.30.1
1414
hooks:
1515
- id: typos
1616
args: [--force-exclude] # omitting --write-changes
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.9.4
19+
rev: v0.11.0
2020
hooks:
2121
- id: ruff
2222
args: [--fix, --unsafe-fixes]
2323
- id: ruff-format
2424

2525
- repo: https://github.com/pre-commit/mirrors-mypy
26-
rev: v1.14.1
26+
rev: v1.15.0
2727
hooks:
2828
- id: mypy
2929
files: "^src/"

examples/cookbook/microscope_dashboard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def _make_button(txt: str, *data: Any) -> QtW.QPushButton:
111111
layout.addLayout(row)
112112

113113
def _move_stage(self) -> None:
114-
button = cast(QtW.QPushButton, self.sender())
114+
button = cast("QtW.QPushButton", self.sender())
115115
ax, spin = button.property(self._data_key)
116116
step = 1 if button.text() == "+" else -1
117-
cast(QtW.QDoubleSpinBox, spin).stepBy(step)
117+
cast("QtW.QDoubleSpinBox", spin).stepBy(step)
118118
self.stageMoved.emit(ax, step)
119119

120120

src/ndv/models/_array_display_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class ArrayDisplayModel(NDVModel):
193193
@property
194194
def n_visible_axes(self) -> Literal[2, 3]:
195195
"""Number of dims is derived from the length of `visible_axes`."""
196-
return cast(Literal[2, 3], len(self.visible_axes))
196+
return cast("Literal[2, 3]", len(self.visible_axes))
197197

198198
@model_validator(mode="after")
199199
def _validate_model(self) -> "Self":

src/ndv/models/_data_display_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def process_request(req: DataRequest) -> DataResponse:
264264
if i is None:
265265
ch_data = data
266266
else:
267-
ch_keepdims = (slice(None),) * cast(int, ch_ax) + (i,) + (None,)
267+
ch_keepdims = (slice(None),) * cast("int", ch_ax) + (i,) + (None,)
268268
ch_data = data[ch_keepdims]
269269
data_response[i] = ch_data.transpose(*t_dims).squeeze()
270270

src/ndv/views/_app.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from functools import cache, wraps
88
from typing import TYPE_CHECKING, Any, Callable, Protocol, cast
99

10-
from ndv.views.bases._app import NDVApp
11-
1210
if TYPE_CHECKING:
1311
from collections.abc import Iterator
1412
from concurrent.futures import Future
@@ -17,6 +15,7 @@
1715
from typing_extensions import ParamSpec, TypeVar
1816

1917
from ndv.views.bases import ArrayCanvas, ArrayView, HistogramCanvas
18+
from ndv.views.bases._app import NDVApp
2019
from ndv.views.bases._graphics._mouseable import Mouseable
2120

2221
T = TypeVar("T")
@@ -169,7 +168,7 @@ def _running_apps() -> Iterator[GuiFrontend]:
169168
def _load_app(module: str, cls_name: str) -> NDVApp:
170169
mod = importlib.import_module(module)
171170
cls = getattr(mod, cls_name)
172-
return cast(NDVApp, cls())
171+
return cast("NDVApp", cls())
173172

174173

175174
@cache # not allowed to change

src/ndv/views/_jupyter/_app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def is_running(self) -> bool:
3030
def create_app(self) -> Any:
3131
if not self.is_running() and not os.getenv("PYTEST_CURRENT_TEST"):
3232
# if we got here, it probably means that someone used
33-
# NDV_GUI_FRONTEND=jupyter without actually being in a juptyer notebook
33+
# NDV_GUI_FRONTEND=jupyter without actually being in a jupyter notebook
3434
# we allow it in tests, but not in normal usage.
3535
raise RuntimeError( # pragma: no cover
3636
"Jupyter is not running a notebook shell. Cannot create app."

src/ndv/views/_vispy/_array_canvas.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ def set_range(
434434
_z[0] = min(_z[0], v[2])
435435
_z[1] = max(_z[1], v[2])
436436

437-
x = cast(tuple[float, float], _x) if x is None else x
438-
y = cast(tuple[float, float], _y) if y is None else y
439-
z = cast(tuple[float, float], _z) if z is None else z
437+
x = cast("tuple[float, float]", _x) if x is None else x
438+
y = cast("tuple[float, float]", _y) if y is None else y
439+
z = cast("tuple[float, float]", _z) if z is None else z
440440

441441
is_3d = isinstance(self._camera, scene.ArcballCamera)
442442
if is_3d:

src/ndv/views/_wx/_array_view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _add_histogram(self, histogram: wx.Window) -> None:
166166
self._show_histogram(True)
167167

168168
def _show_histogram(self, show: bool = True) -> None:
169-
if hist := cast(wx.Window, self._histogram):
169+
if hist := cast("wx.Window", self._histogram):
170170
# Display the histogram
171171
hist.Show(show)
172172

src/ndv/views/bases/_array_view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ArrayView(Viewable):
2323
"""ABC for ND Array viewers widget.
2424
2525
Currently, this is the "main" widget that contains the array display and
26-
all the controls for interacting with the array, includings sliders, LUTs,
26+
all the controls for interacting with the array, including sliders, LUTs,
2727
and histograms.
2828
"""
2929

tests/views/_qt/test_array_view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ def test_histogram(viewer: QtArrayView) -> None:
6262
# Test adding the histogram widget puts it on the relevant lut
6363
assert lut._qwidget._histogram is None
6464
histogram = get_histogram_canvas_class()() # will raise if not supported
65-
histogram_wdg = cast(QWidget, histogram.frontend_widget())
65+
histogram_wdg = cast("QWidget", histogram.frontend_widget())
6666
viewer.add_histogram(channel, histogram_wdg)
6767
assert lut._qwidget._histogram is not None

tests/views/_wx/test_array_view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ def processEvent(evt: wx.PyEventBinder, wdg: wx.Control) -> None:
6969
# Test adding the histogram widget puts it on the relevant lut
7070
assert len(lut._wxwidget.sizer.GetChildren()) == 1
7171
histogram = get_histogram_canvas_class()() # will raise if not supported
72-
histogram_wdg = cast(wx.Window, histogram.frontend_widget())
72+
histogram_wdg = cast("wx.Window", histogram.frontend_widget())
7373
viewer.add_histogram(channel, histogram_wdg)
7474
assert len(lut._wxwidget.sizer.GetChildren()) == 2

0 commit comments

Comments
 (0)