Skip to content

Commit

Permalink
Merge pull request #2717 from zm711/example-fix
Browse files Browse the repository at this point in the history
Fix example broken by #2684
  • Loading branch information
alejoe91 authored Apr 14, 2024
2 parents 6bb7360 + 74b1c11 commit 0540bf8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/modules_gallery/core/plot_4_sorting_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@
# when using format="binary_folder" or format="zarr"

folder = "analyzer_folder"
analyzer = create_sorting_analyzer(sorting=sorting, recording=recording, format="binary_folder", folder=folder)
analyzer = create_sorting_analyzer(sorting=sorting,
recording=recording,
format="binary_folder",
return_scaled=True, # this is the default to attempt to return scaled
folder=folder
)
print(analyzer)

# then it can be loaded back
Expand All @@ -90,7 +95,7 @@
method="uniform",
max_spikes_per_unit=500,
)
analyzer.compute("waveforms", ms_before=1.0, ms_after=2.0, return_scaled=True)
analyzer.compute("waveforms", ms_before=1.0, ms_after=2.0)
analyzer.compute("templates", operators=["average", "median", "std"])
print(analyzer)

Expand All @@ -100,12 +105,12 @@
# using parallel processing (recommended!). Like this

analyzer.compute(
"waveforms", ms_before=1.0, ms_after=2.0, return_scaled=True, n_jobs=8, chunk_duration="1s", progress_bar=True
"waveforms", ms_before=1.0, ms_after=2.0, n_jobs=8, chunk_duration="1s", progress_bar=True
)

# which is equivalent to this:
job_kwargs = dict(n_jobs=8, chunk_duration="1s", progress_bar=True)
analyzer.compute("waveforms", ms_before=1.0, ms_after=2.0, return_scaled=True, **job_kwargs)
analyzer.compute("waveforms", ms_before=1.0, ms_after=2.0, **job_kwargs)

#################################################################################
# Because certain extensions rely on others (e.g. we need waveforms to calculate
Expand Down

0 comments on commit 0540bf8

Please sign in to comment.