Skip to content

Commit 1b0dc99

Browse files
STY: Apply ruff rule RUF017
RUF017 Avoid quadratic list summation
1 parent 3b1c7b3 commit 1b0dc99

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
@@ -162,7 +162,6 @@ ignore = [
162162
"RUF005",
163163
"RUF012", # TODO: enable
164164
"RUF015",
165-
"RUF017", # TODO: enable
166165
"UP027", # deprecated
167166
"UP038", # https://github.com/astral-sh/ruff/issues/7871
168167
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules

0 commit comments

Comments
 (0)