Skip to content

Commit 221ee26

Browse files
Added info about ops, data scale to log file
1 parent 971697d commit 221ee26

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

kilosort/run_kilosort.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import time
22
from pathlib import Path
3+
import pprint
34
import logging
45
logger = logging.getLogger(__name__)
56

@@ -137,6 +138,14 @@ def run_kilosort(settings, probe=None, probe_name=None, filename=None,
137138

138139
tic0 = time.time()
139140
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+
140149

141150
# Set preprocessing and drift correction parameters
142151
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,
147156
ops, device, tic0=tic0, progress_bar=progress_bar,
148157
file_object=file_object
149158
)
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()}")
154163

155164
# Sort spikes and save results
156165
st,tF, _, _ = detect_spikes(ops, device, bfile, tic0=tic0,

0 commit comments

Comments
 (0)