Skip to content

Commit a8d0045

Browse files
committed
copy workflow file
1 parent 2d68d5a commit a8d0045

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

python_workflow_definition/src/python_workflow_definition/cwl/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import sys
2+
import os
3+
import shutil
24
import pickle
35
from ast import literal_eval
46
from importlib import import_module

python_workflow_definition/src/python_workflow_definition/cwl/export.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _get_function_template(function_name: str) -> dict:
3737
return {
3838
"function": {
3939
"default": function_name,
40-
"inputBinding": {"position": 2, "prefix": "--function=", "separate": False},
40+
"inputBinding": {"position": 3, "prefix": "--function=", "separate": False},
4141
"type": "string",
4242
},
4343
}
@@ -96,9 +96,20 @@ def _write_function_cwl(workflow):
9696
"inputBinding": {"position": 1, "prefix": "-m"},
9797
"default": "python_workflow_definition.cwl",
9898
},
99+
"workflowfile": {
100+
"type": "string",
101+
"inputBinding": {
102+
"position": 2,
103+
"separate": False,
104+
},
105+
"default": "workflow.py",
106+
},
99107
},
100108
"outputs": {},
101109
}
110+
template["inputs"]["workflowfile"]["default"] = (
111+
function_nodes_dict[i].split(".")[0] + ".py"
112+
)
102113
file_name = function_nodes_dict[i].split(".")[-1] + ".cwl"
103114
if file_name not in file_lst:
104115
file_lst.append(file_name)
@@ -107,7 +118,7 @@ def _write_function_cwl(workflow):
107118
)
108119
for j, arg in enumerate(funct_dict[i]["targetPorts"]):
109120
template["inputs"].update(
110-
_get_function_argument(argument=arg, position=3 + j)
121+
_get_function_argument(argument=arg, position=4 + j)
111122
)
112123
for out in funct_dict[i]["sourcePorts"]:
113124
if out is None:

0 commit comments

Comments
 (0)