Skip to content

Commit 92f8dc4

Browse files
committed
more robustness?
1 parent e1538ed commit 92f8dc4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

wfcommons/wfbench/translator/nextflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def _generate_task_call(self,
410410
if len(task.input_files) > 1:
411411
code += f"\tdef {function_name}_input = Channel.empty()\n"
412412
for f in task.input_files:
413-
code += f"\t{function_name}_input = {function_name}_input.mix({inputs_var}.{f.file_id})\n"
413+
code += f"\t{function_name}_input = {function_name}_input.mix({inputs_var}.{f.file_id.replace(".","_").replace("-","_")}\n"
414414
code += f"\tdef {function_name}_output = {function_name}({function_name}_input.collect())\n"
415415
else:
416416
input_file_id = task.input_files[0].file_id
@@ -435,10 +435,10 @@ def _generate_task_call(self,
435435
if has_children:
436436
output_files = task.output_files
437437
if len(output_files) == 1:
438-
code += f"\t{results_var}.{output_files[0].file_id} = {function_name}_output\n"
438+
code += f"\t{results_var}.{output_files[0].file_id.replace(".","_").replace("-","_")} = {function_name}_output\n"
439439
else:
440440
for i, f in enumerate(output_files):
441-
code += f"\t{results_var}.{f.file_id} = {function_name}_output.map{{it[{i}]}}\n"
441+
code += f"\t{results_var}.{f.file_id.replace(".","_").replace("-","_")} = {function_name}_output.map{{it[{i}]}}\n"
442442
code += "\n"
443443

444444
return code

0 commit comments

Comments
 (0)