We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 093e848 commit e7ac089Copy full SHA for e7ac089
heudiconv/bids.py
@@ -339,7 +339,11 @@ def add_rows_to_scans_keys_file(fn, newrows):
339
# prepare all the data rows
340
data_rows = [[k] + v for k, v in fnames2info.items()]
341
# sort by the date/filename
342
- data_rows_sorted = sorted(data_rows, key=lambda x: (x[1], x[0]))
+ try:
343
+ data_rows_sorted = sorted(data_rows, key=lambda x: (x[1], x[0]))
344
+ except TypeError as exc:
345
+ lgr.warning("Sorting scans by date failed: %s", str(exc))
346
+ data_rows_sorted = sorted(data_rows)
347
# save
348
with open(fn, 'a') as csvfile:
349
writer = csv.writer(csvfile, delimiter='\t')
0 commit comments