From db92eef947245f0c09f93651792974b1175fa68f Mon Sep 17 00:00:00 2001 From: Charlie Windolf Date: Tue, 16 Jan 2024 11:50:31 -0500 Subject: [PATCH] Peeler edge case --- src/dartsort/peel/peel_base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dartsort/peel/peel_base.py b/src/dartsort/peel/peel_base.py index 60869b9d..1a76d7d1 100644 --- a/src/dartsort/peel/peel_base.py +++ b/src/dartsort/peel/peel_base.py @@ -293,9 +293,10 @@ def process_chunk(self, chunk_start_samples, return_residual=False): # add times in seconds segment = self.recording._recording_segments[0] - chunk_result["times_seconds"] = segment.sample_index_to_time( - chunk_result["times_samples"] - ) + if peel_result["n_spikes"]: + chunk_result["times_seconds"] = segment.sample_index_to_time( + chunk_result["times_samples"] + ) return chunk_result def gather_chunk_result(