Skip to content

add ci tests #26

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

Merged
merged 26 commits into from
Jun 26, 2022
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
39 changes: 39 additions & 0 deletions .github/workflows/test_containers_singularity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test sorter images in singularity

on:
pull_request:
branches: [main]
types: [synchronize, opened, reopened, ready_for_review]

jobs:
build-and-test:
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@v2
with:
python-version: 3.8
- uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3
- name: Install dependencies
run: |
sudo apt update
sudo apt install git

# get SI form master
git clone https://github.com/SpikeInterface/spikeinterface.git
cd spikeinterface
pip install .
pip install -r requirements_full.txt

cd ..
pip install spython pytest tridesclous
- name: Test singularity
run: |
pytest -v tests/test_singularity_containers.py
70 changes: 70 additions & 0 deletions tests/test_singularity_containers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import pytest

import spikeinterface.sorters as ss
from spikeinterface.core.testing_tools import generate_recording

recording = generate_recording(
num_channels=32,
sampling_frequency=30000.0, # in Hz
durations=[120],
set_probe=True,
ndim=2,
)

recording2 = recording.save(folder="test_recording")

kwargs = dict(recording=recording2, verbose=True, singularity_image=True)


@pytest.mark.xfail(reason="FAILING: investigate why")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is happening because of inconsistent naming format:

  • spykingcircus used to call run_sorter
  • spyking_circus as python module
  • spyking-circus as image name

I have created this PR to properly raise the error

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed SORTER_DOCKER_MAP in run_sorter.py from spikeinterface for tests.
We need to unify naming format for spyking-cirucs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I'm getting error using data from generate_recording for spyking-circus.

When I change to toy data it works well:

se.toy_example(
        duration=30,
        seed=0,
        num_channels=32,
        num_segments=1
    )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange! @alejoe91, do you have any idea why one might work and not the other?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image runs well, but It was raising here when extracting output.
I could see different result[...].hdf5 files in output folder, but not 'result-merged.hdf5' or 'result.hdf5'

def test_spyking_circus():
ss.run_spykingcircus(output_folder="spyking_circus", **kwargs)


@pytest.mark.xfail(reason="FAILING: investigate why")
def test_mountainsort4():
ss.run_mountainsort4(output_folder="mountainsort4", **kwargs)


def test_tridesclous():
ss.run_tridesclous(output_folder="tridesclous", **kwargs)


def test_klusta():
ss.run_klusta(output_folder="klusta", **kwargs)


def test_ironclust():
ss.run_ironclust(output_folder="ironclust", fGpu=False, **kwargs)


def test_waveclus():
ss.run_waveclus(output_folder="waveclus", **kwargs)


def test_hdsort():
ss.run_hdsort(output_folder="hdsort", **kwargs)


def test_kilosort1():
ss.run_kilosort(output_folder="kilosort", useGPU=False, **kwargs)


@pytest.mark.skip(reason="GPU required")
def test_kilosort2():
ss.run_kilosort2(output_folder="kilosort2", **kwargs)


@pytest.mark.skip(reason="GPU required")
def test_kilosort2_5():
ss.run_kilosort2_5(output_folder="kilosort2_5", **kwargs)


@pytest.mark.skip(reason="GPU required")
def test_kilosort3():
ss.run_kilosort3(output_folder="kilosort3", **kwargs)


@pytest.mark.skip(reason="GPU required")
def test_pykilosort():
ss.run_pykilosort(output_folder="pykilosort", **kwargs)