Skip to content

Commit d5edcc9

Browse files
STY: Further simplification
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
1 parent df2b0b7 commit d5edcc9

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,10 +1489,9 @@ def clean_working_directory(
14891489
files2remove.append(f)
14901490
else:
14911491
if not str2bool(config["execution"]["keep_inputs"]):
1492-
input_files = []
1493-
inputdict = inputs.trait_get()
1494-
input_files.extend(walk_outputs(inputdict))
1495-
input_files = [path for path, type in input_files if type == "f"]
1492+
input_files = {
1493+
path for path, type in walk_outputs(inputs.trait_get()) if type == "f"
1494+
}
14961495
files2remove.extend(
14971496
f for f in walk_files(cwd) if f in input_files and f not in needed_files
14981497
)

nipype/utils/filemanip.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,13 +715,11 @@ def write_rst_header(header, level=0):
715715

716716

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

721720

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

726724

727725
def dist_is_editable(dist):

nipype/utils/nipype2boutiques.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def get_boutiques_output(outputs, name, spec, interface, tool_inputs):
477477
# If extensions all the same, set path template as
478478
# wildcard + extension. Otherwise just use a wildcard
479479
if len(extensions) == 1:
480-
output["path-template"] = "*" + extensions[0]
480+
output["path-template"] = "*" + extensions.pop()
481481
else:
482482
output["path-template"] = "*"
483483
return output

0 commit comments

Comments
 (0)