Skip to content

Commit

Permalink
Merge pull request #3379 from alejoe91/fix-time-handling-test
Browse files Browse the repository at this point in the history
Fix time handling test memory
  • Loading branch information
alejoe91 authored Sep 9, 2024
2 parents d5f1481 + f032b1b commit 0503867
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/spikeinterface/core/tests/test_time_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,14 @@ def _get_time_vector_recording(self, raw_recording):
spaced timeseries data. Return the original recording,
recoridng with time vectors added and list including the added time vectors.
"""
times_recording = copy.deepcopy(raw_recording)
times_recording = raw_recording.clone()
all_time_vectors = []
for segment_index in range(raw_recording.get_num_segments()):

t_start = segment_index + 1 * 100
t_stop = t_start + raw_recording.get_duration(segment_index) + segment_index + 1

some_small_increasing_numbers = np.arange(times_recording.get_num_samples(segment_index)) * (
1 / times_recording.get_sampling_frequency()
)

offsets = np.cumsum(some_small_increasing_numbers)
time_vector = t_start + times_recording.get_times(segment_index) + offsets

time_vector = np.linspace(t_start, t_stop, raw_recording.get_num_samples(segment_index))
all_time_vectors.append(time_vector)
times_recording.set_times(times=time_vector, segment_index=segment_index)

Expand Down

0 comments on commit 0503867

Please sign in to comment.