Skip to content

Commit

Permalink
Merge pull request #2920 from chrishalcrow/remove-toy-example
Browse files Browse the repository at this point in the history
Remove toy_example from test codebase (2)
  • Loading branch information
samuelgarcia authored May 30, 2024
2 parents 6af4d8d + 567ff64 commit af3c8b3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from pathlib import Path
import numpy as np

from spikeinterface.core import create_sorting_analyzer
from spikeinterface.extractors import toy_example
from spikeinterface.core import create_sorting_analyzer, generate_ground_truth_recording
from spikeinterface.comparison import compare_templates, compare_multiple_templates


Expand All @@ -27,9 +26,7 @@ def test_compare_multiple_templates():
duration = 60
num_channels = 8

rec, sort = toy_example(duration=duration, num_segments=1, num_channels=num_channels)
# rec = rec.save(folder=test_dir / "rec")
# sort = sort.save(folder=test_dir / "sort")
rec, sort = generate_ground_truth_recording(durations=[duration], num_channels=num_channels)

# split recording in 3 equal slices
fs = rec.get_sampling_frequency()
Expand Down
5 changes: 3 additions & 2 deletions src/spikeinterface/extractors/tests/test_mdaextractors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest
from pathlib import Path
from spikeinterface.core.testing import check_recordings_equal, check_sortings_equal
from spikeinterface.extractors import toy_example, MdaRecordingExtractor, MdaSortingExtractor
from spikeinterface.core import generate_ground_truth_recording
from spikeinterface.extractors import MdaRecordingExtractor, MdaSortingExtractor

if hasattr(pytest, "global_test_folder"):
cache_folder = pytest.global_test_folder / "extractors"
Expand All @@ -10,7 +11,7 @@


def test_mda_extractors():
rec, sort = toy_example(num_segments=1, num_units=10)
rec, sort = generate_ground_truth_recording(durations=[10.0], num_units=10)

MdaRecordingExtractor.write_recording(rec, cache_folder / "mdatest")
rec_mda = MdaRecordingExtractor(cache_folder / "mdatest")
Expand Down
5 changes: 3 additions & 2 deletions src/spikeinterface/extractors/tests/test_shybridextractors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest
from pathlib import Path
from spikeinterface.core import generate_ground_truth_recording
from spikeinterface.core.testing import check_recordings_equal, check_sortings_equal
from spikeinterface.extractors import toy_example, SHYBRIDRecordingExtractor, SHYBRIDSortingExtractor
from spikeinterface.extractors import SHYBRIDRecordingExtractor, SHYBRIDSortingExtractor

if hasattr(pytest, "global_test_folder"):
cache_folder = pytest.global_test_folder / "extractors"
Expand All @@ -11,7 +12,7 @@

@pytest.mark.skipif(True, reason="SHYBRID only tested locally")
def test_shybrid_extractors():
rec, sort = toy_example(num_segments=1, num_units=10)
rec, sort = generate_ground_truth_recording(durations=[10.0], num_units=10)

SHYBRIDSortingExtractor.write_sorting(sort, cache_folder / "shybridtest")
sort_shybrid = SHYBRIDSortingExtractor(
Expand Down
6 changes: 3 additions & 3 deletions src/spikeinterface/preprocessing/tests/test_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

import shutil

from spikeinterface.core import generate_recording

from spikeinterface.preprocessing import correct_motion, load_motion_info

from spikeinterface.extractors import toy_example

import numpy as np

if hasattr(pytest, "global_test_folder"):
Expand All @@ -19,7 +18,8 @@


def test_estimate_and_correct_motion():
rec, sorting = toy_example(num_segments=1, duration=30.0, num_units=10, num_channels=12)
rec = generate_recording(durations=[30.0], num_channels=12)

print(rec)

folder = cache_folder / "estimate_and_correct_motion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
synthesize_random_firings,
)

# from spikeinterface.extractors.toy_example import toy_example
from spikeinterface.qualitymetrics.utils import create_ground_truth_pc_distributions

from spikeinterface.qualitymetrics import calculate_pc_metrics
Expand Down

0 comments on commit af3c8b3

Please sign in to comment.