spikeinterface
spikeinterface copied to clipboard
`.save_to_folder()` fails for the `InjectDriftingTemplatesRecording`
When trying to save a hybrid recording, I get the error TypeError: Object of type DriftingTemplates is not JSON serializable
. This makes sense, because DriftingTemplates inherits from Templates which is a dataclass and not a BaseExtractor, so it will not be .to_dict()
ed by https://github.com/SpikeInterface/spikeinterface/blob/main/src/spikeinterface/core/base.py#L423 even though it has a .to_dict()
method.
I'm not sure how to resolve this? One could maybe make Templates subclass BaseExtractor while still being a dataclass? Although it does feel a bit strange to json-serialize a large array of templates. Anyway, wanted to see what you all think, thanks!