diff --git a/doc/howtoguides/inspect_workflows.rst b/doc/howtoguides/inspect_workflows.rst index 28842c2..3f141fc 100644 --- a/doc/howtoguides/inspect_workflows.rst +++ b/doc/howtoguides/inspect_workflows.rst @@ -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: @@ -163,8 +171,7 @@ The output will reflect the overridden `delay` values: │ b │ 6 │ SumTask │ task6 │ ╘════════╧════════════════╧═══════════════════╧═══════╛ -The value before the colon in `-p :=` 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 `:=`, so `-pt SumTask:delay=99` applies `delay=99` to all nodes whose task identifier is `SumTask`. Graphical Interfaces -------------------- @@ -178,7 +185,7 @@ To use the :ref:`desktop GUI ` 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: @@ -194,7 +201,7 @@ To inspect parameters via the :ref:`web interface `: .. 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: diff --git a/pyproject.toml b/pyproject.toml index f91e1e5..b2d6dca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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'", ] diff --git a/src/ewoks/tests/test_cli.py b/src/ewoks/tests/test_cli.py index f0cd582..4205750 100644 --- a/src/ewoks/tests/test_cli.py +++ b/src/ewoks/tests/test_cli.py @@ -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", @@ -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"}, diff --git a/src/ewoks/tests/test_convert_cli.py b/src/ewoks/tests/test_convert_cli.py index 48ca344..42e72f0 100644 --- a/src/ewoks/tests/test_convert_cli.py +++ b/src/ewoks/tests/test_convert_cli.py @@ -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) @@ -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) diff --git a/src/ewoks/tests/test_execute_cli.py b/src/ewoks/tests/test_execute_cli.py index 5b07dcc..141a3a4 100644 --- a/src/ewoks/tests/test_execute_cli.py +++ b/src/ewoks/tests/test_execute_cli.py @@ -66,7 +66,7 @@ def test_execute_with_convert_destination(tmpdir): "execute", "demo", "--test", - "-p", + "-pn", "task1:b=42", "-o", f"convert_destination={destination}", @@ -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}", ] diff --git a/src/ewoks/tests/test_show_cli.py b/src/ewoks/tests/test_show_cli.py index 9462d14..d817ada 100644 --- a/src/ewoks/tests/test_show_cli.py +++ b/src/ewoks/tests/test_show_cli.py @@ -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"] + argv = [sys.executable, "show", "demo", "--test", "-pa", "b=999"] main(argv=argv, shell=False) captured = capsys.readouterr()