Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions doc/howtoguides/inspect_workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,25 @@ If no labels are defined, the `Label` column is omitted from the output.
Validating Execution Arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To override workflow parameters for execution, use the `-p` option:
Workflow parameters can be overridden at execution time using one of the following options:

* ``-pt TASK_ID:NAME=VALUE`` — apply to all nodes with the specified task identifier
* ``-pn NODE_ID:NAME=VALUE`` — apply to the node with the specified node id
* ``-pl LABEL:NAME=VALUE`` — apply to all nodes with the specified label
* ``-ps NAME=VALUE`` — apply to all start nodes
* ``-pa NAME=VALUE`` — apply to all nodes

For example, to target a specific task identifier:

.. code-block:: bash

ewoks execute example.json -p SumTask:delay=99 --input-node-id taskid
ewoks execute example.json -pt SumTask:delay=99

Before executing the workflow, you can verify that your arguments are applied as intended using `ewoks show` with the same arguments:

.. code-block:: bash

ewoks show example.json -p SumTask:delay=99 --input-node-id taskid
ewoks show example.json -pt SumTask:delay=99

The output will reflect the overridden `delay` values:

Expand Down Expand Up @@ -163,8 +171,7 @@ The output will reflect the overridden `delay` values:
│ b │ 6 │ SumTask │ task6 │
╘════════╧════════════════╧═══════════════════╧═══════╛

The value before the colon in `-p <target>:<parameter>=<value>` refers to the node identifier, which defaults to the `Id` column.
You can change this behavior with the `--input-node-id` option to use the `Label` or `Task identifier` instead.
The `-pt` flag uses the task identifier as the target prefix in the format `<taskid>:<parameter>=<value>`, so `-pt SumTask:delay=99` applies `delay=99` to all nodes whose task identifier is `SumTask`.

Graphical Interfaces
--------------------
Expand All @@ -178,7 +185,7 @@ To use the :ref:`desktop GUI <ewoks-canvas>` based on Orange:

.. code-block:: bash

ewoks execute example.json --engine=orange -p SumTask:delay=99 --input-node-id taskid
ewoks execute example.json --engine=orange -pt SumTask:delay=99

Then double-click on each node to inspect or edit parameters:

Expand All @@ -194,7 +201,7 @@ To inspect parameters via the :ref:`web interface <ewoksweb>`:

.. code-block:: bash

ewoks convert example.json example_with_params.json --test -p SumTask:delay=99 --input-node-id taskid
ewoks convert example.json example_with_params.json --test -pt SumTask:delay=99

2. Start the web server:

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
"ewokscore >=4.0.1,<5",
"ewoksutils >=1.6.0,<2",
"ewoksutils >=1.10.0rc1,<2",
"tabulate",
"importlib_resources; python_version < '3.9'",
]
Expand Down
6 changes: 3 additions & 3 deletions src/ewoks/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def test_cli_convert(cli_interface): # noqa F811
"acyclic1",
"test.json",
"--test",
"-p",
"-ps",
"a=1",
"-p",
"-pn",
"task1:b=test",
"--src-format",
"yaml",
Expand All @@ -28,8 +28,8 @@ def test_cli_convert(cli_interface): # noqa F811

convert_options = {
"inputs": [
{"all": False, "name": "a", "value": 1},
{"id": "task1", "name": "b", "value": "test"},
{"all": False, "name": "a", "value": 1},
],
"load_options": {"representation": "test_core"},
"save_options": {"representation": "json"},
Expand Down
7 changes: 2 additions & 5 deletions src/ewoks/tests/test_convert_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ def test_convert_with_all_inputs(tmpdir):
graph_name,
destination,
"--test",
"-p",
"-pa",
"value=10",
"--inputs=all",
]

main(argv=argv, shell=False)
Expand All @@ -79,10 +78,8 @@ def test_convert_with_taskid_inputs(tmpdir):
graph_name,
destination,
"--test",
"-p",
"-pt",
f"{taskid}:value=test",
"--input-node-id",
"taskid",
]

main(argv=argv, shell=False)
Expand Down
5 changes: 2 additions & 3 deletions src/ewoks/tests/test_execute_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_execute_with_convert_destination(tmpdir):
"execute",
"demo",
"--test",
"-p",
"-pn",
"task1:b=42",
"-o",
f"convert_destination={destination}",
Expand All @@ -91,9 +91,8 @@ def test_execute_with_convert_destination_inputs_all(tmpdir):
"execute",
"demo",
"--test",
"-p",
"-pa",
"b=42",
"--inputs=all",
"-o",
f"convert_destination={destination}",
]
Expand Down
2 changes: 1 addition & 1 deletion src/ewoks/tests/test_show_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_show(capsys):


def test_show_with_inputs(capsys):
argv = [sys.executable, "show", "demo", "--test", "-p", "b=999", "--inputs=all"]
Comment thread
woutdenolf marked this conversation as resolved.
argv = [sys.executable, "show", "demo", "--test", "-pa", "b=999"]
main(argv=argv, shell=False)
captured = capsys.readouterr()

Expand Down
Loading