Skip to content

Implement the cached_lexsorted_spike_vector. - #4315

Merged
yger merged 26 commits into
SpikeInterface:mainfrom
samuelgarcia:lexsort_cache
Jan 14, 2026
Merged

yger merged 26 commits into
SpikeInterface:mainfrom
samuelgarcia:lexsort_cache

Conversation

@samuelgarcia

Copy link
Copy Markdown
Member

Idea from Pierre Yger:
Implement the sorting._cached_lexsorted_spike_vector
This PR also remove the sorting._cached_spike_trains because it become useless

The must merged and discussed before #4308

@yger

To be discussed 2 possibilities:

  • we have 2 functions : to_spike_vector() + to_reordered_spike_vector()
  • to_spike_vector() have a lexsort option and can render diffrent order

samuelgarcia and others added 16 commits January 13, 2026 13:31
…e into lexsort_cache

# Conflicts:
#	src/spikeinterface/core/basesorting.py
@yger

yger commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Can I start building my PR on this one ? @samuelgarcia

Comment thread src/spikeinterface/core/basesorting.py Resolved
@alejoe91 alejoe91 added the core Changes to core module label Jan 14, 2026
Comment thread doc/modules/core.rst Resolved
Comment thread src/spikeinterface/core/basesorting.py Resolved
Comment thread src/spikeinterface/core/basesorting.py Outdated
if propagate_cache and self._cached_spike_trains is not None:
sorting._cached_spike_trains = self._cached_spike_trains
if propagate_cache:
sorting._cached_lexsorted_spike_vector = deepcopy(self._cached_lexsorted_spike_vector)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be None, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it is an empty dict by default I change it with len() > 0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I also did more cache propagation now

Comment thread src/spikeinterface/core/basesorting.py Resolved
Comment thread src/spikeinterface/core/basesorting.py Resolved
@samuelgarcia

Copy link
Copy Markdown
Member Author

@alejoe91 @chrishalcrow more or less ready on my side

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.

4 participants