Skip to content

Commit d3cfb41

Browse files
authored
Merge pull request #3688 from DimitriPapadopoulos/RUF
STY: Apply ruff rules (RUF) again
2 parents 5083109 + 5ce526f commit d3cfb41

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

nipype/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_nipype_gitversion():
187187

188188

189189
def _list_union(iterable):
190-
return list(set(sum(iterable, [])))
190+
return list(set(x for sublist in iterable for x in sublist))
191191

192192

193193
# Enable a handle to install all extra dependencies at once

nipype/interfaces/fsl/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class ExtractROI(FSLCommand):
483483

484484
def _format_arg(self, name, spec, value):
485485
if name == "crop_list":
486-
return " ".join(map(str, sum(list(map(list, value)), [])))
486+
return " ".join(str(x) for sublist in value for x in sublist)
487487
return super()._format_arg(name, spec, value)
488488

489489
def _list_outputs(self):

nipype/interfaces/spm/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def func_is_3d(in_file):
5252
else:
5353
img = load(in_file)
5454
shape = img.shape
55-
return len(shape) == 3 or len(shape) == 4 and shape[3] == 1
55+
return len(shape) == 3 or (len(shape) == 4 and shape[3] == 1)
5656

5757

5858
def get_first_3dfile(in_files):

0 commit comments

Comments
 (0)