Skip to content

Commit

Permalink
STY: Apply ruff/flake8-comprehensions preview rule C419
Browse files Browse the repository at this point in the history
C419 Unnecessary list comprehension
  • Loading branch information
DimitriPapadopoulos committed Oct 1, 2024
1 parent d84d841 commit aec7b3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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((list(L) for L in 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
2 changes: 1 addition & 1 deletion nibabel/tests/test_volumeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def test_a2f_nanpos():

def test_a2f_bad_scaling():
# Test that pathological scalers raise an error
NUMERICAL_TYPES = sum([sctypes[key] for key in ['int', 'uint', 'float', 'complex']], [])
NUMERICAL_TYPES = sum((sctypes[key] for key in ['int', 'uint', 'float', 'complex']), [])
for in_type, out_type, slope, inter in itertools.product(
NUMERICAL_TYPES,
NUMERICAL_TYPES,
Expand Down

0 comments on commit aec7b3d

Please sign in to comment.