Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove toy_example from test codebase (2) #2920

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading