From 7691ceea31a8eda11a419be8c5d03e8071a1ea6a 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:08:03 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.285...v0.2.0) - [github.com/psf/black: 23.7.0 → 24.1.1](https://github.com/psf/black/compare/23.7.0...24.1.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 78aeabb8fc1fe146f8c4057a269e616b1b9f9755 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 2/2] [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