spikeinterface
spikeinterface copied to clipboard
si.extract_waveforms don't compute templates if folder exists
Hi,
I came across a (not very likely) scenario where an unintended behaviour happens.
If you call si.extract_waveforms(..., load_if_exists=True, precompute_template=("average", )), and the folder already exists but the file templates_average.npy is missing, then it will not precompute the templates.
In my case it was relevant because SpikeInterface crashed during the templates computation due to a "too many open files error". But I guess it can also be relevant if someone adds another template mode (e.g. median) and the folder already exists.