Commit 74f8e3c0 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

move execute_graph to different module, uniform with all other ewoks projects

parent b3671372
from .task import Task # noqa: F401
from .taskwithprogress import TaskWithProgress # noqa: F401
from .graph import load_graph # noqa: F401
from .graph import execute_graph # noqa: F401
from .bindings import execute_graph # noqa: F401
__version__ = "0.0.5-alpha"
from typing import Optional
from .graph import load_graph
def execute_graph(graph, load_options: Optional[dict] = None, **execute_options):
"""
:param graph: graph to be executed
:param Optional[dict] load_options: options to provide to the `load_graph` function (and as a consequence to the `TaskGraph.load` as `root_dir`)
:param execute_options: options to provide to the Graph.execute function as `varinfo` or `raise_on_error`
"""
if load_options is None:
load_options = dict()
graph = load_graph(source=graph, **load_options)
return graph.execute(**execute_options)
......@@ -24,18 +24,6 @@ def load_graph(source=None, representation=None, **load_options):
return TaskGraph(source=source, representation=representation, **load_options)
def execute_graph(graph, load_options: Optional[dict] = None, **execute_options):
"""
:param graph: graph to be executed
:param Optional[dict] load_options: options to provide to the `load_graph` function (and as a consequence to the `TaskGraph.load` as `root_dir`)
:param execute_options: options to provide to the Graph.execute function as `varinfo` or `raise_on_error`
"""
if load_options is None:
load_options = dict()
graph = load_graph(source=graph, **load_options)
return graph.execute(**execute_options)
def set_graph_defaults(graph_as_dict):
graph_as_dict.setdefault("directed", True)
graph_as_dict.setdefault("nodes", list())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment