Skip to content

Override search_cached_spikes_sorted for identity selections - #4845

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
grahamfindlay:fix/units-selection-lazy-search
Oct 9, 2026
Merged

alejoe91 merged 2 commits into
SpikeInterface:mainfrom
grahamfindlay:fix/units-selection-lazy-search

Conversation

@grahamfindlay

@grahamfindlay grahamfindlay commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

In #4783 an identity selection of a lazy Zarr array shares the parent's
lazy vector, but after #4809 UnitSelectionSorting inherited the
BaseSorting's search_cached_spike_sorted, which would see a non-ndarray
and raise an error.

The fix here is to just override the method and delegate the search to
the parent for identity selections. Since the identity selection
literally shares the parent's vector and segment slices, the parent's
search is guaranteed to give the right positions.

@alejoe91

In SpikeInterface#4783 an identity selection of a lazy Zarr array shares the parent's
lazy vector, but after SpikeInterface#4809 UnitSelectionSorting inherited the
BaseSorting's search_cached_spike_sorted, which would see a non-ndarray
and raise an error.

The fix here is to just override the method and delegate the search to
the parent for identity selections. Since the identity selection
literally shares the parent's vector and segment slices, the parent's
search is guaranteed to give the right positions.
@grahamfindlay grahamfindlay changed the title Fix search_cached_spikes_sorted on identity selections of a lazy Zarr sorting Override search_cached_spikes_sorted for identity selections Oct 8, 2026
@grahamfindlay

grahamfindlay commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

The Python 3.14 tests were failing because the tests from #4783 and #4809 were missing the newly required @pytest.mark.requires_zarr_write, and I saw that Alessio had already fixed this in #4840 , so I just cherry-picked his fix here (since this PR is f/u on #4783 and #4809 anyways, and it sounds like #4840 will not get merged soon).

@alejoe91 alejoe91 added the core Changes to core module label Oct 9, 2026
@alejoe91 alejoe91 added this to the 0.105.1 milestone Oct 9, 2026
@alejoe91
alejoe91 merged commit f78e9bf into SpikeInterface:main Oct 9, 2026
17 checks passed
alejoe91 added a commit to alejoe91/spikeinterface that referenced this pull request Oct 9, 2026
@alejoe91 alejoe91 mentioned this pull request Oct 9, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants