From 5577d29371361aa0cce954919b5b8fed14c74ba9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 22:08:51 +0000 Subject: [PATCH 1/3] ci: [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.22 → v0.16.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.22...v0.16.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa1817387..b5c9af0c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: debug-statements - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.1 hooks: - id: ruff-check - id: ruff-format From 759ca02f0bc687692dc806519dcf97e6df3578b7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 22:12:52 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- package/PartSegImage/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/PartSegImage/image.py b/package/PartSegImage/image.py index 32b0b8a92..4866e3db5 100644 --- a/package/PartSegImage/image.py +++ b/package/PartSegImage/image.py @@ -232,7 +232,7 @@ def __init__( spacing: Spacing, time_increment: float = 1.0, file_path=None, - mask: None | np.ndarray = None, + mask: np.ndarray | None = None, channel_info: list[ChannelInfo | ChannelInfoFull] | None = None, axes_order: str | None = None, shift: Spacing | None = None, From 1a3458ab821eef9d92a0b4a8fedd17c288e8b2b3 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 4 Aug 2026 09:41:10 +0200 Subject: [PATCH 3/3] update ruff configuration --- package/PartSeg/common_gui/colormap_creator.py | 6 ++++-- package/PartSegCore/mask_create.py | 2 +- pyproject.toml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package/PartSeg/common_gui/colormap_creator.py b/package/PartSeg/common_gui/colormap_creator.py index 75e3e5ddf..e416cda81 100644 --- a/package/PartSeg/common_gui/colormap_creator.py +++ b/package/PartSeg/common_gui/colormap_creator.py @@ -249,8 +249,10 @@ def __init__(self, parent=None): self.reverse_btn = QPushButton("Reverse") self.info_label = InfoLabel( [ - "Tip: Select color and double click on a color bar below. " - "Repeat to add another colors.", + ( + "Tip: Select color and double click on a color bar below. " + "Repeat to add another colors." + ), "Tip: Double click on a marker to remove it.", "Tip: Press and hold mouse left button on a marker to drag and drop it on color bar.", ], diff --git a/package/PartSegCore/mask_create.py b/package/PartSegCore/mask_create.py index 7f072fa1e..77a777a1e 100644 --- a/package/PartSegCore/mask_create.py +++ b/package/PartSegCore/mask_create.py @@ -153,7 +153,7 @@ def _calculate_mask( mask_description: MaskProperty, dilate_radius: list[int], mask: np.ndarray, - old_mask: None | np.ndarray, + old_mask: np.ndarray | None, ) -> np.ndarray: if mask_description.dilate != RadiusType.NO and mask_description.dilate_radius != 0: if mask_description.dilate_radius > 0: diff --git a/pyproject.toml b/pyproject.toml index 6ffd28164..f3ba81d8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -321,6 +321,7 @@ select = [ ignore = ["A003", "SIM108", "ARG002", "ARG003", "ARG004", "PLR2004", "PLR0913", # should be re-enabled in a future version "PLW1641", # Complain about lack of hash in mutable objects" + "PLR0917", # migrate more functions to named only arguments ] [tool.ruff.lint.isort] @@ -336,7 +337,7 @@ max-complexity = 15 [tool.ruff.lint.per-file-ignores] "docs/conf.py" = ["A001"] -"package/tests/**" = ["ARG", "PLC1901", "S101", "RUF012", "ANN", "FBT"] +"package/tests/**" = ["ARG", "PLC1901", "S101", "RUF012", "ANN", "FBT", "PLR0917"] "package/PartSegCore/sphinx/*" = ["ARG"] "package/tests/**.py" = ["PLR2004"] "package/PartSegCore/_old_json_hooks.py" = ["PLR0912", "PLR0911", "PLC0415"]