8000 STY: Apply ruff/flake8-comprehensions preview rule C419 · nipy/nibabel@87ec393 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87ec393

Browse files
STY: Apply ruff/flake8-comprehensions preview rule C419
C419 Unnecessary list comprehension
1 parent b8be5d2 commit 87ec393

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nibabel/orientations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def axcodes2ornt(axcodes, labels=None):
322322
[ 2., 1.]])
323323
"""
324324
labels = list(zip('LPI', 'RAS')) if labels is None else labels
325-
allowed_labels = sum([list(L) for L in labels], []) + [None]
325+
allowed_labels = sum((list(L) for L in labels), []) + [None]
326326
if len(allowed_labels) != len(set(allowed_labels)):
327327
raise ValueError(f'Duplicate labels in {allowed_labels}')
328328
if not set(axcodes).issubset(allowed_labels):

nibabel/tests/test_volumeutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def test_a2f_nanpos():
607607

608608
def test_a2f_bad_scaling():
609609
# Test that pathological scalers raise an error
610-
NUMERICAL_TYPES = sum([sctypes[key] for key in ['int', 'uint', 'float', 'complex']], [])
610+
NUMERICAL_TYPES = sum((sctypes[key] for key in ['int', 'uint', 'float', 'complex']), [])
611611
for in_type, out_type, slope, inter in itertools.product(
612612
NUMERICAL_TYPES,
613613
NUMERICAL_TYPES,

0 commit comments

Comments
 (0)
0