|
| 1 | +import os |
| 2 | +import shutil |
| 3 | + |
| 4 | +import pytest |
| 5 | + |
| 6 | +import spikeinterface.extractors as se |
| 7 | +import spikeinterface.sorters as ss |
| 8 | + |
| 9 | + |
| 10 | +@pytest.fixture |
| 11 | +def work_dir(request, tmpdir_factory): |
| 12 | + tmpdir = tmpdir_factory.mktemp("work_dir") |
| 13 | + os.chdir(tmpdir) |
| 14 | + yield |
| 15 | + os.chdir(request.config.invocation_dir) |
| 16 | + shutil.rmtree(str(tmpdir)) |
| 17 | + |
| 18 | + |
| 19 | +@pytest.fixture |
| 20 | +def run_kwargs(work_dir): |
| 21 | + test_recording, _ = se.toy_example( |
| 22 | + duration=30, |
| 23 | + seed=0, |
| 24 | + num_channels=32, |
| 25 | + num_segments=1 |
| 26 | + ) |
| 27 | + test_recording = test_recording.save(name='toy') |
| 28 | + return dict(recording=test_recording, verbose=True, singularity_image=True) |
| 29 | + |
| 30 | + |
| 31 | +def test_spyking_circus(run_kwargs): |
| 32 | + sorting = ss.run_spykingcircus(output_folder="spyking_circus", **run_kwargs) |
| 33 | + print(sorting) |
| 34 | + |
| 35 | + |
| 36 | +@pytest.mark.xfail(reason="FAILING: investigate why") |
| 37 | +def test_mountainsort4(run_kwargs): |
| 38 | + sorting = ss.run_mountainsort4(output_folder="mountainsort4", **run_kwargs) |
| 39 | + print(sorting) |
| 40 | + |
| 41 | + |
| 42 | +def test_tridesclous(run_kwargs): |
| 43 | + sorting = ss.run_tridesclous(output_folder="tridesclous", **run_kwargs) |
| 44 | + print(sorting) |
| 45 | + |
| 46 | + |
| 47 | +def test_klusta(run_kwargs): |
| 48 | + sorting = ss.run_klusta(output_folder="klusta", **run_kwargs) |
| 49 | + print(sorting) |
| 50 | + |
| 51 | + |
| 52 | +def test_ironclust(run_kwargs): |
| 53 | + sorting = ss.run_ironclust(output_folder="ironclust", fGpu=False, **run_kwargs) |
| 54 | + print(sorting) |
| 55 | + |
| 56 | + |
| 57 | +def test_waveclus(run_kwargs): |
| 58 | + sorting = ss.run_waveclus(output_folder="waveclus", **run_kwargs) |
| 59 | + print(sorting) |
| 60 | + |
| 61 | + |
| 62 | +def test_hdsort(run_kwargs): |
| 63 | + sorting = ss.run_hdsort(output_folder="hdsort", **run_kwargs) |
| 64 | + print(sorting) |
| 65 | + |
| 66 | + |
| 67 | +def test_kilosort1(run_kwargs): |
| 68 | + sorting = ss.run_kilosort(output_folder="kilosort", useGPU=False, **run_kwargs) |
| 69 | + print(sorting) |
| 70 | + |
| 71 | + |
| 72 | +@pytest.mark.skip(reason="GPU required") |
| 73 | +def test_kilosort2(run_kwargs): |
| 74 | + sorting = ss.run_kilosort2(output_folder="kilosort2", **run_kwargs) |
| 75 | + print(sorting) |
| 76 | + |
| 77 | + |
| 78 | +@pytest.mark.skip(reason="GPU required") |
| 79 | +def test_kilosort2_5(run_kwargs): |
| 80 | + sorting = ss.run_kilosort2_5(output_folder="kilosort2_5", **run_kwargs) |
| 81 | + print(sorting) |
| 82 | + |
| 83 | + |
| 84 | +@pytest.mark.skip(reason="GPU required") |
| 85 | +def test_kilosort3(run_kwargs): |
| 86 | + sorting = ss.run_kilosort3(output_folder="kilosort3", **run_kwargs) |
| 87 | + print(sorting) |
| 88 | + |
| 89 | + |
| 90 | +@pytest.mark.skip(reason="GPU required") |
| 91 | +def test_pykilosort(run_kwargs): |
| 92 | + sorting = ss.run_pykilosort(output_folder="pykilosort", **run_kwargs) |
| 93 | + print(sorting) |
0 commit comments