SpikeInterface / SpikeInterface/spikeinterface

Some improvements to time handling

Open
#3,546 0 comments 1 reaction 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

As discussed in #3509, some improvements to the time-handling could be made:

  1. get_times() returns a view to the segment time_vector if it exist. This means that changing the returned array will also change the one stored on the segment. This is different behaviour to if .t_start is used under the hood, as the array will be generated on the fly. I think everyone is agreed that get_times() should return a copy of the time_vector (if it exists).

  2. copy.deepcopy(recording) or I think recording.clone() does not copy the time_vector. This is discussed here. An fix could be:

What about times for clone()? This is not handled at the BaseExtractor level but the BaseRecording could override it or add an clone_extra_stuff() in base class and the BaseRecording could just implement it

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

Start by tracing get_times() and time_vector in BaseRecording and related BaseExtractor clone or deepcopy handling; issue #3509 contains the referenced discussion. Confirm that get_times() does not expose the stored array and that cloning preserves time_vector, then add or update the relevant tests if the existing test locations are found.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.