Skip to content

Commit 4810cd7

Browse files
STY: Apply ruff/refurb preview rule FURB148
FURB148 `enumerate` index is unused, use `for x in y` instead
1 parent 5daffcc commit 4810cd7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

nibabel/cifti2/tests/test_cifti2io_header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_read_and_proxies():
7272

7373
@needs_nibabel_data('nitest-cifti2')
7474
def test_version():
75-
for i, dat in enumerate(datafiles):
75+
for dat in datafiles:
7676
img = nib.load(dat)
7777
assert Version(img.header.version) == Version('2')
7878

nibabel/tests/test_round_trip.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,23 @@ def test_round_trip():
108108
iuint_types = [t for t in iuint_types if t in nifti_supported]
109109
f_types = [np.float32, np.float64]
110110
# Expanding standard deviations
111-
for i, sd_10 in enumerate(sd_10s):
111+
for sd_10 in sd_10s:
112112
sd = 10.0**sd_10
113113
V_in = rng.normal(0, sd, size=(N, 1))
114-
for j, in_type in enumerate(f_types):
115-
for k, out_type in enumerate(iuint_types):
114+
for in_type in f_types:
115+
for out_type in iuint_types:
116116
check_arr(sd_10, V_in, in_type, out_type, scaling_type)
117117
# Spread integers across range
118-
for i, sd in enumerate(np.linspace(0.05, 0.5, 5)):
119-
for j, in_type in enumerate(iuint_types):
118+
for sd in np.linspace(0.05, 0.5, 5):
119+
for in_type in iuint_types:
120120
info = np.iinfo(in_type)
121121
mn, mx = info.min, info.max
122122
type_range = mx - mn
123123
center = type_range / 2.0 + mn
124124
# float(sd) because type_range can be type 'long'
125125
width = type_range * float(sd)
126126
V_in = rng.normal(center, width, size=(N, 1))
127-
for k, out_type in enumerate(iuint_types):
127+
for out_type in iuint_types:
128128
check_arr(sd, V_in, in_type, out_type, scaling_type)
129129

130130

0 commit comments

Comments
 (0)