Allow CurationV1 to save no-spikes case#1533
Open
CBroz1 wants to merge 4 commits intoLorenFrankLab:masterfrom
Open
Allow CurationV1 to save no-spikes case#1533CBroz1 wants to merge 4 commits intoLorenFrankLab:masterfrom
CurationV1 to save no-spikes case#1533CBroz1 wants to merge 4 commits intoLorenFrankLab:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a fallback path in CurationV1 NWB save logic to support “no spikes / empty units” sortings, ensuring an empty Units table can still be written and referenced downstream.
Changes:
- Handle missing
spike_timescolumn by treating the sorting as empty and skipping merge application when there are no units. - Create an explicit empty
pynwb.misc.Unitstable in the output analysis NWB when there are no unit IDs to write. - Add tests covering the no-spikes save path and verifying an NWB with an empty units table is readable; add a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/spyglass/spikesorting/v1/curation.py |
Adds no-spikes fallback for missing spike_times and writes an empty Units table when appropriate. |
tests/spikesorting/v1/test_curation.py |
Adds tests/fixtures to exercise no-spikes behavior and validate empty-units NWB readability. |
CHANGELOG.md |
Notes the no-spikes save support for CurationV1 and adjusts an existing entry’s formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
samuelbray32
approved these changes
Feb 20, 2026
Co-authored-by: Samuel Bray <sam.bray@ucsf.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds fallback for no-spikes case to V1 save logic
Checklist:
CITATION.cffaltersnippet for release notes.CHANGELOG.mdwith PR number and description.