From 1eeedfd3646a176b036edea02e9ef04463c8e944 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Mon, 15 Nov 2021 15:31:06 +0100 Subject: [PATCH] make execute_graph uniform with the one from ewokscore --- ewoksorange/bindings/bindings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ewoksorange/bindings/bindings.py b/ewoksorange/bindings/bindings.py index cad62ba..ce52efc 100644 --- a/ewoksorange/bindings/bindings.py +++ b/ewoksorange/bindings/bindings.py @@ -1,6 +1,7 @@ import os import sys import tempfile +from typing import Optional from ewokscore import load_graph from .owsconvert import ewoks_to_ows @@ -10,8 +11,10 @@ from ..canvas.__main__ import main as launchcanvas __all__ = ["execute_graph"] -def execute_graph(graph, representation=None, varinfo=None): - ewoksgraph = load_graph(source=graph, representation=representation) +def execute_graph(graph, load_options: Optional[dict] = None, **execute_options): + if load_options is None: + load_options = dict() + ewoksgraph = load_graph(source=graph, **load_options) if ewoksgraph.is_cyclic: raise RuntimeError("Orange can only execute DAGs") if ewoksgraph.has_conditional_links: @@ -21,6 +24,6 @@ def execute_graph(graph, representation=None, varinfo=None): # So map to a (temporary) persistent representation first. with tempfile.TemporaryDirectory() as tmpdirname: filename = os.path.join(tmpdirname, "ewokstaskgraph.ows") - ewoks_to_ows(ewoksgraph, filename, varinfo=varinfo) + ewoks_to_ows(ewoksgraph, filename, **execute_options) argv = [sys.argv[0], filename] launchcanvas(argv=argv) -- GitLab