Skip to content

Commit cebc9d9

Browse files
committed
wip
1 parent 2422fdd commit cebc9d9

4 files changed

Lines changed: 45 additions & 6 deletions

File tree

pykilosort/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> /root/.profile
3030
RUN conda init bash
3131

3232
# Install python port of pykilosort
33-
RUN git clone -b drift_test_stable https://github.com/kushbanga/pykilosort.git /src/pykilosort
33+
RUN git clone https://github.com/int-brain-lab/pykilosort.git /src/pykilosort
3434
WORKDIR /src/pykilosort
3535
# Switch to MouseLand/develop branch - may revert to kushbanga/drift_test_stable in the future
36-
RUN git remote add MouseLand https://github.com/MouseLand/pykilosort.git && \
37-
git fetch MouseLand && git checkout MouseLand/develop && git checkout -b develop
36+
# RUN git remote add MouseLand https://github.com/MouseLand/pykilosort.git && \
37+
# git fetch MouseLand && git checkout MouseLand/develop && git checkout -b develop
3838

3939
# modify env file so that env extends on base
4040
RUN sed -i "s/pyks2/base/" pyks2.yml
41+
RUN sed -i "s/- spikeinterface//" pyks2.yml
42+
RUN cat pyks2.yml
4143

4244
# Create environment
4345
RUN conda env update --name base --file pyks2.yml --prune

pykilosort/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
docker build -t spikeinterface/pykilosort-base:latest -t spikeinterface/pykilosort-base:0.1.0 .
3+
docker build -t spikeinterface/pykilosort-base:latest -t spikeinterface/pykilosort-base:ibl-1.0.2 .

tests/test_containers_gpu.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@
88

99
os.environ['SINGULARITY_DISABLE_CACHE'] = 'true'
1010

11+
DOCKER_SINGULARITY = "docker" # "singularity"
12+
13+
def _run_kwargs():
14+
test_recording, _ = se.toy_example(
15+
duration=30,
16+
seed=0,
17+
num_channels=64,
18+
num_segments=1
19+
)
20+
test_recording = test_recording.save(name='toy')
21+
kwargs = dict(recording=test_recording, verbose=True)
22+
if DOCKER_SINGULARITY == "singularity":
23+
kwargs["singularity_image"] = True
24+
else:
25+
kwargs["docker_image"] = True
26+
return kwargs
1127

1228
@pytest.fixture(autouse=True)
1329
def work_dir(request, tmp_path):
@@ -34,7 +50,12 @@ def run_kwargs(work_dir):
3450
num_segments=1
3551
)
3652
test_recording = test_recording.save(name='toy')
37-
return dict(recording=test_recording, verbose=True, singularity_image=True)
53+
kwargs = dict(recording=test_recording, verbose=True)
54+
if DOCKER_SINGULARITY == "singularity":
55+
kwargs["singularity_image"] = True
56+
else:
57+
kwargs["docker_image"] = True
58+
return kwargs
3859

3960

4061
def test_kilosort2(run_kwargs):
@@ -61,3 +82,7 @@ def test_yass(run_kwargs):
6182
def test_pykilosort(run_kwargs):
6283
sorting = ss.run_pykilosort(output_folder="pykilosort", **run_kwargs)
6384
print(sorting)
85+
86+
if __name__ == "__main__":
87+
kwargs = _run_kwargs()
88+
test_kilosort2(kwargs)

tests/test_singularity_containers.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
os.environ['SINGULARITY_DISABLE_CACHE'] = 'true'
1010

11+
DOCKER_SINGULARITY = "docker" # "singularity"
12+
1113

1214
@pytest.fixture(autouse=True)
1315
def work_dir(request, tmp_path):
@@ -34,7 +36,12 @@ def run_kwargs(work_dir):
3436
num_segments=1
3537
)
3638
test_recording = test_recording.save(name='toy')
37-
return dict(recording=test_recording, verbose=True, singularity_image=True)
39+
kwargs = dict(recording=test_recording, verbose=True)
40+
if DOCKER_SINGULARITY == "singularity":
41+
kwargs["singularity_image"] = True
42+
else:
43+
kwargs["docker_image"] = True
44+
return kwargs
3845

3946

4047
def test_spykingcircus(run_kwargs):
@@ -75,3 +82,8 @@ def test_hdsort(run_kwargs):
7582
def test_kilosort1(run_kwargs):
7683
sorting = ss.run_kilosort(output_folder="kilosort", useGPU=False, **run_kwargs)
7784
print(sorting)
85+
86+
87+
if __name__ == "__main__":
88+
kwargs = run_kwargs(None)
89+
test_ironclust(kwargs)

0 commit comments

Comments
 (0)