From caefa4e2f7fdc4a987802bfc78fd463b0a78f9cf Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 10 Jul 2024 19:28:46 +0200 Subject: [PATCH] Fix pca transform error --- src/spikeinterface/postprocessing/principal_component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/postprocessing/principal_component.py b/src/spikeinterface/postprocessing/principal_component.py index 8eb375e90b..6252c0582b 100644 --- a/src/spikeinterface/postprocessing/principal_component.py +++ b/src/spikeinterface/postprocessing/principal_component.py @@ -493,7 +493,7 @@ def _transform_waveforms(self, spikes, waveforms, pca_model, progress_bar): try: proj = pca_model.transform(wfs[:, :, wf_ind]) pca_projection[:, :, wf_ind][spike_mask, :] = proj - except NotFittedError as e: + except: # this could happen if len(wfs) is less then n_comp for a channel project_on_non_fitted = True if project_on_non_fitted: