Skip to content

Commit eb252ec

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

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
@@ -713,7 +713,7 @@ def _run_interface(self, runtime):
713713
mx = shape[0]
714714
else:
715715
mx = 1
716-
for idx in range(0, mx):
716+
for idx in range(mx):
717717
extrafieldlist.append(self.inputs.extra_field)
718718
iflogger.info(len(extrafieldlist))
719719
output[extraheading] = extrafieldlist

nipype/interfaces/ants/registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ def _format_metric(self, index):
10751075
# from the non-list inputs.
10761076
if isinstance(name_input, list):
10771077
items = list(stage_inputs.items())
1078-
indexes = list(range(0, len(name_input)))
1078+
indexes = list(range(len(name_input)))
10791079
specs = list()
10801080
for i in indexes:
10811081
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
@@ -343,7 +343,7 @@ def _generate_gradients(ndirs=64, values=[1000, 3000], nb0s=1):
343343
bvecs = np.vstack((bvecs, vertices))
344344
bvals = np.hstack((bvals, v * np.ones(vertices.shape[0])))
345345

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

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def _list_outputs(self):
579579
stem = ".".join(outfile.split(".")[:-1])
580580
ext = "." + outfile.split(".")[-1]
581581
outfile = []
582-
for idx in range(0, tp):
582+
for idx in range(tp):
583583
outfile.append(stem + "%04d" % idx + ext)
584584
if isdefined(self.inputs.out_type):
585585
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
@@ -258,7 +258,7 @@ def _create_ev_files(
258258
# add ev orthogonalization
259259
for i in range(1, num_evs[0] + 1):
260260
initial = ev_ortho.substitute(c0=i, c1=0, orthogonal=1)
261-
for j in range(0, num_evs[0] + 1):
261+
for j in range(num_evs[0] + 1):
262262
try:
263263
orthogonal = int(orthogonalization[i][j])
264264
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)