Skip to content

Commit cd4ef59

Browse files
STY: Apply ruff/flake8-pie rule PIE808
PIE808 Unnecessary `start` argument in `range`
1 parent 3681fa4 commit cd4ef59

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

nipype/algorithms/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def _run_interface(self, runtime):
714714
mx = shape[0]
715715
else:
716716
mx = 1
717-
for idx in range(0, mx):
717+
for idx in range(mx):
718718
extrafieldlist.append(self.inputs.extra_field)
719719
iflogger.info(len(extrafieldlist))
720720
output[extraheading] = extrafieldlist

nipype/interfaces/ants/registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def _format_metric(self, index):
10731073
# from the non-list inputs.
10741074
if isinstance(name_input, list):
10751075
items = list(stage_inputs.items())
1076-
indexes = list(range(0, len(name_input)))
1076+
indexes = list(range(len(name_input)))
10771077
specs = list()
10781078
for i in indexes:
10791079
temp = {k: v[i] for k, v in items}

nipype/interfaces/cmtk/cmtk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def length(xyz, along=False):
7272
def get_rois_crossed(pointsmm, roiData, voxelSize):
7373
n_points = len(pointsmm)
7474
rois_crossed = []
75-
for j in range(0, n_points):
75+
for j in range(n_points):
7676
# store point
7777
x = int(pointsmm[j, 0] / float(voxelSize[0]))
7878
y = int(pointsmm[j, 1] / float(voxelSize[1]))
@@ -894,7 +894,7 @@ def _run_interface(self, runtime):
894894
iflogger.info("Number of labels in LUT: %s", numLUTLabels)
895895
LUTlabelDict = {}
896896
""" Create dictionary for input LUT table"""
897-
for labels in range(0, numLUTLabels):
897+
for labels in range(numLUTLabels):
898898
LUTlabelDict[LUTlabelsRGBA[labels][0]] = [
899899
LUTlabelsRGBA[labels][1],
900900
LUTlabelsRGBA[labels][2],

nipype/interfaces/cmtk/nx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def add_edge_data(edge_array, ntwk, above=0, below=0):
353353
edge_ntwk = ntwk.copy()
354354
data = {}
355355
for x, row in enumerate(edge_array):
356-
for y in range(0, np.max(np.shape(edge_array[x]))):
356+
for y in range(np.max(np.shape(edge_array[x]))):
357357
if not edge_array[x, y] == 0:
358358
data["value"] = edge_array[x, y]
359359
if data["value"] <= below or data["value"] >= above:

nipype/interfaces/dipy/simulate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def _generate_gradients(ndirs=64, values=[1000, 3000], nb0s=1):
344344
bvecs = np.vstack((bvecs, vertices))
345345
bvals = np.hstack((bvals, v * np.ones(vertices.shape[0])))
346346

347-
for i in range(0, nb0s):
347+
for i in range(nb0s):
348348
bvals = bvals.tolist()
349349
bvals.insert(0, 0)
350350

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def _list_outputs(self):
580580
stem = ".".join(outfile.split(".")[:-1])
581581
ext = "." + outfile.split(".")[-1]
582582
outfile = []
583-
for idx in range(0, tp):
583+
for idx in range(tp):
584584
outfile.append(stem + "%04d" % idx + ext)
585585
if isdefined(self.inputs.out_type):
586586
if self.inputs.out_type in ["spm", "analyze"]:

nipype/interfaces/fsl/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def _create_ev_files(
259259
# add ev orthogonalization
260260
for i in range(1, num_evs[0] + 1):
261261
initial = ev_ortho.substitute(c0=i, c1=0, orthogonal=1)
262-
for j in range(0, num_evs[0] + 1):
262+
for j in range(num_evs[0] + 1):
263263
try:
264264
orthogonal = int(orthogonalization[i][j])
265265
except (KeyError, TypeError, ValueError, IndexError):

nipype/pipeline/plugins/tests/test_legacymultiproc_nondaemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def dummyFunction(filename):
4040
This function writes the value 45 to the given filename.
4141
"""
4242
j = 0
43-
for i in range(0, 10):
43+
for i in range(10):
4444
j += i
4545

4646
# j is now 45 (0+1+2+3+4+5+6+7+8+9)

nipype/utils/nipype2boutiques.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def get_boutiques_input(
288288
if handler_type == "TraitCompound":
289289
input_list = []
290290
# Recursively create an input for each trait
291-
for i in range(0, len(trait_handler.handlers)):
291+
for i in range(len(trait_handler.handlers)):
292292
inp = get_boutiques_input(
293293
inputs,
294294
interface,

0 commit comments

Comments
 (0)