Skip to content

Commit 30efb5b

Browse files
STY: Apply ruff rule RUF017
RUF017 Avoid quadratic list summation
1 parent e2af9dd commit 30efb5b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nibabel/tests/test_volumeutils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,11 @@ 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 = [
611+
x
612+
for sublist in (sctypes[key] for key in ('int', 'uint', 'float', 'complex'))
613+
for x in sublist
614+
]
611615
for in_type, out_type, slope, inter in itertools.product(
612616
NUMERICAL_TYPES,
613617
NUMERICAL_TYPES,

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ ignore = [
161161
"PYI024",
162162
"RUF005",
163163
"RUF015",
164-
"RUF017", # TODO: enable
165164
"UP027", # deprecated
166165
"UP038", # https://github.com/astral-sh/ruff/issues/7871
167166
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules

0 commit comments

Comments
 (0)