Skip to content

Commit

Permalink
ci: [pre-commit.ci] pre-commit autoupdate (#1108)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 →
v0.5.0](astral-sh/ruff-pre-commit@v0.4.3...v0.5.0)
- [github.com/asottile/pyupgrade: v3.15.2 →
v3.16.0](asottile/pyupgrade@v3.15.2...v3.16.0)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 →
v1.10.1](pre-commit/mirrors-mypy@v1.10.0...v1.10.1)
- [github.com/codespell-project/codespell: v2.2.6 →
v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
pre-commit-ci[bot] and Czaki authored Jul 2, 2024
1 parent a84aef8 commit 4dfd50a
Showing 6 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -20,11 +20,11 @@ repos:
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.5.0
hooks:
- id: ruff
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
@@ -44,13 +44,13 @@ repos:
- mdformat-toc

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0' # Use the sha / tag you want to point at
rev: 'v1.10.1' # Use the sha / tag you want to point at
hooks:
- id: mypy
files: ^package/PartSegImage/.+\.py

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
2 changes: 1 addition & 1 deletion package/PartSeg/_roi_analysis/advanced_window.py
Original file line number Diff line number Diff line change
@@ -887,7 +887,7 @@ def __init__(
def accept_response(self):
res = {}
for name, (type_of, item) in self.object_dict.items():
if type_of == str:
if type_of is str:
val = str(item.text())
if not val.strip():
QMessageBox.warning(self, "Not all fields filled", "")
2 changes: 1 addition & 1 deletion package/PartSeg/common_gui/channel_control.py
Original file line number Diff line number Diff line change
@@ -625,7 +625,7 @@ def get_filter(self) -> typing.List[typing.Tuple[NoiseFilterType, float]]:
]

def get_limits(self) -> typing.List[typing.Union[typing.Tuple[int, int], None]]:
resp: typing.List[typing.Union[typing.Tuple[int, int], None]] = [(0, 0)] * self.layout().count() #
resp: typing.List[typing.Union[typing.Tuple[int, int], None]] = [(0, 0)] * self.layout().count()
for i in range(self.layout().count()):
resp[i] = (
self.settings.get_from_profile(f"{self.viewer_name}.range_{i}", (0, 65000))
3 changes: 1 addition & 2 deletions package/PartSegCore/project_info.py
Original file line number Diff line number Diff line change
@@ -52,8 +52,7 @@ def create(
raise ValueError("name")
arrays = BytesIO()
arrays_dict = {"roi": roi_info.roi}
for name, array in roi_info.alternative.items():
arrays_dict[name] = array
arrays_dict.update(roi_info.alternative.items())
if mask is not None:
arrays_dict["mask"] = mask

2 changes: 1 addition & 1 deletion package/PartSegCore/universal_const.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
@register_class(old_paths=["PartSeg.utils.universal_const.Units"])
class Units(Enum):
mm = 0
µm = 1
µm = 1 # noqa: PLC2401
nm = 2
pm = 3

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ def test_algorithm_property():
def test_algorithm_property_warn():
with pytest.warns(DeprecationWarning, match="use value_type instead"):
ap = AlgorithmProperty("test", "Test", 1, property_type=int)
assert ap.value_type == int
assert ap.value_type is int


def test_algorithm_property_no_kwargs():
@@ -554,7 +554,7 @@ class TestROIExtractionProfile:
def test_roi_extraction_profile(self):
ROIExtractionProfile(name="aaa", algorithm="aaa", values={})
with pytest.warns(FutureWarning):
ROIExtractionProfile("aaa", "aaa", {})
ROIExtractionProfile("aaa", "aaa", {}) # pylint: disable=too-many-function-args

def test_dump_dict(self):
prof = ROIExtractionProfile(

0 comments on commit 4dfd50a

Please sign in to comment.