Skip to content

Commit

Permalink
Fixes on shift function.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed Nov 13, 2024
1 parent 3e98c67 commit 4d7246a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/spikeinterface/core/baserecording.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 4d7246a

Please sign in to comment.