From 53f7fc91d17d774c2e77c6fbcac407c1e047d5bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:09:45 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cellfinder/core/classify/cube_generator.py | 8 ++------ cellfinder/core/detect/filters/volume/ball_filter.py | 6 +++--- cellfinder/core/main.py | 1 + cellfinder/core/tools/prep.py | 1 + cellfinder/napari/curation.py | 6 +++--- examples/show_detection_sample.py | 1 + 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cellfinder/core/classify/cube_generator.py b/cellfinder/core/classify/cube_generator.py index f4c67515..56f226cd 100644 --- a/cellfinder/core/classify/cube_generator.py +++ b/cellfinder/core/classify/cube_generator.py @@ -197,9 +197,7 @@ def __len__(self) -> int: """ return len(self.batches) - def __getitem__( - self, index: int - ) -> Union[ + def __getitem__(self, index: int) -> Union[ np.ndarray, Tuple[np.ndarray, List[Dict[str, float]]], Tuple[np.ndarray, Dict], @@ -389,9 +387,7 @@ def __len__(self) -> int: """ return int(np.ceil(len(self.signal_list) / self.batch_size)) - def __getitem__( - self, index: int - ) -> Union[ + def __getitem__(self, index: int) -> Union[ np.ndarray, Tuple[np.ndarray, List[Dict[str, float]]], Tuple[np.ndarray, Dict], diff --git a/cellfinder/core/detect/filters/volume/ball_filter.py b/cellfinder/core/detect/filters/volume/ball_filter.py index 87dee650..13aed04c 100644 --- a/cellfinder/core/detect/filters/volume/ball_filter.py +++ b/cellfinder/core/detect/filters/volume/ball_filter.py @@ -327,6 +327,6 @@ def _walk( THRESHOLD_VALUE, kernel, ): - volume[ - ball_centre_x, ball_centre_y, middle_z - ] = SOMA_CENTRE_VALUE + volume[ball_centre_x, ball_centre_y, middle_z] = ( + SOMA_CENTRE_VALUE + ) diff --git a/cellfinder/core/main.py b/cellfinder/core/main.py index bc2f0cf3..cb78cca4 100644 --- a/cellfinder/core/main.py +++ b/cellfinder/core/main.py @@ -2,6 +2,7 @@ N.B imports are within functions to prevent tensorflow being imported before it's warnings are silenced """ + import os from typing import Callable, List, Optional, Tuple diff --git a/cellfinder/core/tools/prep.py b/cellfinder/core/tools/prep.py index 0e7e7217..e513917d 100644 --- a/cellfinder/core/tools/prep.py +++ b/cellfinder/core/tools/prep.py @@ -3,6 +3,7 @@ ================== Functions to prepare files and directories needed for other functions """ + import os from pathlib import Path from typing import Optional diff --git a/cellfinder/napari/curation.py b/cellfinder/napari/curation.py index 34d60380..37b9eba3 100644 --- a/cellfinder/napari/curation.py +++ b/cellfinder/napari/curation.py @@ -246,9 +246,9 @@ def set_training_data_non_cell(self): self.training_data_non_cell_layer = self.viewer.layers[ self.training_data_non_cell_choice.currentText() ] - self.training_data_non_cell_layer.metadata[ - "point_type" - ] = Cell.UNKNOWN + self.training_data_non_cell_layer.metadata["point_type"] = ( + Cell.UNKNOWN + ) self.training_data_non_cell_layer.metadata["training_data"] = True def add_training_data(self): diff --git a/examples/show_detection_sample.py b/examples/show_detection_sample.py index 3a44f7d1..2831fca5 100644 --- a/examples/show_detection_sample.py +++ b/examples/show_detection_sample.py @@ -7,6 +7,7 @@ - loads the cellfinder-napari cell detection plugin - opens the napari viewer """ + import napari from cellfinder.napari.sample_data import load_sample