Open DradeAW opened 10 months ago
In this case, would you expect a spike_amplitudes
folder with an empty numpy array? Or should the function just warn and return nothing?
I don't even expect a warning, just returning an empty array (and if in folder mode, making sure you can load the empty array).
I don't think a warning should be thrown, I think it should work in all cases?
I think I have a similar issue. Spike sorting finishes complitely fine, but the wave extractor crashes with an error:
extract waveforms memmap multi buffer: 0%| | 0/3 [00:00<?, ?it/s]
extract waveforms memmap multi buffer: 100%|██████████| 3/3 [00:00<00:00, 77.41it/s]
Fitting PCA: 0it [00:00, ?it/s]
Fitting PCA: 0it [00:00, ?it/s]
Projecting waveforms: 0it [00:00, ?it/s]
Projecting waveforms: 0it [00:00, ?it/s]
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/misc_metrics.py:702: UserWarning:
warnings.warn("")
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/misc_metrics.py:1429: UserWarning: The `sd_ratio` metric require the `spike_amplitudes` waveform extension. Use the `postprocessing.compute_spike_amplitudes()` functions. SD ratio metric will be set to NaN
warnings.warn(
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:127: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, metric_name] = pd.Series(res)
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py:132: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
metrics.loc[non_empty_unit_ids, col] = pd.Series(res[i])
Traceback (most recent call last):
File "~/spikeinterface/runthepipe2.py", line 501, in <module>
runextractors(last,job_kwargs,preproc_saved,sorting_saved)
File "~/spikeinterface/runthepipe2.py", line 171, in runextractors
metrics = compute_quality_metrics(we, load_if_exists=True,**job_kwargs)
File "~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py", line 235, in compute_quality_metrics
qmc.run(verbose=verbose, **job_kwargs)
File "~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/core/waveform_extractor.py", line 2017, in run
self._run(**kwargs)
File "~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/quality_metric_calculator.py", line 140, in _run
pc_metrics = calculate_pc_metrics(
File "~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/qualitymetrics/pca_metrics.py", line 137, in calculate_pc_metrics
all_labels, all_pcs = pca.get_all_projections()
File "~/.local/apps/spikes/lib/python3.10/site-packages/spikeinterface/postprocessing/principal_component.py", line 162, in get_all_projections
all_labels = np.concatenate(all_labels, axis=0)
File "<__array_function__ internals>", line 180, in concatenate
ValueError: need at least one array to concatenate
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "~/spikeinterface/runthepipe2.py", line 504, in <module>
raise RuntimeError(f'Exctractors failed: {e}')
RuntimeError: Exctractors failed: need at least one array to concatenate
spikeinterface
version 0.100.0 from pip.If this is the same problem, is there any hope to fix it?
Computing the spike amplitudes crashes when giving a sorting with no unit, rather than simply doing nothing.