Skip to content

perf: avoid duplication of PCA array with reshape - #283

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
alejoe91:avoid-pca-duplication
Oct 7, 2026
Merged

alejoe91 merged 2 commits into
SpikeInterface:mainfrom
alejoe91:avoid-pca-duplication

Conversation

@alejoe91

Copy link
Copy Markdown
Member

The self.pc_data.swapaxes(1,2).reshape(self.pc_data.shape[0], -1) was essentialy duplicating the full PCA buffer in memory, which can be very large already.

This PR modifies the construction of the controller._pc_projections so that reshaping ends up being a view.

Comment thread spikeinterface_gui/ndscatterview.py
Comment thread spikeinterface_gui/controller.py

@chrishalcrow chrishalcrow left a comment

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.

Makes sense, looks good on tests and on local data.

@alejoe91
alejoe91 merged commit 7bbb7d3 into SpikeInterface:main Oct 7, 2026
2 checks 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.

2 participants