@@ -49,19 +49,14 @@ def _get_time_vector_recording(self, raw_recording):
4949 spaced timeseries data. Return the original recording,
5050 recoridng with time vectors added and list including the added time vectors.
5151 """
52- times_recording = copy . deepcopy ( raw_recording )
52+ times_recording = raw_recording . clone ( )
5353 all_time_vectors = []
5454 for segment_index in range (raw_recording .get_num_segments ()):
5555
5656 t_start = segment_index + 1 * 100
57+ t_stop = t_start + raw_recording .get_duration (segment_index ) + segment_index + 1
5758
58- some_small_increasing_numbers = np .arange (times_recording .get_num_samples (segment_index )) * (
59- 1 / times_recording .get_sampling_frequency ()
60- )
61-
62- offsets = np .cumsum (some_small_increasing_numbers )
63- time_vector = t_start + times_recording .get_times (segment_index ) + offsets
64-
59+ time_vector = np .linspace (t_start , t_stop , raw_recording .get_num_samples (segment_index ))
6560 all_time_vectors .append (time_vector )
6661 times_recording .set_times (times = time_vector , segment_index = segment_index )
6762
@@ -285,6 +280,7 @@ def test_sorting_analyzer_get_durations_from_recording(self, time_vector_recordi
285280 """
286281 _ , times_recording , _ = time_vector_recording
287282
283+ durations = [times_recording .get_duration (s ) for s in range (times_recording .get_num_segments ())]
288284 sorting = si .generate_sorting (
289285 durations = [times_recording .get_duration (s ) for s in range (times_recording .get_num_segments ())]
290286 )
0 commit comments