Skip to content

Commit

Permalink
Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Jan 9, 2025
1 parent fb9747d commit e839894
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/spikeinterface/sorters/internal/spyking_circus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,11 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):
np.save(clustering_folder / "noise_levels.npy", noise_levels)

if params["matched_filtering"]:
prototype, waveforms = get_prototype_and_waveforms_from_recording(
prototype, waveforms, _ = get_prototype_and_waveforms_from_recording(
recording_w,
ms_before=ms_before,
ms_after=ms_after,
seed=params["seed"],
return_waveforms=True,
**detection_params,
**job_kwargs,
)
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/sortingcomponents/peak_localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_localization_pipeline_nodes(
assert isinstance(peak_source, (PeakRetriever, SpikeRetriever))
# extract prototypes silently
job_kwargs["progress_bar"] = False
method_kwargs["prototype"] = get_prototype_and_waveforms_from_peaks(
method_kwargs["prototype"], _, _ = get_prototype_and_waveforms_from_peaks(
recording, peaks=peak_source.peaks, ms_before=ms_before, ms_after=ms_after, **job_kwargs
)
extract_dense_waveforms = ExtractDenseWaveforms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def test_detect_peaks_locally_exclusive_matched_filtering(recording, job_kwargs)

ms_before = 1.0
ms_after = 1.0
prototype = get_prototype_and_waveforms_from_peaks(
prototype, _, _ = get_prototype_and_waveforms_from_peaks(
recording, peaks=peaks_by_channel_np, ms_before=ms_before, ms_after=ms_after, **job_kwargs
)

Expand Down
8 changes: 4 additions & 4 deletions src/spikeinterface/sortingcomponents/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,17 @@ def get_prototype_and_waveforms(
Time in milliseconds after the peak to extract the waveform, by default 0.5.
seed : int or None, optional
Seed for random number generator, by default None.
return_waveforms : bool, optional
Whether to return the waveforms along with the prototype, by default False.
**all_kwargs : dict
Additional keyword arguments for peak detection and job kwargs.
Returns
-------
prototype : numpy.array
The prototype waveform.
waveforms : numpy.array, optional
The extracted waveforms, returned if return_waveforms is True.
waveforms : numpy.array
The extracted waveforms for the selected peaks.
peaks : numpy.array
The selected peaks used to extract waveforms.
"""
if peaks is None:
return get_prototype_and_waveforms_from_peaks(recording, n_peaks, ms_before=ms_before, ms_after=ms_after, seed=seed, **all_kwargs)
Expand Down

0 comments on commit e839894

Please sign in to comment.