Skip to content

Commit b0b87d0

Browse files
committed
update documentation
1 parent 87b0c27 commit b0b87d0

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,28 @@ def get_prod_and_div(x: float, y: float) -> dict:
3434
```
3535
These two Python functions are combined in the following example workflow:
3636
```python
37-
tmp_dict = get_prod_and_div(x=1, y=2)
38-
result = get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
37+
def combined_workflow(x=1, y=2):
38+
tmp_dict = get_prod_and_div(x=x, y=y)
39+
return get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
3940
```
4041
For the workflow representation of these Python functions the Python functions are stored in the [example_workflows/arithmetic/workflow.py](example_workflows/arithmetic/workflow.py)
4142
Python module. The connection of the Python functions are stored in the [example_workflows/arithmetic/workflow.json](example_workflows/arithmetic/workflow.json)
4243
JSON file:
4344
```
4445
{
4546
"nodes": [
46-
{"id": 0, "function": "simple_workflow.get_prod_and_div"},
47-
{"id": 1, "function": "simple_workflow.get_sum"},
48-
{"id": 2, "value": 1},
49-
{"id": 3, "value": 2}
47+
{"id": 0, "type": "function", "value": "workflow.get_prod_and_div"},
48+
{"id": 1, "type": "function", "value": "workflow.get_sum"},
49+
{"id": 2, "type": "input", "value": 1, "name": "x"},
50+
{"id": 3, "type": "input", "value": 2, "name": "y"},
51+
{"id": 4, "type": "output", "name": "result"}
5052
],
5153
"edges": [
5254
{"target": 0, "targetPort": "x", "source": 2, "sourcePort": null},
5355
{"target": 0, "targetPort": "y", "source": 3, "sourcePort": null},
5456
{"target": 1, "targetPort": "x", "source": 0, "sourcePort": "prod"},
55-
{"target": 1, "targetPort": "y", "source": 0, "sourcePort": "div"}
57+
{"target": 1, "targetPort": "y", "source": 0, "sourcePort": "div"},
58+
{"target": 4, "targetPort": null, "source": 1, "sourcePort": null}
5659
]
5760
}
5861
```

documentation/arithmetic.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,28 @@ def get_prod_and_div(x: float, y: float) -> dict:
99
```
1010
These two Python functions are combined in the following example workflow:
1111
```python
12-
tmp_dict = get_prod_and_div(x=1, y=2)
13-
result = get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
12+
def combined_workflow(x=1, y=2):
13+
tmp_dict = get_prod_and_div(x=x, y=y)
14+
return get_sum(x=tmp_dict["prod"], y=tmp_dict["div"])
1415
```
1516
For the workflow representation of these Python functions the Python functions are stored in the [workflow.py](example_workflows/arithmetic/workflow.py)
1617
Python module. The connection of the Python functions are stored in the [workflow.json](example_workflows/arithmetic/workflow.json)
1718
JSON file:
1819
```
1920
{
2021
"nodes": [
21-
{"id": 0, "function": "workflow.get_prod_and_div"},
22-
{"id": 1, "function": "workflow.get_sum"},
23-
{"id": 2, "value": 1},
24-
{"id": 3, "value": 2}
22+
{"id": 0, "type": "function", "value": "workflow.get_prod_and_div"},
23+
{"id": 1, "type": "function", "value": "workflow.get_sum"},
24+
{"id": 2, "type": "input", "value": 1, "name": "x"},
25+
{"id": 3, "type": "input", "value": 2, "name": "y"},
26+
{"id": 4, "type": "output", "name": "result"}
2527
],
2628
"edges": [
2729
{"target": 0, "targetPort": "x", "source": 2, "sourcePort": null},
2830
{"target": 0, "targetPort": "y", "source": 3, "sourcePort": null},
2931
{"target": 1, "targetPort": "x", "source": 0, "sourcePort": "prod"},
30-
{"target": 1, "targetPort": "y", "source": 0, "sourcePort": "div"}
32+
{"target": 1, "targetPort": "y", "source": 0, "sourcePort": "div"},
33+
{"target": 4, "targetPort": null, "source": 1, "sourcePort": null}
3134
]
3235
}
3336
```

0 commit comments

Comments
 (0)