From 19e03db1226738fe3d06d460de113454b8b65dd1 Mon Sep 17 00:00:00 2001 From: Vince Reuter Date: Thu, 3 Oct 2024 15:17:49 +0200 Subject: [PATCH] pass formatting checks --- spotfishing/__init__.py | 8 ++++++-- spotfishing/_constants.py | 2 +- spotfishing/detection_result.py | 8 +++++--- spotfishing/detectors.py | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/spotfishing/__init__.py b/spotfishing/__init__.py index 7c90efe..cb0223f 100644 --- a/spotfishing/__init__.py +++ b/spotfishing/__init__.py @@ -1,6 +1,10 @@ """Package-level members""" -from ._constants import ROI_AREA_KEY, ROI_MEAN_INTENSITY_KEY, ROI_MEAN_INTENSITY_KEY_CAMEL_CASE +from ._constants import ( + ROI_AREA_KEY, + ROI_MEAN_INTENSITY_KEY, + ROI_MEAN_INTENSITY_KEY_CAMEL_CASE, +) from ._exceptions import * from .detection_result import DetectionResult, RoiCenterKeys from .detectors import detect_spots_dog, detect_spots_int @@ -11,7 +15,7 @@ __all__ = [ "ROI_AREA_KEY", - "ROI_MEAN_INTENSITY_KEY_CAMEL_CASE", # Only export this (not the snake case one). + "ROI_MEAN_INTENSITY_KEY_CAMEL_CASE", # Only export this (not the snake case one). "DifferenceOfGaussiansTransformation", "DimensionalityError", "RoiCenterKeys", diff --git a/spotfishing/_constants.py b/spotfishing/_constants.py index bec950f..1970073 100644 --- a/spotfishing/_constants.py +++ b/spotfishing/_constants.py @@ -6,7 +6,7 @@ __all__ = [ "ROI_AREA_KEY", "ROI_CENTROID_KEY", - "ROI_MEAN_INTENSITY_KEY", # Export this for package-internal use. + "ROI_MEAN_INTENSITY_KEY", # Export this for package-internal use. "ROI_MEAN_INTENSITY_KEY_CAMEL_CASE", ] diff --git a/spotfishing/detection_result.py b/spotfishing/detection_result.py index 5742f6d..fd985ca 100644 --- a/spotfishing/detection_result.py +++ b/spotfishing/detection_result.py @@ -30,15 +30,17 @@ def to_list(cls) -> list[str]: # how to rename columns arising from extraction from skimage.measure.regionprops_table, to better suit downstream analysis # TODO: consider making this configurable, see: https://github.com/gerlichlab/spotfishing/issues/1 -SPOT_DETECTION_COLUMN_RENAMING: tuple[str, str] = tuple( +SPOT_DETECTION_COLUMN_RENAMING: tuple[tuple[str, str], ...] = tuple( (f"{ROI_CENTROID_KEY}-{i}", c) for i, c in enumerate(RoiCenterKeys.to_list()) ) + ( (ROI_AREA_KEY, ROI_AREA_KEY), - (ROI_MEAN_INTENSITY_KEY, ROI_MEAN_INTENSITY_KEY_CAMEL_CASE), + (ROI_MEAN_INTENSITY_KEY, ROI_MEAN_INTENSITY_KEY_CAMEL_CASE), ) # the sequence of columns of fields extracted from skimage.measure.regionprops_table, after accounting for expansion in multiple dimensions (e.g., centroid_weighted) -SKIMAGE_REGIONPROPS_TABLE_COLUMNS_EXPANDED = [old for old, _ in SPOT_DETECTION_COLUMN_RENAMING] +SKIMAGE_REGIONPROPS_TABLE_COLUMNS_EXPANDED = [ + old for old, _ in SPOT_DETECTION_COLUMN_RENAMING +] # the expected column names in a detection result table, after extraction and renaming DETECTION_RESULT_TABLE_COLUMNS = [new for _, new in SPOT_DETECTION_COLUMN_RENAMING] diff --git a/spotfishing/detectors.py b/spotfishing/detectors.py index 1adc2de..6272018 100644 --- a/spotfishing/detectors.py +++ b/spotfishing/detectors.py @@ -17,8 +17,8 @@ from ._exceptions import DimensionalityError from ._types import * from .detection_result import ( - SPOT_DETECTION_COLUMN_RENAMING, SKIMAGE_REGIONPROPS_TABLE_COLUMNS_EXPANDED, + SPOT_DETECTION_COLUMN_RENAMING, DetectionResult, ) from .dog_transform import DifferenceOfGaussiansTransformation