88
99os .environ ['SINGULARITY_DISABLE_CACHE' ] = 'true'
1010
11+ # test docker or singularity
12+ DOCKER_SINGULARITY = "singularity" # "docker"
13+
14+
15+ def generate_run_kwargs ():
16+ test_recording , _ = se .toy_example (
17+ duration = 30 ,
18+ seed = 0 ,
19+ num_channels = 64 ,
20+ num_segments = 1
21+ )
22+ test_recording = test_recording .save (name = 'toy' )
23+ test_recording .set_channel_gains (1 )
24+ test_recording .set_channel_offsets (1 )
25+ run_kwargs = dict (recording = test_recording , verbose = True )
26+ if DOCKER_SINGULARITY == "singularity" :
27+ run_kwargs ["singularity_image" ] = True
28+ elif DOCKER_SINGULARITY == "docker" :
29+ run_kwargs ["docker_image" ] = True
30+ else :
31+ raise Exception ("DOCKER_SINGULARITY can be 'docker' or 'singularity'" )
32+ return run_kwargs
33+
1134
1235@pytest .fixture (autouse = True )
1336def work_dir (request , tmp_path ):
@@ -27,16 +50,7 @@ def work_dir(request, tmp_path):
2750
2851@pytest .fixture
2952def run_kwargs (work_dir ):
30- test_recording , _ = se .toy_example (
31- duration = 30 ,
32- seed = 0 ,
33- num_channels = 64 ,
34- num_segments = 1
35- )
36- test_recording .set_channel_gains (1 )
37- test_recording .set_channel_offsets (1 )
38- test_recording = test_recording .save (name = 'toy' )
39- return dict (recording = test_recording , verbose = True , singularity_image = True )
53+ return generate_run_kwargs ()
4054
4155
4256def test_spykingcircus (run_kwargs ):
@@ -78,11 +92,14 @@ def test_kilosort1(run_kwargs):
7892 sorting = ss .run_kilosort (output_folder = "kilosort" , useGPU = False , ** run_kwargs )
7993 print (sorting )
8094
81-
8295def test_combinato (run_kwargs ):
8396 rec = run_kwargs ['recording' ]
8497 channels = rec .get_channel_ids ()[0 :1 ]
8598 rec_one_channel = rec .channel_slice (channels )
8699 run_kwargs ['recording' ] = rec_one_channel
87100 sorting = ss .run_combinato (output_folder = 'combinato' , ** run_kwargs )
88101 print (sorting )
102+
103+ if __name__ == "__main__" :
104+ kwargs = generate_run_kwargs ()
105+ test_ironclust (kwargs )
0 commit comments