SpikeInterface / SpikeInterface/spikeinterface
Some improvements to time handling
Nobody has claimed this yet.
- 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:
-
get_times()returns a view to the segmenttime_vectorif 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_startis used under the hood, as the array will be generated on the fly. I think everyone is agreed thatget_times()should return a copy of thetime_vector(if it exists). -
copy.deepcopy(recording)or I thinkrecording.clone()does not copy thetime_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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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