[id: 1-20], [CONCEPT], [FUND] The current approach to define workflow inputs is to use global variables
as shown in the Parameters help section, right? Personally, I was a bit surprised by this approach. Before
that I had played around with dewret and the way I intuitively expected to define workflow input was to
define global variables and pass them as arguments to tasks, e.g.
import sys
import yaml
from dewret.tasks import task, run
from dewret.renderers.cwl import render
some_number = 3
@task()
def increment(num: int) -> int:
return num + 1
result = increment(num=some_number)
workflow = run(result)
cwl = render(workflow)
yaml.dump(cwl, sys.stdout, indent=2)
Which obviously does not work, i.e. the produced output reads
Hence, it seems that currently the only intended way of defining workflow input is using global
variables which sneak into a function (as context). I know this is very subjective (so, please no offence!)
but I strongly reject the concept of context aware functions because they are violating the
encapsulation and the very idea behind a function, i.e. that a function should be a stateless and entirely
encapsulated entity whose result should only depend on the explicit input.
[id: 1-20], [CONCEPT], [FUND] The current approach to define workflow inputs is to use global variables as shown in the Parameters help section, right? Personally, I was a bit surprised by this approach. Before that I had played around with dewret and the way I intuitively expected to define workflow input was to define global variables and pass them as arguments to tasks, e.g.
Which obviously does not work, i.e. the produced output reads
Hence, it seems that currently the only intended way of defining workflow input is using global variables which sneak into a function (as context). I know this is very subjective (so, please no offence!) but I strongly reject the concept of context aware functions because they are violating the encapsulation and the very idea behind a function, i.e. that a function should be a stateless and entirely encapsulated entity whose result should only depend on the explicit input.