-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Tauffer-Consulting/ci-tests
Tests-CI
- Loading branch information
Showing
4 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test sorter images in singularity | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [main] | ||
types: [synchronize, opened, reopened, ready_for_review] | ||
|
||
jobs: | ||
test-images: | ||
name: Test on (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# "macos-latest", "windows-latest" | ||
os: ["ubuntu-latest", ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- uses: eWaterCycle/setup-singularity@v7 | ||
with: | ||
singularity-version: 3.8.3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install tridesclous | ||
pip install -r requirements_test.txt | ||
- name: Run test singularity containers | ||
run: | | ||
pip install tridesclous | ||
pytest -sv tests/test_singularity_containers.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
git+https://github.com/SpikeInterface/spikeinterface.git#egg=spikeinterface[full] | ||
docker==5.0.3 | ||
spython==0.2.1 | ||
pytest==7.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import os | ||
import shutil | ||
|
||
import pytest | ||
|
||
import spikeinterface.extractors as se | ||
import spikeinterface.sorters as ss | ||
|
||
os.environ['SINGULARITY_DISABLE_CACHE'] = 'true' | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def work_dir(request, tmp_path): | ||
""" | ||
This fixture, along with "run_kwargs" creates one folder per | ||
test function using built-in tmp_path pytest fixture | ||
The tmp_path will be the working directory for the test function | ||
At the end of the each test function, a clean up will be done | ||
""" | ||
os.chdir(tmp_path) | ||
yield | ||
os.chdir(request.config.invocation_dir) | ||
shutil.rmtree(str(tmp_path)) | ||
|
||
|
||
@pytest.fixture | ||
def run_kwargs(work_dir): | ||
test_recording, _ = se.toy_example( | ||
duration=30, | ||
seed=0, | ||
num_channels=64, | ||
num_segments=1 | ||
) | ||
test_recording = test_recording.save(name='toy') | ||
return dict(recording=test_recording, verbose=True, singularity_image=True) | ||
|
||
|
||
def test_spykingcircus(run_kwargs): | ||
sorting = ss.run_spykingcircus(output_folder="spykingcircus", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_mountainsort4(run_kwargs): | ||
sorting = ss.run_mountainsort4(output_folder="mountainsort4", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_tridesclous(run_kwargs): | ||
sorting = ss.run_tridesclous(output_folder="tridesclous", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_klusta(run_kwargs): | ||
sorting = ss.run_klusta(output_folder="klusta", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_ironclust(run_kwargs): | ||
sorting = ss.run_ironclust(output_folder="ironclust", fGpu=False, **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_waveclus(run_kwargs): | ||
sorting = ss.run_waveclus(output_folder="waveclus", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_hdsort(run_kwargs): | ||
sorting = ss.run_hdsort(output_folder="hdsort", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
def test_kilosort1(run_kwargs): | ||
sorting = ss.run_kilosort(output_folder="kilosort", useGPU=False, **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
@pytest.mark.skip(reason="GPU required") | ||
def test_kilosort2(run_kwargs): | ||
sorting = ss.run_kilosort2(output_folder="kilosort2", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
@pytest.mark.skip(reason="GPU required") | ||
def test_kilosort2_5(run_kwargs): | ||
sorting = ss.run_kilosort2_5(output_folder="kilosort2_5", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
@pytest.mark.skip(reason="GPU required") | ||
def test_kilosort3(run_kwargs): | ||
sorting = ss.run_kilosort3(output_folder="kilosort3", **run_kwargs) | ||
print(sorting) | ||
|
||
|
||
@pytest.mark.skip(reason="GPU required") | ||
def test_pykilosort(run_kwargs): | ||
sorting = ss.run_pykilosort(output_folder="pykilosort", **run_kwargs) | ||
print(sorting) |