Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: ".*\\.md"
Expand All @@ -20,20 +20,20 @@ repos:
- id: validate-pyproject

- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.35.5
rev: v1.40.0
hooks:
- id: typos
args: [--force-exclude] # omitting --write-changes

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.10
rev: v0.14.7
hooks:
- id: ruff-check
args: [--fix, --unsafe-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
rev: v1.19.0
hooks:
- id: mypy
files: "^src/"
Expand Down
2 changes: 1 addition & 1 deletion src/ndv/views/_jupyter/_array_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def _on_viewer_model_event(self, info: EmissionInfo) -> None:
self._progress_spinner.layout.display = "flex" if value else "none"
elif sig_name == "interaction_mode":
# If leaving CanvasMode.CREATE_ROI, uncheck the ROI button
new, old = info.args
_new, old = info.args
if old == InteractionMode.CREATE_ROI:
self._add_roi_btn.value = False
elif sig_name == "show_histogram_button":
Expand Down
2 changes: 1 addition & 1 deletion src/ndv/views/_pygfx/_array_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def set_range(
cam.show_object(self._scene)

if (bb := self._scene.get_world_bounding_box()) is not None:
width, height, depth = np.ptp(bb, axis=0)
width, height, _depth = np.ptp(bb, axis=0)
if width < 0.01:
width = 1
if height < 0.01:
Expand Down
2 changes: 1 addition & 1 deletion src/ndv/views/_qt/_array_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def _on_viewer_model_event(self, info: EmissionInfo) -> None:
self._qwidget._progress_spinner.setVisible(value)
if sig_name == "interaction_mode":
# If leaving CanvasMode.CREATE_ROI, uncheck the ROI button
new, old = info.args
_new, old = info.args
if old == InteractionMode.CREATE_ROI:
self._qwidget.add_roi_btn.setChecked(False)
elif sig_name == "show_histogram_button":
Expand Down
5 changes: 3 additions & 2 deletions src/ndv/views/_qt/_main_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def wrapper() -> None:
)
return future

@Slot() # type: ignore [misc]
@Slot() # type: ignore[untyped-decorator]
def _invoke_current(self) -> None:
"""Invokes the current callable."""
"""Invokes the current callable."""
if (cb := self._current_callable) is not None:
cb()
Expand All @@ -65,7 +66,7 @@ def call_in_main_thread(
invoker = MainThreadInvoker()
invoker.moveToThread(_APP_THREAD)
_INVOKERS.add(invoker)
return invoker.invoke(func, *args, **kwargs) # type: ignore[no-any-return]
return invoker.invoke(func, *args, **kwargs)

future: Future[T] = Future()
future.set_result(func(*args, **kwargs))
Expand Down
3 changes: 2 additions & 1 deletion src/ndv/views/_vispy/_plot_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ def axis_index(self) -> Literal[0, 1, None]:
return 1
return None

@scene.cameras.PanZoomCamera.rect.setter # type:ignore[misc]
@scene.cameras.PanZoomCamera.rect.setter # type: ignore[untyped-decorator]
def rect(self, args: Any) -> None:
"""Setter for the camera rect."""
# Convert 4-tuple (x, y, w, h) to Rect
if isinstance(args, tuple):
args = geometry.Rect(*args)
Expand Down
2 changes: 1 addition & 1 deletion src/ndv/views/_wx/_array_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def _on_viewer_model_event(self, info: EmissionInfo) -> None:
self._wxwidget._top_info.Layout()
elif sig_name == "interaction_mode":
# If leaving CanvasMode.CREATE_ROI, uncheck the ROI button
new, old = info.args
_new, old = info.args
if old == InteractionMode.CREATE_ROI:
self._wxwidget.add_roi_btn.SetValue(False)
elif sig_name == "show_histogram_button":
Expand Down
Loading