Skip to content

Let get_streams work from the path alone on Neuralynx, Biocam and Blackrock - #4727

Open
h-mayorquin wants to merge 2 commits into
SpikeInterface:mainfrom
h-mayorquin:automatic_propagation
Open

Let get_streams work from the path alone on Neuralynx, Biocam and Blackrock#4727
h-mayorquin wants to merge 2 commits into
SpikeInterface:mainfrom
h-mayorquin:automatic_propagation

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

get_streams and get_num_blocks hand their arguments straight to cls.map_to_neo_kwargs, and callers pass only the path, since that is all most extractors need. Neuralynx and Biocam declare extra parameters there without defaults, so get_neo_streams("neuralynx", folder_path) raises TypeError: map_to_neo_kwargs() missing 2 required positional arguments and Biocam does the same for fill_gaps_strategy. The error comes from our own signature rather than from neo, which has good defaults for all of these, and it fires before the reader is ever constructed, which leaves the function the how-to guides recommend for listing streams unusable on those two formats. Blackrock was unreachable from the other direction, since gap_tolerance_ms never entered map_to_neo_kwargs at all and was injected into neo_kwargs inside __init__ afterwards.

I gave the Neuralynx and Biocam parameters the same defaults their constructors already pass, so discovery opens the file the way the extractor will rather than the way neo would, and moved Blackrock's gap_tolerance_ms into map_to_neo_kwargs so that it travels with the path. This has broken once per neo argument added since 2024, each time in a pull request that added the argument to the constructor without noticing the second caller, so the guard belongs in RecordingCommonTestSuite rather than in a test naming the three formats we happened to look at. It now calls get_streams for every entity, which covers each neo format we have data for and any format added later. I also gave NeuralynxSortingExtractor the exclude_filename that its recording counterpart has had since 2024, keeping neo's own default, since it reads through the same NeuralynxRawIO and simply never got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant