Skip to content

Commit 97b36ec

Browse files
committed
additional pre- and post-processing in nested workflow
1 parent 08f3ab0 commit 97b36ec

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
{
22
"version": "0.1.1",
33
"nodes": [
4-
{ "id": 0, "type": "workflow", "value": "prod_div.json" },
5-
{ "id": 1, "value": 1, "type": "input", "name": "a" },
6-
{ "id": 2, "value": 2, "type": "input", "name": "b" },
7-
{ "id": 3, "type": "output", "name": "final_result" }
4+
{ "id": 0, "value": 3, "type": "input", "name": "a" },
5+
{ "id": 1, "value": 2, "type": "input", "name": "b" },
6+
{ "id": 2, "value": 4, "type": "input", "name": "c" },
7+
{ "id": 3, "type": "function", "value": "workflow.get_prod_and_div" },
8+
{ "id": 4, "type": "workflow", "value": "prod_div.json" },
9+
{ "id": 5, "type": "function", "value": "workflow.get_sum" },
10+
{ "id": 6, "type": "output", "name": "final_result" }
811
],
912
"edges": [
10-
{ "target": 0, "targetPort": "x", "source": 1, "sourcePort": null },
11-
{ "target": 0, "targetPort": "y", "source": 2, "sourcePort": null },
12-
{ "target": 3, "targetPort": "null", "source": 0, "sourcePort": "result" }
13+
{ "target": 3, "targetPort": "x", "source": 0, "sourcePort": null },
14+
{ "target": 3, "targetPort": "y", "source": 2, "sourcePort": null },
15+
{ "target": 4, "targetPort": "x", "source": 3, "sourcePort": "prod" },
16+
{ "target": 4, "targetPort": "y", "source": 3, "sourcePort": "div" },
17+
{ "target": 5, "targetPort": "x", "source": 4, "sourcePort": "result" },
18+
{ "target": 5, "targetPort": "y", "source": 1, "sourcePort": null },
19+
{ "target": 6, "targetPort": null, "source": 5, "sourcePort": null }
1320
]
14-
}
21+
}

src/python_workflow_definition/aiida.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ def load_workflow_json(file_name: str) -> WorkGraph:
203203
return wg
204204

205205

206-
207206
def write_workflow_json(wg: WorkGraph, file_name: str) -> dict:
208207
data = {NODES_LABEL: [], EDGES_LABEL: []}
209208
node_name_mapping = {}

0 commit comments

Comments
 (0)