spikeinterface
spikeinterface copied to clipboard
RecordingExtractor.clone doesn't propagate timestamps
Ran into this issue using recording.set_probe which depends on recording.clone. Expected set timestamps to propagate to the cloned recording extractor, but they do not.
May be related to #3909
Minimal Example:
from spikeinterface.extractors import WhiteMatterRecordingExtractor
import numpy as np
def main():
file_path = "/Users/pauladkisson/Documents/CatalystNeuro/Neuroconv/testing_data/aws/neuroconv_gin_datasets/ephy_testing_data/whitematter/HSW_2024_12_12__10_28_23__70min_17sec__hsamp_64ch_25000sps_stub.bin"
sampling_frequency = 25_000.0
num_channels = 64
recording_extractor = WhiteMatterRecordingExtractor(
file_path=file_path,
sampling_frequency=sampling_frequency,
num_channels=num_channels,
)
times = recording_extractor.get_times()
shifted_times = times + 1
recording_extractor.set_times(shifted_times)
new_times = recording_extractor.get_times()
print(f"{new_times[0] = }") # np.float64(1.0)
cloned_recording = recording_extractor.clone()
cloned_times = cloned_recording.get_times()
print(f"{cloned_times[0] = }") # np.float64(0.0)
assert new_times[0] == cloned_times[0] # Fails
if __name__ == "__main__":
main()