diff --git a/aiida_workgraph/decorator.py b/aiida_workgraph/decorator.py index 52de805b..25d98bdb 100644 --- a/aiida_workgraph/decorator.py +++ b/aiida_workgraph/decorator.py @@ -455,9 +455,9 @@ def build_task_from_workgraph(wg: any) -> Task: "type": tdata["metadata"]["task_type"], "is_pickle": False, } + tdata["metadata"]["group_outputs"] = group_outputs tdata["executor"] = executor task = create_task(tdata) - task.group_outputs = group_outputs return task @@ -501,6 +501,8 @@ def generate_tdata( properties: List[Tuple[str, str]], catalog: str, task_type: str, + group_inputs: List[Tuple[str, str]] = None, + group_outputs: List[Tuple[str, str]] = None, additional_data: Optional[Dict[str, Any]] = None, ) -> Dict[str, Any]: """Generate task data for creating a task.""" @@ -524,6 +526,8 @@ def generate_tdata( "task_type": task_type, "catalog": catalog, "node_class": {"module": "aiida_workgraph.task", "name": "Task"}, + "group_inputs": group_inputs or [], + "group_outputs": group_outputs or [], }, "properties": properties, "inputs": _inputs, @@ -634,10 +638,11 @@ def decorator(func): properties or [], catalog, task_type, + group_inputs=inputs, + group_outputs=outputs, ) + task = create_task(tdata) - task.group_inputs = inputs - task.group_outputs = outputs func.task = func.node = task return func diff --git a/pyproject.toml b/pyproject.toml index 584970f2..3ec52a41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "numpy~=1.21", "scipy", "ase", - "node-graph>=0.1.0", + "node-graph==0.1.1", "aiida-core>=2.3", "cloudpickle", "aiida-shell~=0.8",