SpikeInterface / SpikeInterface/spikeinterface

Feature request: `.load_recording()`

Open
#3,632 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Idea: it would be nice to have a function load_recording(path, stream_id=None, type=None) (or similar) which implements an if tree internally to try to guess what format a recording is. I wanted to open an issue where we can think about whether this is useful and what it could look like.

The motivation would be cases like writing spike sorting CLI tools. This function would make it possible to implement recording loading in GUI and CLI tools. Currently, tools need the user to pass in a BaseRecording of some kind, meaning that most tools rely on the user calling si.read_X() and launching the tool from within Python. For example, spikeinterface-gui takes this approach, but it could use this to implement a GUI path selector, and it could then be run from the command line or a launcher instead of from an interactive Python session. This could also make it easier for users to write format-portable scripts and make things easier for non-technical or non-python-savvy users. Future works could extend this to loading sorting outputs or other extractors.

API: not super sure. Sometimes a stream_id will be necessary; maybe in the common case where both LFP and AP are available, the AP stream can be chosen by default, or there could be a prefer_ap type flag? I imagine that some formats are ambiguous, so maybe a type= flag might be needed to allow users to override in those cases. I think it's okay if there are rare cases which are not handled by this tool.

Implementation: I think this function can start by calling load_extractor() and move on to other cases when that fails? It can raise a detailed error message in failure cases indicating that the path didn't match any of the formats tried (listing them), or it can let the format-specific loader functions raise errors about stream_ids and that kind of thing.

Curious if people have any thoughts!

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 reviewing load_extractor() and the format-specific loader functions mentioned in the issue. The API, format-detection order, stream selection, and failure behavior are still open questions, and the issue does not define a concrete completion criterion; clarify those decisions before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.