Skip to content

Commit

Permalink
Merge pull request #3686 from DimitriPapadopoulos/C4
Browse files Browse the repository at this point in the history
STY: Apply ruff/flake8-comprehensions preview rules (C4)
  • Loading branch information
effigies authored Oct 6, 2024
2 parents 83e3903 + 2c95e15 commit a1378d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions nipype/interfaces/freesurfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ def _run_interface(self, runtime):
stem = self.inputs.screenshot_stem
stem_args = self.inputs.stem_template_args
if isdefined(stem_args):
args = tuple([getattr(self.inputs, arg) for arg in stem_args])
args = tuple(getattr(self.inputs, arg) for arg in stem_args)
stem = stem % args
# Check if the DISPLAY variable is set -- should avoid crashes (might not?)
if "DISPLAY" not in os.environ:
Expand Down Expand Up @@ -1094,7 +1094,7 @@ def _list_outputs(self):
stem = self.inputs.screenshot_stem
stem_args = self.inputs.stem_template_args
if isdefined(stem_args):
args = tuple([getattr(self.inputs, arg) for arg in stem_args])
args = tuple(getattr(self.inputs, arg) for arg in stem_args)
stem = stem % args
snapshots = ["%s-lat.tif", "%s-med.tif", "%s-dor.tif", "%s-ven.tif"]
if self.inputs.six_images:
Expand Down Expand Up @@ -1156,7 +1156,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None):
vox = tuple(vox.split(", "))
outputs.vox_sizes = vox
dim = self.info_regexp(info, "dimensions")
dim = tuple([int(d) for d in dim.split(" x ")])
dim = tuple(int(d) for d in dim.split(" x "))
outputs.dimensions = dim

outputs.orientation = self.info_regexp(info, "Orientation")
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/utility/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _get_outfields(self):
if self.inputs.header:
self._outfields = tuple(entry)
else:
self._outfields = tuple(["column_" + str(x) for x in range(len(entry))])
self._outfields = tuple("column_" + str(x) for x in range(len(entry)))
return self._outfields

def _run_interface(self, runtime):
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/engine/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def export(
][0]
functions[args[1]] = funcname
args[1] = funcname
args = tuple([arg for arg in args if arg])
args = tuple(arg for arg in args if arg)
line_args = (
u.fullname.replace(".", "_"),
args,
Expand Down

0 comments on commit a1378d0

Please sign in to comment.