Skip to content
Snippets Groups Projects
Commit 827be708 authored by Olof Svensson's avatar Olof Svensson
Browse files

Merge branch 'disable_preimport_by_default' into 'main'

disable pre-import by default

See merge request !68
parents ec4f3ff7 b5b79a3a
No related branches found
Tags v0.0.3a3
1 merge request!68disable pre-import by default
Pipeline #88063 passed
......@@ -254,9 +254,10 @@ class InputMergeActor(AbstractActor):
class EwoksWorkflow(Workflow):
def __init__(self, ewoksgraph: TaskGraph):
def __init__(self, ewoksgraph: TaskGraph, pre_import: Optional[bool] = None):
name = repr(ewoksgraph)
super().__init__(name)
self._pre_import = pre_import
# When triggering a task, the output dict of the previous task
# is merged with the input dict of the current task.
......@@ -311,12 +312,13 @@ class EwoksWorkflow(Workflow):
error_actor = self._error_actor
imported = set()
for node_id, node_attrs in taskgraph.graph.nodes.items():
# Pre-import to speedup execution
name, importfunc = task_executable(node_id, node_attrs)
if name not in imported:
imported.add(name)
if importfunc:
importfunc(name)
if self._pre_import:
# Pre-import to speedup execution
name, importfunc = task_executable(node_id, node_attrs)
if name not in imported:
imported.add(name)
if importfunc:
importfunc(name)
actor = EwoksPythonActor(
node_id,
......@@ -571,10 +573,11 @@ def execute_graph(
graph,
inputs: Optional[List[dict]] = None,
load_options: Optional[dict] = None,
pre_import: Optional[bool] = None,
**execute_options,
):
if load_options is None:
load_options = dict()
ewoksgraph = load_graph(graph, inputs=inputs, **load_options)
ppfgraph = EwoksWorkflow(ewoksgraph)
ppfgraph = EwoksWorkflow(ewoksgraph, pre_import=pre_import)
return ppfgraph.run(**execute_options)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment