Skip to content

Handle peak_sign for quality metrics in _handle_backward_compatibility_on_load#4481

Merged
alejoe91 merged 1 commit intoSpikeInterface:mainfrom
chrishalcrow:qm-peaksign-backwards-compat
Mar 30, 2026
Merged

Handle peak_sign for quality metrics in _handle_backward_compatibility_on_load#4481
alejoe91 merged 1 commit intoSpikeInterface:mainfrom
chrishalcrow:qm-peaksign-backwards-compat

Conversation

@chrishalcrow
Copy link
Copy Markdown
Member

In #4403, we passed peak_sign to get_template_extremum_channel in _prepare_data for quality metrics.

In the past, the default peak_sign here was None but this is not allowed: we assert that it must be in ["pos", "neg", "both"]. Hence if you load an old analyzer (with peak_sign = None) and recompute (e.g. when merging) this assertion fails! This PR fixes this issue by trying to set peak_sign in _handle_backward_compatibility_on_load. It looks through all the other metric's params to see if the user set peak_sign somewhere. If not, it uses the old default, "neg".

At the top of my dev to-do list is: make a gh-actions test suite for backwards compatibility. Will do it soon!!

@chrishalcrow chrishalcrow added the bug Something isn't working label Mar 30, 2026
@chrishalcrow chrishalcrow requested a review from alejoe91 March 30, 2026 13:29
@alejoe91
Copy link
Copy Markdown
Member

At the top of my dev to-do list is: make a gh-actions test suite for backwards compatibility. Will do it soon!!

For inspiration form #4260: https://github.com/alejoe91/spikeinterface/blob/zarrv3/.github/workflows/test_zarr_compat.yml

@alejoe91 alejoe91 merged commit 6b47603 into SpikeInterface:main Mar 30, 2026
15 checks passed
alejoe91 pushed a commit to alejoe91/spikeinterface that referenced this pull request Mar 30, 2026
@alejoe91 alejoe91 mentioned this pull request Mar 30, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants