Skip to content

SortingAnalyzer: add read_only mode (different than lazy)#4713

Open
alejoe91 wants to merge 5 commits into
SpikeInterface:mainfrom
alejoe91:lazy-versus-read-only
Open

SortingAnalyzer: add read_only mode (different than lazy)#4713
alejoe91 wants to merge 5 commits into
SpikeInterface:mainfrom
alejoe91:lazy-versus-read-only

Conversation

@alejoe91

Copy link
Copy Markdown
Member

In #4623 (and #4709) we added a lazy mode for loading the SortingAnalyzer. This kept extension data and spike vector unmaterialized to avoid loading large arrays in memory. The lazy mode though did not allow any computation.
However, lazy mode could be used also to compute extensions for large datasets (see #4703) to minimize the overall memory footprint of computations.

To make these 2 use cases separate, this PR adds a read_only flag for loading SortingAnalyzer (e.g., when loading for the GUI), which prevents any saving of extensions). The lazy mode has been extended for creating analyzers, computing, and svaing/merging/splitting.

For very large datasets, one could now use this (especially in conjunction with #4703), to avoid loading large arrays in memory:

analyzer = si.create_sorting_analyzer(sorting, recording, format="zarr"/"binary_folder", folder="my-folder", lazy=True)

The PR also propagates the lazy argument to the parallel computation of PCA metrics.

@alejoe91 alejoe91 added core Changes to core module performance Performance issues/improvements labels Jul 24, 2026
@alejoe91 alejoe91 changed the title SortingAnalyzer: add read_only mode (different than lazy`) SortingAnalyzer: add read_only mode (different than lazy) Jul 24, 2026
@alejoe91 alejoe91 added this to the 0.105.0 milestone Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core module performance Performance issues/improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant