diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 783a3d64..3117de90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-docstring-first - id: check-executables-have-shebangs @@ -16,10 +16,10 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.285 + rev: v0.2.0 hooks: - id: ruff - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 24.1.1 hooks: - id: black 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