spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Add more backwards compatibly for MockWaveformExtractor

Open chrishalcrow opened this issue 1 year ago • 2 comments

Added several methods to MockWaveformExtractor and changed arguments in compute_blah_extensions function.

Will keep in draft until tests are added.

Added:

  • format
  • get_available_extension_names
  • precompute_templates
  • sample_spikes
  • run_extract_waveforms
  • select_units
  • delete_extension
  • get_random_spikes (new - without a way of computing some random spikes, you can't compute templates and other things)

to MockWaveformExtractor

I changed the FunctionFactory for the compute_blah_extensions (e.g. compute_principal_components, compute_templates) for backwards compatibility. Previously these took the form compute_principal_components(waveform_extractor=we) as well ascompute_principal_components(we).

Not added some methods. These involve:

  • Extension classes (extensions are now objects of a new extension class) so it's hard to see how these will not break (extensions, get_extension_class, is_extension, load_extension, register_extension)
  • Loading stuff after loading your initial MockWaveformExtractor (load, load_from_folder, load_from zarr) -Segments since SortingAnalyzer seems to deal with segments a bit differently (get_template_segment and get_waveform_segment).

chrishalcrow avatar Mar 06 '24 12:03 chrishalcrow

Hi Chris, thanks for this. I will have a look soon. As a general comments the goal of backward compatibility was more load/use old computation rather than load/use/recompute old computation.

samuelgarcia avatar Mar 06 '24 13:03 samuelgarcia

Hi Chris, thanks for this. I will have a look soon. As a general comments the goal of backward compatibility was more load/use old computation rather than load/use/recompute old computation.

Sure. I was just aiming for as little broken as possible. With these changes, the pipelines in our lab work without any modification, and create lots of nice SortingAnalyzer folders as they go.

chrishalcrow avatar Mar 06 '24 16:03 chrishalcrow