Skip to content

Commit

Permalink
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into …
Browse files Browse the repository at this point in the history
…postprocessing-tmp-recording
  • Loading branch information
alejoe91 committed Sep 23, 2024
2 parents d9f53d0 + a874f2a commit f95658e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/spikeinterface/core/baserecording.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,11 @@ def _save(self, format="binary", verbose: bool = False, **save_kwargs):
probegroup = self.get_probegroup()
cached.set_probegroup(probegroup)

time_vectors = self._get_time_vectors()
if time_vectors is not None:
for segment_index, time_vector in enumerate(time_vectors):
if time_vector is not None:
cached.set_times(time_vector, segment_index=segment_index)
for segment_index in range(self.get_num_segments()):
if self.has_time_vector(segment_index):
# the use of get_times is preferred since timestamps are converted to array
time_vector = self.get_times(segment_index=segment_index)
cached.set_times(time_vector, segment_index=segment_index)

return cached

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def _read_old_waveforms_extractor_binary(folder, sorting):
ext = ComputeRandomSpikes(sorting_analyzer)
ext.params = dict()
ext.data = dict(random_spikes_indices=random_spikes_indices)
ext.run_info = None
sorting_analyzer.extensions["random_spikes"] = ext

ext = ComputeWaveforms(sorting_analyzer)
Expand All @@ -545,6 +546,7 @@ def _read_old_waveforms_extractor_binary(folder, sorting):
dtype=params["dtype"],
)
ext.data["waveforms"] = waveforms
ext.run_info = None
sorting_analyzer.extensions["waveforms"] = ext

# templates saved dense
Expand All @@ -559,6 +561,7 @@ def _read_old_waveforms_extractor_binary(folder, sorting):
ext.params = dict(ms_before=params["ms_before"], ms_after=params["ms_after"], operators=list(templates.keys()))
for mode, arr in templates.items():
ext.data[mode] = arr
ext.run_info = None
sorting_analyzer.extensions["templates"] = ext

for old_name, new_name in old_extension_to_new_class_map.items():
Expand Down Expand Up @@ -631,6 +634,7 @@ def _read_old_waveforms_extractor_binary(folder, sorting):
ext.set_params(**updated_params, save=False)
if ext.need_backward_compatibility_on_load:
ext._handle_backward_compatibility_on_load()
ext.run_info = None

sorting_analyzer.extensions[new_name] = ext

Expand Down

0 comments on commit f95658e

Please sign in to comment.