From 5b63af43cb881ecbb8226dce247c63c8b0d343b5 Mon Sep 17 00:00:00 2001 From: chrishalcrow <57948917+chrishalcrow@users.noreply.github.com> Date: Fri, 3 May 2024 15:54:51 +0100 Subject: [PATCH] Rerun quickstart again! --- doc/get_started/quickstart.rst | 28 ++++++++++++++++++++++++++++ examples/get_started/quickstart.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/doc/get_started/quickstart.rst b/doc/get_started/quickstart.rst index aa8cc401bc..8f069ddca7 100644 --- a/doc/get_started/quickstart.rst +++ b/doc/get_started/quickstart.rst @@ -518,7 +518,35 @@ Many of the extensions have parameters you can tune +As you can see, it becomes a bit overwhelming if you’re computing lots of extensions. +Luckily, there’s some nice syntax for this very situation. We can redo the last +nine compute statements in one command as follows +.. code:: ipython3 + + extensions_to_compute = [ + "random_spikes", + "waveforms", + "noise_levels", + "templates", + "spike_amplitudes", + "unit_locations", + "spike_locations", + "correlograms", + "template_similarity" + ] + + extension_params = { + "unit_locations": {"method": "center_of_mass"}, + "spike_locations": {"ms_before": 0.1}, + "correlograms": {"bin_ms": 0.1}, + "template_similarity": {"method": "cosine_similarity"} + } + + analyzer_TDC.compute(extensions_to_compute, extension_params=extension_params) + +Which you might find easier. Note that if we pass no extension parameters, the +computation simply uses the default parameters. Find out more about the available parameters and extensions `here `__. diff --git a/examples/get_started/quickstart.py b/examples/get_started/quickstart.py index d4dde3a86d..3a181d27e0 100644 --- a/examples/get_started/quickstart.py +++ b/examples/get_started/quickstart.py @@ -254,6 +254,36 @@ analyzer_TDC.compute("template_similarity", method="cosine_similarity") # - +# As you can see, it becomes a bit overwhelming if you’re computing lots of extensions. +# Luckily, there’s some nice syntax for this very situation. We can redo the last +# nine compute statements in one command as follows + +# + +extensions_to_compute = [ + "random_spikes", + "waveforms", + "noise_levels", + "templates", + "spike_amplitudes", + "unit_locations", + "spike_locations", + "correlograms", + "template_similarity" +] + +extension_params = { + "unit_locations": {"method": "center_of_mass"}, + "spike_locations": {"ms_before": 0.1}, + "correlograms": {"bin_ms": 0.1}, + "template_similarity": {"method": "cosine_similarity"} +} + +analyzer_TDC.compute(extensions_to_compute, extension_params=extension_params) +# - + +# Which you might find easier. Note that if we pass no extension parameters, the +# computation simply uses the default parameters. + # Find out more about the available parameters and extensions [here](https://spikeinterface.readthedocs.io/en/latest/modules/postprocessing.html). # The calculations are saved in the `extensions` subfolder of the `SortingAnalyzer` folder.