Skip to content

Commit

Permalink
Apply ruff/flake8-simplify rule SIM401
Browse files Browse the repository at this point in the history
SIM401 Use `.get()` instead of an `if` block
  • Loading branch information
DimitriPapadopoulos committed Nov 23, 2024
1 parent 92ff3be commit 2a32a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nireports/tools/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def cifti_timeseries(dataset):
}
seg = {label: [] for label in list(labels.values()) + ["Other"]}
for bm in matrix.get_index_map(1).brain_models:
label = "Other" if bm.brain_structure not in labels else labels[bm.brain_structure]
label = labels.get(bm.brain_structure, "Other")
seg[label] += list(range(bm.index_offset, bm.index_offset + bm.index_count))

return dataset.get_fdata(dtype="float32").T, seg
Expand Down

0 comments on commit 2a32a26

Please sign in to comment.