Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Apply ruff rules (RUF) again #3688

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nipype/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_nipype_gitversion():


def _list_union(iterable):
return list(set(sum(iterable, [])))
return list(set(x for sublist in iterable for x in sublist))


# Enable a handle to install all extra dependencies at once
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/fsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class ExtractROI(FSLCommand):

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

def _list_outputs(self):
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/spm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def func_is_3d(in_file):
else:
img = load(in_file)
shape = img.shape
return len(shape) == 3 or len(shape) == 4 and shape[3] == 1
return len(shape) == 3 or (len(shape) == 4 and shape[3] == 1)


def get_first_3dfile(in_files):
Expand Down