Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
workflow
ewoks
ewoksorange
Commits
94a44a7a
Commit
94a44a7a
authored
Nov 22, 2021
by
payno
Browse files
Merge branch 'execute_graph_api' into 'main'
make execute_graph uniform with the one from ewokscore See merge request
!52
parents
49da92d8
1eeedfd3
Pipeline
#59992
passed with stages
in 7 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ewoksorange/bindings/bindings.py
View file @
94a44a7a
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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