Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
ewoks
ewoksdask
Commits
4a6ba487
Commit
4a6ba487
authored
Feb 04, 2022
by
Wout De Nolf
Browse files
ewokscore API change MR !100
parent
0a28af47
Pipeline
#66379
passed with stages
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ewoksdask/bindings.py
View file @
4a6ba487
...
@@ -12,8 +12,9 @@ from dask import get as sequential_scheduler
...
@@ -12,8 +12,9 @@ from dask import get as sequential_scheduler
from
ewokscore
import
load_graph
from
ewokscore
import
load_graph
from
ewokscore.inittask
import
instantiate_task
from
ewokscore.inittask
import
instantiate_task
from
ewokscore.inittask
import
add_dynamic_inputs
from
ewokscore.inittask
import
add_dynamic_inputs
from
ewokscore.graph
import
ewoks_jsonload_hook
from
ewokscore.graph
.serialize
import
ewoks_jsonload_hook
from
ewokscore.node
import
get_node_label
from
ewokscore.node
import
get_node_label
from
ewokscore.graph
import
analysis
def
execute_task
(
execinfo
,
*
inputs
):
def
execute_task
(
execinfo
,
*
inputs
):
...
@@ -37,7 +38,7 @@ def execute_task(execinfo, *inputs):
...
@@ -37,7 +38,7 @@ def execute_task(execinfo, *inputs):
def
convert_graph
(
ewoksgraph
,
**
execute_options
):
def
convert_graph
(
ewoksgraph
,
**
execute_options
):
daskgraph
=
dict
()
daskgraph
=
dict
()
for
target_id
,
node_attrs
in
ewoksgraph
.
graph
.
nodes
.
items
():
for
target_id
,
node_attrs
in
ewoksgraph
.
graph
.
nodes
.
items
():
source_ids
=
tuple
(
ewoksgraph
.
predecessors
(
target_id
))
source_ids
=
tuple
(
analysis
.
predecessors
(
ewoksgraph
.
graph
,
target_id
))
link_attrs
=
tuple
(
link_attrs
=
tuple
(
ewoksgraph
.
graph
[
source_id
][
target_id
]
for
source_id
in
source_ids
ewoksgraph
.
graph
[
source_id
][
target_id
]
for
source_id
in
source_ids
)
)
...
@@ -75,7 +76,7 @@ def execute_graph(
...
@@ -75,7 +76,7 @@ def execute_graph(
if
results_of_all_nodes
:
if
results_of_all_nodes
:
nodes
=
list
(
ewoksgraph
.
graph
.
nodes
)
nodes
=
list
(
ewoksgraph
.
graph
.
nodes
)
else
:
else
:
nodes
=
list
(
ewoksgraph
.
end_nodes
())
nodes
=
list
(
analysis
.
end_nodes
(
ewoksgraph
.
graph
))
if
scheduler
is
None
:
if
scheduler
is
None
:
results
=
sequential_scheduler
(
daskgraph
,
nodes
)
results
=
sequential_scheduler
(
daskgraph
,
nodes
)
...
...
Write
Preview
Supports
Markdown
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