LorenFrankLab / spyglass

Neuroscience data analysis framework for reproducible research built by Loren Frank Lab at UCSF
https://lorenfranklab.github.io/spyglass/
MIT License
94 stars 43 forks source link

Explicit handling of no-spikes during curation #1154

Open CBroz1 opened 1 month ago

CBroz1 commented 1 month ago

The extraction notebooks use try/except to skip instances of no units found.

The notebook: https://github.com/LorenFrankLab/spyglass/blob/448fffd8b916786c593dc6946ee8b4d9a3794bc5/notebooks/py_scripts/40_Extracting_Clusterless_Waveform_Features.py#L176-L180

This KeyError is potentially thrown by the process that looks for spike times in the units object: https://github.com/LorenFrankLab/spyglass/blob/448fffd8b916786c593dc6946ee8b4d9a3794bc5/src/spyglass/spikesorting/v1/curation.py#L351-L354

Instead of using a KeyError to handle this case, we should either handle the null entry (i.e., #849) or raise a more specific error