Skip to content

Allow CurationV1 to save no-spikes case#1533

Open
CBroz1 wants to merge 4 commits intoLorenFrankLab:masterfrom
CBroz1:1532
Open

Allow CurationV1 to save no-spikes case#1533
CBroz1 wants to merge 4 commits intoLorenFrankLab:masterfrom
CBroz1:1532

Conversation

@CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Feb 17, 2026

Description

Adds fallback for no-spikes case to V1 save logic

Checklist:

  • N/a. If this PR should be accompanied by a release, I have updated the CITATION.cff
  • N/a. If this PR edits table definitions, I have included an alter snippet for release notes.
  • N/a. If this PR makes changes to position, I ran the relevant tests locally.
  • N/a. If this PR makes user-facing changes, I have added/edited docs/notebooks to reflect the changes
  • I have updated the CHANGELOG.md with PR number and description.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_times column by treating the sorting as empty and skipping merge application when there are no units.
  • Create an explicit empty pynwb.misc.Units table 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.

@edeno edeno requested a review from samuelbray32 February 17, 2026 16:50
CBroz1 and others added 2 commits February 18, 2026 10:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Samuel Bray <sam.bray@ucsf.edu>
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.

CurationV1 fails to write file with no spike times

3 participants