SpikeInterface / SpikeInterface/spikeinterface

RecordingExtractor.clone doesn't propagate timestamps

Open
#3,918 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core
Dominant language
Python
Stars
847
Forks
280
Avg merge
3d 9h
Merged PRs (30d)
29

Description

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()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the minimal example with WhiteMatterRecordingExtractor and compare recording_extractor.get_times() with cloned_recording.get_times() after set_times(). Start at the recording.clone entry point; done means the cloned recording preserves the shifted timestamps and the assertion passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.