diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 9c08ac6621..777f42f019 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -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: @@ -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: @@ -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") diff --git a/nipype/interfaces/utility/csv.py b/nipype/interfaces/utility/csv.py index da09e425fb..979e328bb6 100644 --- a/nipype/interfaces/utility/csv.py +++ b/nipype/interfaces/utility/csv.py @@ -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): diff --git a/nipype/pipeline/engine/workflows.py b/nipype/pipeline/engine/workflows.py index 09f50f9460..54577f21b8 100644 --- a/nipype/pipeline/engine/workflows.py +++ b/nipype/pipeline/engine/workflows.py @@ -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,