Skip to content

Commit a6b125f

Browse files
committed
BF: n/a for empty values
1 parent ae010dc commit a6b125f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bin/heudiconv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,9 @@ def get_formatted_scans_key_row(item):
974974
# add random string
975975
randstr = ''.join(map(chr, sample(k=8, population=range(33, 127))))
976976
row = [acq_time, mw.dcm_data.PerformingPhysicianName, randstr]
977+
# empty entries should be 'n/a'
978+
# https://github.com/dartmouth-pbs/heudiconv/issues/32
979+
row = ['n/a' if not str(e) else e for e in row]
977980
return row
978981

979982

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_get_formatted_scans_key_row():
119119
row = heudiconv.get_formatted_scans_key_row(item)
120120
assert(len(row) == 3)
121121
assert(row[0] == '2016-10-14T09:26:34')
122-
assert(row[1] == '')
122+
assert(row[1] == 'n/a')
123123
randstr1 = row[2]
124124
row = heudiconv.get_formatted_scans_key_row(item)
125125
randstr2 = row[2]

0 commit comments

Comments
 (0)