Jupyter notebook as workflow task#
Notebook support is optional upon installation
pip install ewokscore[notebook]
This notebook implements a task that accepts three optional inputs (a
, b
and delay
) and four outputs (x
, y
, z
and result
).
[1]:
import time
The cell below is tagged with “parameters” and receives the task inputs
[2]:
a = 0
b = 0
delay = 0
Body of the task
[3]:
result = a + b
if delay:
time.sleep(delay)
The cell below is tagged with “results” and passes “result” to the task outputs (JSON decoding will be attempted)
[4]:
result
[4]:
0
The cell below is tagged with “results” and passes “x”, “y” and “z” to the task outputs (JSON encoded)
[5]:
from IPython.display import JSON
JSON({"x": "string", "y": 10, "z": [1, 2, 3]})
[5]:
<IPython.core.display.JSON object>