Skip to content

Commit

Permalink
STY: Further simplification
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
  • Loading branch information
DimitriPapadopoulos and effigies committed Oct 6, 2024
1 parent df2b0b7 commit 63517ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions nipype/pipeline/engine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,9 +1490,7 @@ def clean_working_directory(
else:
if not str2bool(config["execution"]["keep_inputs"]):
input_files = []
inputdict = inputs.trait_get()
input_files.extend(walk_outputs(inputdict))
input_files = [path for path, type in input_files if type == "f"]
input_files = {path for path, type in walk_outputs(inputs.trait_get()) if type == "f"}
files2remove.extend(
f for f in walk_files(cwd) if f in input_files and f not in needed_files
)
Expand Down
6 changes: 2 additions & 4 deletions nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,13 +715,11 @@ def write_rst_header(header, level=0):


def write_rst_list(items, prefix=""):
out = [f"{prefix} {item}" for item in ensure_list(items)]
return "\n".join(out) + "\n\n"
return "\n".join(f"{prefix} {item}" for item in ensure_list(items)) + "\n\n"


def write_rst_dict(info, prefix=""):
out = [f"{prefix}* {key} : {value}" for key, value in sorted(info.items())]
return "\n".join(out) + "\n\n"
return "\n".join(f"{prefix}* {k} : {v}" for k, v in sorted(info.items())) + "\n\n"


def dist_is_editable(dist):
Expand Down
2 changes: 1 addition & 1 deletion nipype/utils/nipype2boutiques.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def get_boutiques_output(outputs, name, spec, interface, tool_inputs):
# If extensions all the same, set path template as
# wildcard + extension. Otherwise just use a wildcard
if len(extensions) == 1:
output["path-template"] = "*" + extensions[0]
output["path-template"] = "*" + extensions.pop()
else:
output["path-template"] = "*"
return output
Expand Down

0 comments on commit 63517ff

Please sign in to comment.