Skip to content

Commit 888317e

Browse files
Apply ruff/refurb preview rule FURB148
FURB148 `enumerate` index is unused, use `for x in y` instead
1 parent c3c3452 commit 888317e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

nipy/algorithms/utils/pca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _get_covariance(data, UX, rmse_scales_func, mask):
216216
# If we have more then 2D, then we iterate over slices in the second
217217
# dimension, in order to save memory
218218
slices = [slice(i,i+1) for i in range(data.shape[1])]
219-
for i, s_slice in enumerate(slices):
219+
for s_slice in slices:
220220
Y = data[:,s_slice].reshape((n_pts, -1))
221221
# project data into required space
222222
YX = np.dot(UX, Y)

nipy/labs/mask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def compute_mask_sessions(session_images, m=0.2, M=0.9, cc=1, threshold=0.5,
293293
The mean image
294294
"""
295295
mask, mean = None, None
296-
for index, session in enumerate(session_images):
296+
for session in session_images:
297297
if hasattr(session, 'get_fdata'):
298298
mean = session.get_fdata()
299299
if mean.ndim > 3:

nipy/modalities/fmri/tests/test_glm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def write_fake_fmri_data(shapes, rk=3, affine=np.eye(4)):
3737
def generate_fake_fmri_data(shapes, rk=3, affine=np.eye(4)):
3838
fmri_data = []
3939
design_matrices = []
40-
for i, shape in enumerate(shapes):
40+
for shape in shapes:
4141
data = 100 + np.random.randn(*shape)
4242
data[0] -= 10
4343
fmri_data.append(Nifti1Image(data, affine))

0 commit comments

Comments
 (0)