Skip to content

Commit

Permalink
ci: [pre-commit.ci] pre-commit autoupdate (#1064)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/psf/black-pre-commit-mirror: 23.12.1 →
24.1.1](psf/black-pre-commit-mirror@23.12.1...24.1.1)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 30, 2024
1 parent de43a4f commit 2e1bfa9
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
pass_filenames: true
Expand Down
8 changes: 5 additions & 3 deletions package/PartSeg/_roi_mask/batch_proceed.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ def run_calculation(self): # noqa: PLR0912 # FIXME
state2 = StackSettings.transform_state(
project_tuple,
segmentation.roi_info,
{i: segmentation.parameters for i in segmentation.roi_info.bound_info}
if segmentation.roi_info is not None
else {},
(
{i: segmentation.parameters for i in segmentation.roi_info.bound_info}
if segmentation.roi_info is not None
else {}
),
[],
)
if isinstance(task.save_prefix, tuple):
Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains non gui Qt based components
"""

import os.path
from typing import TYPE_CHECKING

Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_gui/advanced_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains base for the advanced window for PartSeg.
At this moment controlling colormaps tabs and developer PartSegCore
"""

import importlib
import sys
from contextlib import suppress
Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_gui/error_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.. _sentry: https://sentry.io
"""

import getpass
import io
import os
Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_gui/label_create.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains widgets to create and manage labels scheme
"""

import json
import typing
from copy import deepcopy
Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_gui/qt_console.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Code from https://github.com/napari/napari-console
"""

# pylint: disable=no-value-for-parameter,unexpected-keyword-arg
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/common_gui/qt_modal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""from napari._qt.dialog.modal """

from qtpy.QtCore import QPoint, QRect, Qt
from qtpy.QtGui import QCursor, QGuiApplication, QKeyEvent
from qtpy.QtWidgets import QDialog, QFrame, QVBoxLayout
Expand Down
1 change: 0 additions & 1 deletion package/PartSeg/common_gui/universal_gui_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
This module contains simple, useful widgets which implementation is too short to create separated files for them
"""


import math
import typing
import warnings
Expand Down
8 changes: 5 additions & 3 deletions package/PartSeg/plugins/old_partseg/old_partseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ def _load(cls, tar_file: tarfile.TarFile, file_path: str) -> ProjectTuple:
"channel": 0,
"minimum_size": algorithm_dict["minimum_size"],
"threshold": {"name": "Manual", "values": {"threshold": algorithm_dict["threshold"]}},
"noise_removal": {"name": "Gauss", "values": {"gauss_type": DimensionType.Layer, "radius": 1.0}}
if algorithm_dict["use_gauss"]
else {"name": "None", "values": {}},
"noise_removal": (
{"name": "Gauss", "values": {"gauss_type": DimensionType.Layer, "radius": 1.0}}
if algorithm_dict["use_gauss"]
else {"name": "None", "values": {}}
),
"side_connection": True,
}

Expand Down
1 change: 1 addition & 0 deletions package/PartSeg/state_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module with default values of application state
"""

import os
import sys

Expand Down
14 changes: 8 additions & 6 deletions package/PartSegCore/algorithm_describe_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ def get_default_values(cls):
if cls.__new_style__:
return cls.__argument_class__() # pylint: disable=not-callable
return {
el.name: {
"name": el.default_value,
"values": el.possible_values[el.default_value].get_default_values(),
}
if issubclass(el.value_type, AlgorithmDescribeBase)
else el.default_value
el.name: (
{
"name": el.default_value,
"values": el.possible_values[el.default_value].get_default_values(),
}
if issubclass(el.value_type, AlgorithmDescribeBase)
else el.default_value
)
for el in cls.get_fields()
if isinstance(el, AlgorithmProperty)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}
"""

import contextlib
import json
import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}
"""

import logging
import multiprocessing
import os
Expand Down
8 changes: 5 additions & 3 deletions package/PartSegCore/class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ def _make_class(typename, types, defaults_dict, base_classes, readonly):
del global_state[typename]

signature = ", ".join(
f"{name_}: {translate_dict[type_]} = {pprint.pformat(defaults_dict[name_])}"
if name_ in defaults_dict
else f"{name_}: {translate_dict[type_]}"
(
f"{name_}: {translate_dict[type_]} = {pprint.pformat(defaults_dict[name_])}"
if name_ in defaults_dict
else f"{name_}: {translate_dict[type_]}"
)
for name_, type_ in types.items()
)

Expand Down
1 change: 1 addition & 0 deletions package/PartSegCore/mask_partition_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Both class from this module are designed for spherical mask, but may be useful als for others.
"""

import typing

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions package/PartSegCore/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
register_dict: holds information where register given operation type. Strongly suggest to use register function instead.
"""

from enum import Enum
from typing import Type

Expand Down
1 change: 1 addition & 0 deletions package/PartSegCore/segmentation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains roi_extraction algorithms
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions package/PartSegCore/segmentation/watershed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains PartSeg wrappers for function for :py:mod:`..sprawl_utils.find_split`.
"""

import warnings
from abc import ABC
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions package/PartSegCore/sphinx/auto_parameters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contain utilities to document Register class.
"""

import inspect
from typing import Any, Dict

Expand Down

0 comments on commit 2e1bfa9

Please sign in to comment.