Skip to content

Handle feature requests without stored waveform coverage - #70

Draft
rossant wants to merge 1 commit into
masterfrom
fix/empty-stored-waveform-features
Draft

rossant wants to merge 1 commit into
masterfrom
fix/empty-stored-waveform-features

Conversation

@rossant

@rossant rossant commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

When a feature request contains no spikes from the stored waveform reservoir, TemplateModel.get_features() attempts PCA on an empty array and raises ZeroDivisionError. This surfaced in Phy's ordinary Feature View while testing a subsampled waveform export.

Return the existing zero-filled feature tensor for missing coverage and preserve empty spike/channel selection shapes. Full and partial waveform projection keep their current behavior.

Validation: five regression cases use a real on-disk sorting. Three empty-input cases fail before the fix; all five pass afterward. The complete isolated suite passes 308 tests, and flake8 passes. Existing Phy/phylib environments are unchanged.

This is a separate dependency fix discovered during cortex-lab/phy#1428 validation. Bounded mode already filters requests against stored waveform IDs, so #1428 does not require a dependency bump for this guard.

Real-data validation: reopened a separate copy of the 469,725,567-spike converted test sorting in the ordinary main Phy GUI with this isolated phylib revision. The process exited zero with no tracebacks (the unchanged dependency produced five Feature View errors during the equivalent reopen). Complete assignments and group/notes files were byte-identical before and after the no-edit save. Original validation outputs and installed environments were retained. This is software integration evidence on a conversion with unverified acquisition exposure.

Cross-platform CI and minimum SpikeInterface compatibility passed.

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