Skip to content

Commit cb5e270

Browse files
STY: Apply ruff/flake8-simplify rule SIM401
SIM401 Use `.get(..., ...)` instead of an `if` block
1 parent 4f933bd commit cb5e270

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

niworkflows/utils/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _cifti_timeseries(dataset):
4242
}
4343
seg = {label: [] for label in list(labels.values()) + ['Other']}
4444
for bm in matrix.get_index_map(1).brain_models:
45-
label = 'Other' if bm.brain_structure not in labels else labels[bm.brain_structure]
45+
label = labels.get(bm.brain_structure, 'Other')
4646
seg[label] += list(range(bm.index_offset, bm.index_offset + bm.index_count))
4747

4848
return dataset.get_fdata(dtype='float32').T, seg

0 commit comments

Comments
 (0)