Skip to content

Commit

Permalink
MNT: better way to normalize sequences to lists and flatten
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
DimitriPapadopoulos and effigies authored Oct 2, 2024
1 parent b33bcde commit ec15839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nibabel/orientations.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def axcodes2ornt(axcodes, labels=None):
[ 2., 1.]])
"""
labels = list(zip('LPI', 'RAS')) if labels is None else labels
allowed_labels = sum((list(L) for L in labels), []) + [None]
allowed_labels = sum(map(list, labels), [None])
if len(allowed_labels) != len(set(allowed_labels)):
raise ValueError(f'Duplicate labels in {allowed_labels}')
if not set(axcodes).issubset(allowed_labels):
Expand Down

0 comments on commit ec15839

Please sign in to comment.