From 448170bc9f76b3fbc4f46a87da18a5dd3421e67d Mon Sep 17 00:00:00 2001 From: Alessandro Felder Date: Wed, 7 Feb 2024 09:23:14 +0000 Subject: [PATCH] improve detection debug logs (#375) * improve detection debug logs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove too wordy debug logs --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- cellfinder/core/detect/detect.py | 8 ++++---- cellfinder/core/detect/filters/volume/volume_filter.py | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cellfinder/core/detect/detect.py b/cellfinder/core/detect/detect.py index cd4e22c5..7c614d4e 100644 --- a/cellfinder/core/detect/detect.py +++ b/cellfinder/core/detect/detect.py @@ -179,11 +179,11 @@ def main( # processes. cells = mp_3d_filter.process(async_results, locks, callback=callback) - print( - "Detection complete - all planes done in : {}".format( - datetime.now() - start_time - ) + time_elapsed = datetime.now() - start_time + logger.debug( + f"All Planes done. Found {len(cells)} cells in {format(time_elapsed)}" ) + print("Detection complete - all planes done in : {}".format(time_elapsed)) return cells diff --git a/cellfinder/core/detect/filters/volume/volume_filter.py b/cellfinder/core/detect/filters/volume/volume_filter.py index a3e4d98f..d64ae71a 100644 --- a/cellfinder/core/detect/filters/volume/volume_filter.py +++ b/cellfinder/core/detect/filters/volume/volume_filter.py @@ -142,6 +142,10 @@ def get_results(self) -> List[Cell]: ) cells = [] + + logger.debug( + f"Processing {len(self.cell_detector.coords_maps.items())} cells" + ) for cell_id, cell_points in self.cell_detector.coords_maps.items(): cell_volume = len(cell_points) @@ -191,6 +195,7 @@ def get_results(self) -> List[Cell]: ) ) + logger.debug("Finished splitting cell clusters.") return cells