From 4d7246a529e3d17747cf5a496a0a04bd97f4eb09 Mon Sep 17 00:00:00 2001 From: JoeZiminski Date: Wed, 13 Nov 2024 18:33:17 +0000 Subject: [PATCH] Fixes on shift function. --- src/spikeinterface/core/baserecording.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spikeinterface/core/baserecording.py b/src/spikeinterface/core/baserecording.py index 91f99f17b0..4b545dc7c7 100644 --- a/src/spikeinterface/core/baserecording.py +++ b/src/spikeinterface/core/baserecording.py @@ -526,8 +526,6 @@ def shift_times(self, shift: int | float, segment_index: int | None = None) -> N The segment on which to shift the times. if `None`, all segments will be shifted. """ - self._check_segment_index(segment_index) # Check the segment index is valid only - if segment_index is None: segments_to_shift = range(self.get_num_segments()) else: @@ -536,7 +534,7 @@ def shift_times(self, shift: int | float, segment_index: int | None = None) -> N for idx in segments_to_shift: rs = self._recording_segments[idx] - if self.has_time_vector(): + if self.has_time_vector(segment_index=idx): rs.time_vector += shift else: rs.t_start += shift