Skip to content

Commit a1378d0

Browse files
authored
Merge pull request #3686 from DimitriPapadopoulos/C4
STY: Apply ruff/flake8-comprehensions preview rules (C4)
2 parents 83e3903 + 2c95e15 commit a1378d0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

nipype/interfaces/freesurfer/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def _run_interface(self, runtime):
10241024
stem = self.inputs.screenshot_stem
10251025
stem_args = self.inputs.stem_template_args
10261026
if isdefined(stem_args):
1027-
args = tuple([getattr(self.inputs, arg) for arg in stem_args])
1027+
args = tuple(getattr(self.inputs, arg) for arg in stem_args)
10281028
stem = stem % args
10291029
# Check if the DISPLAY variable is set -- should avoid crashes (might not?)
10301030
if "DISPLAY" not in os.environ:
@@ -1094,7 +1094,7 @@ def _list_outputs(self):
10941094
stem = self.inputs.screenshot_stem
10951095
stem_args = self.inputs.stem_template_args
10961096
if isdefined(stem_args):
1097-
args = tuple([getattr(self.inputs, arg) for arg in stem_args])
1097+
args = tuple(getattr(self.inputs, arg) for arg in stem_args)
10981098
stem = stem % args
10991099
snapshots = ["%s-lat.tif", "%s-med.tif", "%s-dor.tif", "%s-ven.tif"]
11001100
if self.inputs.six_images:
@@ -1156,7 +1156,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None):
11561156
vox = tuple(vox.split(", "))
11571157
outputs.vox_sizes = vox
11581158
dim = self.info_regexp(info, "dimensions")
1159-
dim = tuple([int(d) for d in dim.split(" x ")])
1159+
dim = tuple(int(d) for d in dim.split(" x "))
11601160
outputs.dimensions = dim
11611161

11621162
outputs.orientation = self.info_regexp(info, "Orientation")

nipype/interfaces/utility/csv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _get_outfields(self):
6262
if self.inputs.header:
6363
self._outfields = tuple(entry)
6464
else:
65-
self._outfields = tuple(["column_" + str(x) for x in range(len(entry))])
65+
self._outfields = tuple("column_" + str(x) for x in range(len(entry)))
6666
return self._outfields
6767

6868
def _run_interface(self, runtime):

nipype/pipeline/engine/workflows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def export(
549549
][0]
550550
functions[args[1]] = funcname
551551
args[1] = funcname
552-
args = tuple([arg for arg in args if arg])
552+
args = tuple(arg for arg in args if arg)
553553
line_args = (
554554
u.fullname.replace(".", "_"),
555555
args,

0 commit comments

Comments
 (0)