Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
ewoks
ewokscore
Commits
74f8e3c0
Commit
74f8e3c0
authored
Nov 19, 2021
by
Wout De Nolf
Browse files
move execute_graph to different module, uniform with all other ewoks projects
parent
b3671372
Changes
3
Hide whitespace changes
Inline
Side-by-side
ewokscore/__init__.py
View file @
74f8e3c0
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"
ewokscore/bindings.py
0 → 100644
View file @
74f8e3c0
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
)
ewokscore/graph.py
View file @
74f8e3c0
...
...
@@ -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
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment