Skip to content

ci: [pre-commit.ci] autoupdate #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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,24 +5,24 @@ ci:

repos:
- repo: https://github.com/crate-ci/typos
rev: dictgen-v0.3.1
rev: v1
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.11.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
rev: v0.24.1
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.15.0
hooks:
- id: mypy
files: "^src/"
Expand Down
4 changes: 2 additions & 2 deletions src/napari_micromanager/_gui_objects/_stages_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
wdgs: list[tuple[int, _DragGroupBox, int, int]] = []
zones: list[tuple[int, int]] = []
for i in range(self.layout().count()):
wdg = cast(_DragGroupBox, self.layout().itemAt(i).widget())
wdg = cast("_DragGroupBox", self.layout().itemAt(i).widget())

Check warning on line 69 in src/napari_micromanager/_gui_objects/_stages_widget.py

View check run for this annotation

Codecov / codecov/patch

src/napari_micromanager/_gui_objects/_stages_widget.py#L69

Added line #L69 was not covered by tests
wdgs.append((i, wdg, wdg.x(), wdg.x() + wdg.width()))
zones.append((wdg.x(), wdg.x() + wdg.width()))

Expand All @@ -88,7 +88,7 @@
if curr_idx == idx:
w.start_pos = 0
break
cast(QHBoxLayout, self.layout()).insertWidget(curr_idx, w)
cast("QHBoxLayout", self.layout()).insertWidget(curr_idx, w)

Check warning on line 91 in src/napari_micromanager/_gui_objects/_stages_widget.py

View check run for this annotation

Codecov / codecov/patch

src/napari_micromanager/_gui_objects/_stages_widget.py#L91

Added line #L91 was not covered by tests
w.start_pos = 0
break
event.accept()
Expand Down
6 changes: 3 additions & 3 deletions src/napari_micromanager/_gui_objects/_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
Qt.DockWidgetArea.BottomDockWidgetArea,
]
for area in areas:
cast(QMainWindow, win).setTabPosition(
cast("QMainWindow", win).setTabPosition(
area, QTabWidget.TabPosition.North
)

Expand Down Expand Up @@ -126,7 +126,7 @@
win := getattr(self.viewer.window, "_qt_window", None)
):
return
win = cast(QMainWindow, win)
win = cast("QMainWindow", win)

Check warning on line 129 in src/napari_micromanager/_gui_objects/_toolbar.py

View check run for this annotation

Codecov / codecov/patch

src/napari_micromanager/_gui_objects/_toolbar.py#L129

Added line #L129 was not covered by tests
if (
isinstance(dw := self.parent(), QDockWidget)
and win.dockWidgetArea(dw) is not Qt.DockWidgetArea.TopDockWidgetArea
Expand Down Expand Up @@ -168,7 +168,7 @@
tabify = True
if not key:
# using QPushButton.whatsThis() property to get the key.
btn = cast(QPushButton, self.sender())
btn = cast("QPushButton", self.sender())

Check warning on line 171 in src/napari_micromanager/_gui_objects/_toolbar.py

View check run for this annotation

Codecov / codecov/patch

src/napari_micromanager/_gui_objects/_toolbar.py#L171

Added line #L171 was not covered by tests
key = btn.whatsThis()

if key in self._dock_widgets:
Expand Down
6 changes: 3 additions & 3 deletions src/napari_micromanager/_mda_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LayerMeta(TypedDict, total=False):
def _get_file_name_from_metadata(sequence: MDASequence) -> str:
"""Get the file name from the MDASequence metadata."""
meta = cast("dict", sequence.metadata.get(PYMMCW_METADATA_KEY, {}))
return cast(str, meta.get("save_name", DEFAULT_NAME))
return cast("str", meta.get("save_name", DEFAULT_NAME))


class _NapariMDAHandler:
Expand Down Expand Up @@ -273,7 +273,7 @@ def _determine_sequence_layers(
layer, and `layer_meta` is metadata to add to `layer.metadata`. e.g.:
`[('3670fc63-c570-4920-949f-16601143f2e3', [4, 2, 4], {})]`
"""
meta = cast(dict, sequence.metadata.get(NMM_METADATA_KEY, {}))
meta = cast("dict", sequence.metadata.get(NMM_METADATA_KEY, {}))

# these are all the layers we're going to create
# each item is a tuple of (id, shape, layer_metadata)
Expand Down Expand Up @@ -332,7 +332,7 @@ def _id_idx_layer(event: MDAEvent) -> tuple[str, tuple[int, ...], str]:
- `layer_name` is the name of the corresponding layer in the viewer.
"""
seq = cast("MDASequence", event.sequence)
meta = cast(dict, seq.metadata.get(NMM_METADATA_KEY, {}))
meta = cast("dict", seq.metadata.get(NMM_METADATA_KEY, {}))
axis_order = list(get_full_sequence_axes(seq))

ch_id = ""
Expand Down
2 changes: 1 addition & 1 deletion src/napari_micromanager/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@
continue

# build new path name
number = f"_{current_max+1:0{ndigits}d}"
number = f"_{current_max + 1:0{ndigits}d}"

Check warning on line 69 in src/napari_micromanager/_util.py

View check run for this annotation

Codecov / codecov/patch

src/napari_micromanager/_util.py#L69

Added line #L69 was not covered by tests
return path.parent / f"{stem}{number}{extension}"
Loading