From 5b2caf19ce96f122463f59ca0bd642d893dd8c3d Mon Sep 17 00:00:00 2001 From: neuronflow Date: Thu, 1 Feb 2024 10:01:44 +0100 Subject: [PATCH] sorting imports Signed-off-by: neuronflow --- panoptica/_functionals.py | 2 +- panoptica/instance_approximator.py | 14 ++++++++------ panoptica/instance_evaluator.py | 3 ++- panoptica/metrics/cldice.py | 2 +- panoptica/panoptic_evaluator.py | 4 ++-- panoptica/utils/__init__.py | 14 +++++++------- panoptica/utils/edge_case_handling.py | 2 +- panoptica/utils/processing_pair.py | 2 +- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/panoptica/_functionals.py b/panoptica/_functionals.py index 071af97..2775c37 100644 --- a/panoptica/_functionals.py +++ b/panoptica/_functionals.py @@ -2,7 +2,7 @@ import numpy as np -from panoptica.metrics import _compute_instance_iou, Metric +from panoptica.metrics import Metric, _compute_instance_iou from panoptica.utils.constants import CCABackend from panoptica.utils.numpy_utils import _get_bbox_nd diff --git a/panoptica/instance_approximator.py b/panoptica/instance_approximator.py index 0a905b5..36845b6 100644 --- a/panoptica/instance_approximator.py +++ b/panoptica/instance_approximator.py @@ -1,13 +1,15 @@ -from abc import abstractmethod, ABC +from abc import ABC, abstractmethod + +import numpy as np + +from panoptica._functionals import CCABackend, _connected_components +from panoptica.timing import measure_time +from panoptica.utils.numpy_utils import _get_smallest_fitting_uint from panoptica.utils.processing_pair import ( + MatchedInstancePair, SemanticPair, UnmatchedInstancePair, - MatchedInstancePair, ) -from panoptica._functionals import _connected_components, CCABackend -from panoptica.utils.numpy_utils import _get_smallest_fitting_uint -from panoptica.timing import measure_time -import numpy as np class InstanceApproximator(ABC): diff --git a/panoptica/instance_evaluator.py b/panoptica/instance_evaluator.py index 028e19f..e405f43 100644 --- a/panoptica/instance_evaluator.py +++ b/panoptica/instance_evaluator.py @@ -1,10 +1,11 @@ from multiprocessing import Pool + import numpy as np +from panoptica.metrics import Metric from panoptica.panoptic_result import PanopticaResult from panoptica.utils import EdgeCaseHandler from panoptica.utils.processing_pair import MatchedInstancePair -from panoptica.metrics import Metric def evaluate_matched_instance( diff --git a/panoptica/metrics/cldice.py b/panoptica/metrics/cldice.py index 3924751..bdbe1fc 100644 --- a/panoptica/metrics/cldice.py +++ b/panoptica/metrics/cldice.py @@ -1,5 +1,5 @@ -from skimage.morphology import skeletonize, skeletonize_3d import numpy as np +from skimage.morphology import skeletonize, skeletonize_3d def cl_score(volume: np.ndarray, skeleton: np.ndarray): diff --git a/panoptica/panoptic_evaluator.py b/panoptica/panoptic_evaluator.py index 1a10b3c..225930e 100644 --- a/panoptica/panoptic_evaluator.py +++ b/panoptica/panoptic_evaluator.py @@ -5,17 +5,17 @@ from panoptica.instance_approximator import InstanceApproximator from panoptica.instance_evaluator import evaluate_matched_instance from panoptica.instance_matcher import InstanceMatchingAlgorithm -from panoptica.metrics import Metric, _Metric, Metric +from panoptica.metrics import Metric, _Metric from panoptica.panoptic_result import PanopticaResult from panoptica.timing import measure_time from panoptica.utils import EdgeCaseHandler +from panoptica.utils.citation_reminder import citation_reminder from panoptica.utils.processing_pair import ( MatchedInstancePair, SemanticPair, UnmatchedInstancePair, _ProcessingPair, ) -from panoptica.utils.citation_reminder import citation_reminder class Panoptic_Evaluator: diff --git a/panoptica/utils/__init__.py b/panoptica/utils/__init__.py index b5b9927..8abe770 100644 --- a/panoptica/utils/__init__.py +++ b/panoptica/utils/__init__.py @@ -1,17 +1,17 @@ +from panoptica.utils.edge_case_handling import ( + EdgeCaseHandler, + EdgeCaseResult, + EdgeCaseZeroTP, +) from panoptica.utils.numpy_utils import ( _count_unique_without_zeros, _unique_without_zeros, ) from panoptica.utils.processing_pair import ( + InstanceLabelMap, + MatchedInstancePair, SemanticPair, UnmatchedInstancePair, - MatchedInstancePair, - InstanceLabelMap, -) -from panoptica.utils.edge_case_handling import ( - EdgeCaseHandler, - EdgeCaseResult, - EdgeCaseZeroTP, ) # from utils.constants import diff --git a/panoptica/utils/edge_case_handling.py b/panoptica/utils/edge_case_handling.py index 33b4c29..c8eec76 100644 --- a/panoptica/utils/edge_case_handling.py +++ b/panoptica/utils/edge_case_handling.py @@ -2,7 +2,7 @@ import numpy as np -from panoptica.metrics import Metric, Metric +from panoptica.metrics import Metric from panoptica.utils.constants import _Enum_Compare, auto diff --git a/panoptica/utils/processing_pair.py b/panoptica/utils/processing_pair.py index bde4a58..df1c659 100644 --- a/panoptica/utils/processing_pair.py +++ b/panoptica/utils/processing_pair.py @@ -3,8 +3,8 @@ import numpy as np from numpy import dtype -from panoptica.utils import _count_unique_without_zeros, _unique_without_zeros from panoptica._functionals import _get_paired_crop +from panoptica.utils import _count_unique_without_zeros, _unique_without_zeros uint_type: type = np.unsignedinteger int_type: type = np.integer