1
1
import time
2
2
from pathlib import Path
3
+ import pprint
3
4
import logging
4
5
logger = logging .getLogger (__name__ )
5
6
@@ -137,6 +138,14 @@ def run_kilosort(settings, probe=None, probe_name=None, filename=None,
137
138
138
139
tic0 = time .time ()
139
140
ops = initialize_ops (settings , probe , data_dtype , do_CAR , invert_sign , device )
141
+ # Remove some stuff that doesn't need to be printed twice, then pretty-print
142
+ # format for log file.
143
+ ops_copy = ops .copy ()
144
+ _ = ops_copy .pop ('settings' )
145
+ _ = ops_copy .pop ('probe' )
146
+ print_ops = pprint .pformat (ops_copy , indent = 4 , sort_dicts = False )
147
+ logger .debug (f"Initial ops:\n { print_ops } \n " )
148
+
140
149
141
150
# Set preprocessing and drift correction parameters
142
151
ops = compute_preprocessing (ops , device , tic0 = tic0 , file_object = file_object )
@@ -147,10 +156,10 @@ def run_kilosort(settings, probe=None, probe_name=None, filename=None,
147
156
ops , device , tic0 = tic0 , progress_bar = progress_bar ,
148
157
file_object = file_object
149
158
)
150
-
151
- # TODO: don't think we need to do this actually
152
- # Save intermediate `ops` for use by GUI plots
153
- io . save_ops ( ops , results_dir )
159
+
160
+ # Check scale of data for log file
161
+ b1 = bfile . padded_batch_to_torch ( 0 ). cpu (). numpy ()
162
+ logger . debug ( f"First batch min, max: { b1 . min (), b1 . max () } " )
154
163
155
164
# Sort spikes and save results
156
165
st ,tF , _ , _ = detect_spikes (ops , device , bfile , tic0 = tic0 ,
0 commit comments