Skip to content

Commit aab7e54

Browse files
committed
Extend arithmetic example
1 parent b406497 commit aab7e54

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

example_workflows/arithmetic/workflow.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
"nodes": [
44
{"id": 0, "type": "function", "value": "workflow.get_prod_and_div"},
55
{"id": 1, "type": "function", "value": "workflow.get_sum"},
6-
{"id": 2, "type": "input", "value": 1, "name": "x"},
7-
{"id": 3, "type": "input", "value": 2, "name": "y"},
8-
{"id": 4, "type": "output", "name": "result"}
6+
{"id": 2, "type": "function", "value": "workflow.get_square"},
7+
{"id": 3, "type": "input", "value": 1, "name": "x"},
8+
{"id": 4, "type": "input", "value": 2, "name": "y"},
9+
{"id": 5, "type": "output", "name": "result"}
910
],
1011
"edges": [
11-
{"target": 0, "targetPort": "x", "source": 2, "sourcePort": null},
12-
{"target": 0, "targetPort": "y", "source": 3, "sourcePort": null},
12+
{"target": 0, "targetPort": "x", "source": 3, "sourcePort": null},
13+
{"target": 0, "targetPort": "y", "source": 4, "sourcePort": null},
1314
{"target": 1, "targetPort": "x", "source": 0, "sourcePort": "prod"},
1415
{"target": 1, "targetPort": "y", "source": 0, "sourcePort": "div"},
15-
{"target": 4, "targetPort": null, "source": 1, "sourcePort": null}
16+
{"target": 2, "targetPort": "x", "source": 1, "sourcePort": null},
17+
{"target": 5, "targetPort": null, "source": 2, "sourcePort": null}
1618
]
1719
}

example_workflows/arithmetic/workflow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ def get_prod_and_div(x, y):
44

55
def get_sum(x, y):
66
return x + y
7+
8+
9+
def square(x):
10+
return x ** 2

0 commit comments

Comments
 (0)