Skip to content

Commit fdd65f4

Browse files
authored
Merge pull request #83 from mgxd/fix/duplicate
FIX: Ensure BOLD file count is preserved
2 parents 14304f6 + d6eed49 commit fdd65f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabies/utils/bids.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ def group_bolds_ref(*, layout, subject):
173173
# cannot be certain so treat as unique
174174
combinations.append(comb)
175175
files.append([bold.path])
176-
177-
if comb in combinations:
176+
elif comb in combinations:
178177
# do not add a new entry to the combinations
179178
# instead append the file to the existing bucket
180179
idx = combinations.index(comb)
@@ -185,6 +184,7 @@ def group_bolds_ref(*, layout, subject):
185184
files.append([bold.path])
186185

187186
assert len(combinations) == len(files), "Nonequal number of combinations and file buckets"
187+
assert len(bolds) == sum([len(x) for x in files]), "Final BOLD images count is off"
188188

189189
return combinations, files
190190

0 commit comments

Comments
 (0)