88
99os .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 )
1329def 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
4061def test_kilosort2 (run_kwargs ):
@@ -61,3 +82,7 @@ def test_yass(run_kwargs):
6182def 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 )
0 commit comments