remove toy_example from core for test
@@ -2,8 +2,9 @@ import pytest
import shutil
from pathlib import Path
-from spikeinterface import WaveformExtractor, load_extractor, extract_waveforms
-from spikeinterface.extractors import toy_example
+from spikeinterface import (WaveformExtractor, load_extractor, extract_waveforms,
+ generate_recording, generate_sorting)
+
from spikeinterface.core import (get_template_amplitudes,
get_template_extremum_channel,
get_template_extremum_channel_peak_shift,
@@ -22,14 +23,17 @@ def setup_module():
if (cache_folder / folder_name).is_dir():
shutil.rmtree(cache_folder / folder_name)
- recording, sorting = toy_example(num_segments=2, num_units=10, num_channels=4)
+ durations = [10., 5.]
+ recording = generate_recording(durations=durations,num_channels=4)
+ sorting = generate_sorting(durations=durations, num_units=10)
+
+ recording.annotate(is_filtered=True)
recording.set_channel_groups([0, 0, 1, 1])
recording = recording.save(folder=cache_folder / 'toy_rec')
sorting.set_property("group", [0, 0, 0, 0, 1, 1, 1, 1, 1, 1])
sorting = sorting.save(folder=cache_folder / 'toy_sort')
- we = WaveformExtractor.create(
- recording, sorting, cache_folder / 'toy_waveforms')
+ we = WaveformExtractor.create(recording, sorting, cache_folder / 'toy_waveforms')
we.set_params(ms_before=3., ms_after=4., max_spikes_per_unit=500)
we.run_extract_waveforms(n_jobs=1, chunk_size=30000)
@@ -66,6 +70,7 @@ def test_get_template_extremum_channel_peak_shift():
# ax.axvline(we.nbefore + shift, color='red')
# plt.show()
+
def test_get_template_extremum_amplitude():
we = WaveformExtractor.load(cache_folder / 'toy_waveforms')
