Skip to content

Commit

Permalink
Fix bug with reset_times
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Sep 10, 2024
1 parent 669aff8 commit 30bd9b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/spikeinterface/core/baserecording.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def reset_times(self):
segment's sampling frequency is set to the recording's sampling frequency.
"""
for segment_index in range(self.get_num_segments()):
rs = self._recording_segments[segment_index]
if self.has_time_vector(segment_index):
rs = self._recording_segments[segment_index]
rs.time_vector = None
rs.t_start = None
rs.sampling_frequency = self.sampling_frequency
Expand Down
3 changes: 3 additions & 0 deletions src/spikeinterface/core/tests/test_baserecording.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ def test_BaseRecording(create_cache_folder):
assert time_info["time_vector"] is None
assert time_info["sampling_frequency"] == rec.sampling_frequency

# resetting time again should be ok
rec.reset_times()

# test 3d probe
rec_3d = generate_recording(ndim=3, num_channels=30)
locations_3d = rec_3d.get_property("location")
Expand Down

0 comments on commit 30bd9b9

Please sign in to comment.