Skip to content

Commit fdcc57a

Browse files
author
Jacob Pennington
committed
Fixed path conversion to strings for filename saved in ops
1 parent 63cb1a7 commit fdcc57a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

kilosort/io.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,15 @@ def save_ops(ops, results_dir=None):
482482
# Convert paths to strings before saving, otherwise ops can only be loaded
483483
# on the system that originally ran the code (causes problems for tests).
484484
ops['settings']['results_dir'] = str(results_dir)
485-
# TODO: why do these get saved twice?
486-
ops['filename'] = str(ops['filename'])
485+
if isinstance(ops['filename'], list):
486+
ops['filename'] = [str(f) for f in ops['filename']]
487+
else:
488+
ops['filename'] = str(ops['filename'])
487489
ops['data_dir'] = str(ops['data_dir'])
488-
ops['settings']['filename'] = str(ops['settings']['filename'])
490+
if isinstance(ops['settings']['filename'], list):
491+
ops['settings']['filename'] = [str(f) for f in ops['settings']['filename']]
492+
else:
493+
ops['settings']['filename'] = str(ops['settings']['filename'])
489494
ops['settings']['data_dir'] = str(ops['settings']['data_dir'])
490495

491496
# Convert pytorch tensors to numpy arrays before saving, otherwise loading

0 commit comments

Comments
 (0)