Skip to content

Commit

Permalink
pass formatting checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Oct 3, 2024
1 parent 270a049 commit 19e03db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 6 additions & 2 deletions spotfishing/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion spotfishing/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
8 changes: 5 additions & 3 deletions spotfishing/detection_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion spotfishing/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19e03db

Please sign in to comment.