diff --git a/aiida_worktree/engine/worktree.py b/aiida_worktree/engine/worktree.py index d866a271..49ef7a41 100644 --- a/aiida_worktree/engine/worktree.py +++ b/aiida_worktree/engine/worktree.py @@ -629,6 +629,7 @@ def run_nodes(self, names): elif node["metadata"]["node_type"] in ["worktree"]: # process = run_get_node(executor, *args, **kwargs) from aiida_worktree.utils import merge_properties + from aiida.orm.utils.serialize import serialize print("node type: worktree.") wt = self.run_executor(executor, args, kwargs, var_args, var_kwargs) @@ -641,6 +642,8 @@ def run_nodes(self, names): all = {"nt": ntdata, "metadata": {"call_link_label": name}} print("submit worktree: ") process = self.submit(self.__class__, **all) + # save the ntdata to the process extras, so that we can load the worktree + process.base.extras.set("nt", serialize(ntdata)) node["process"] = process # self.ctx.nodes[name]["group_outputs"] = executor.group_outputs self.ctx.nodes[name]["state"] = "RUNNING" diff --git a/docs/source/blog.ipynb b/docs/source/blog.ipynb new file mode 100644 index 00000000..bb8da04c --- /dev/null +++ b/docs/source/blog.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "22d177dc-6cfb-4de2-9509-f1eb45e10cf2", + "metadata": {}, + "source": [ + "# Blog: Unlocking Flexibility with AiiDA-WorkTree" + ] + }, + { + "cell_type": "markdown", + "id": "58696c91", + "metadata": {}, + "source": [ + "\n", + "\n", + "\n", + "In the realm of AiiDA, workflows have been traditionally orchestrated using two chief components: `workfunction` and `WorkChain`. Both these components come with their distinct attributes and limitations. The `workfunction` shines in simplicity but lacks automatic checkpointing, a crucial feature for long-running calculations. Conversely, `WorkChain` embodies resilience with automatic checkpointing but demands a more intricate implementation and lacks flexibility.\n", + "\n", + "\n", + "Suppose we want to calculate ```(x + y) * z ``` in two steps. First, add `x` and `y`, then multiply the result with `z`.\n", + "\n", + "#### A example workchain\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ad4cf60d", + "metadata": {}, + "outputs": [], + "source": [ + "%load_ext aiida\n", + "from aiida import load_profile\n", + "load_profile()\n", + "# -*- coding: utf-8 -*-\n", + "from aiida.engine import WorkChain, calcfunction\n", + "from aiida.orm import Int\n", + "\n", + "\n", + "@calcfunction\n", + "def add(x, y):\n", + " return Int(x + y)\n", + "\n", + "@calcfunction\n", + "def multiply(x, y):\n", + " return Int(x * y)\n", + "\n", + "class AddAndMultiplyWorkChain(WorkChain):\n", + "\n", + " @classmethod\n", + " def define(cls, spec):\n", + " super().define(spec)\n", + " spec.input('x')\n", + " spec.input('y')\n", + " spec.input('z')\n", + " spec.outline(\n", + " cls.add,\n", + " cls.multiply,\n", + " cls.results,\n", + " )\n", + " spec.output('result')\n", + "\n", + " def add(self):\n", + " self.ctx.sum = add(self.inputs.x, self.inputs.y)\n", + "\n", + " def multiply(self):\n", + " self.ctx.product = multiply(self.ctx.sum, self.inputs.z)\n", + "\n", + " def results(self):\n", + " self.out('result', self.ctx.product)\n" + ] + }, + { + "cell_type": "markdown", + "id": "15f6f7c5", + "metadata": {}, + "source": [ + "\n", + "### **Enter AiiDA-WorkTree: The Game-Changer**\n", + "\n", + "Addressing the gaps left by its predecessors, AiiDA-WorkTree introduces a new component: `WorkTree`. This feature simplifies implementation and embraces automatic checkpointing, all while maintaining a high degree of flexibility suitable for designing sophisticated workflows.\n", + "\n", + "In AiiDA, one uses the `calcfunction` to do the calculation and generate new data. AiiDA-WorkTree goes one step further by transforming a `calcfunction` to a `Node`." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "c6b83fb5", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Profile" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from aiida_worktree import node\n", + "from aiida.engine import calcfunction\n", + "\n", + "# define add node\n", + "@node()\n", + "@calcfunction\n", + "def add(x, y):\n", + " return x + y\n", + "\n", + "# define multiply node\n", + "@node()\n", + "@calcfunction\n", + "def multiply(x, y):\n", + " return x*y\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "95855f72", + "metadata": {}, + "source": [ + "#### Create the workflow\n", + "Three steps:\n", + "\n", + "- create a empty `WorkTree`\n", + "- add nodes: `add` and `multiply`.\n", + "- link the output of the `add` node to one of the `x` input of the `multiply` node." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83f2505a", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "from aiida_worktree import WorkTree\n", + "from aiida.orm import Int\n", + "x = Int(2.0)\n", + "y = Int(3.0)\n", + "z = Int(4.0)\n", + "\n", + "wt = WorkTree(\"first_workflow\")\n", + "wt.nodes.new(add, name=\"add\", x=x, y=y)\n", + "wt.nodes.new(multiply, name=\"multiply\", y=z)\n", + "wt.links.new(wt.nodes[\"add\"].outputs[0], wt.nodes[\"multiply\"].inputs[\"x\"])\n", + "\n", + "wt.submit(wait=True)" + ] + }, + { + "cell_type": "markdown", + "id": "30719f9a", + "metadata": {}, + "source": [ + "\n", + "### **Journey Through a Workflow: A Train Analogy**\n", + "\n", + "Imagine planning a train journey. Traditionally, using a WorkChain resembles creating a new train line for every unique journey. Traveling from Bern to Zurich? That's one line (ICE10). Heading from Zurich to Milano? That's another (ICE11). Combining journeys, say from Bern to Milano, would entail the creation of yet another train line (ICE12), despite the redundancy.\n", + "\n", + "However, a more optimized approach exists. A WorkTree allows for a journey where one could travel from Bern to Zurich on ICE10 and then switch to ICE11 from Zurich to Milano. This method eliminates the need for creating a superfluous train line, optimizing resources and improving workflow efficiency.\n", + "\n", + "### **Unpacking the Benefits of WorkTree**\n", + "\n", + "#### **Flexibility in Inputs:**\n", + "\n", + "WorkChains typically require the aggregation of all input parameters at the commencement of the process. Using our train analogy, it is like boarding all passengers in Bern, irrespective of their actual starting point. AiiDA-WorkTree, however, allows for a more nuanced approach, enabling inputs to join at different stages of the workflow.\n", + "\n", + "#### **User-Developer Distinction:**\n", + "\n", + "The advent of WorkTree amplifies the distinction between the AiiDA users and developers. It allows developers to focus on creating foundational WorkChains, likened to establishing essential train routes. Users, on the other hand, can effortlessly utilize and connect these foundational elements to tailor workflows that cater to their specific needs, without delving deep into development.\n", + "\n", + "Certainly! I'll add a new section to your blog that discusses guidelines on when to use WorkTree or WorkChain, considering the nuances of workflow construction and modification needs.\n", + "\n", + "\n", + "## **Choosing the Right Tool: WorkTree or WorkChain?**\n", + "\n", + "In the world of AiiDA workflows, making an informed choice between WorkTree and WorkChain is pivotal. The decision hinges on the nature of your workflow and specific requirements concerning data provenance and workflow modification.\n", + "\n", + "### **When to Opt for WorkTree?**\n", + "\n", + "WorkTree emerges as a strong candidate when the workflow primarily involves linking outputs of one AiiDA process to the inputs of another, irrespective of the complexity and number of links. WorkTree facilitates this with an emphasis on maintaining comprehensive data provenance.\n", + "\n", + "- **Linkage-Centric Workflows**: If your workflow is a symphony of interconnected processes where outputs and inputs flow seamlessly, WorkTree is your conductor, orchestrating these links with finesse.\n", + "\n", + "- **Preserving Data Provenance**: With WorkTree, each data transformation is meticulously tracked, ensuring a rich and reliable record of data provenance.\n", + "\n", + "### **When is WorkChain the Preferable Choice?**\n", + "\n", + "WorkChain should be your go-to option when your workflow demands numerous slight modifications to the outputs before they metamorphose into inputs for subsequent processes.\n", + "\n", + "- **Modification-Heavy Workflows**: In scenarios where outputs undergo substantial tweaking and adjustments, WorkChain simplifies this by allowing easy modifications through context variables, acting as a flexible black box.\n", + "\n", + "- **Complex Flow Control**: WorkChain shows its mettle when dealing with intricate flow controls. If your workflow dances to the tunes of multiple while loops and conditional statements, WorkChain choreographs this complexity with grace, even if it makes the workflow somewhat elongated and intricate.\n", + "\n", + "### **Striking a Balance**\n", + "\n", + "Choosing between WorkTree and WorkChain is not a binary decision but rather a balancing act. While WorkTree shines in straightforward, linkage-centric workflows with a focus on data provenance, WorkChain takes the stage when the spotlight is on output modifications and complex flow controls. Evaluating the specific needs of your workflow and the intrinsic capabilities of each tool will guide you towards making a choice that resonates with efficiency and effectiveness.\n", + "\n", + "### **Conclusion: The AiiDA-WorkTree Vision**\n", + "\n", + "AiiDA-WorkTree does not seek to eclipse the existing workflow components like WorkChain, calcfunction, or calcjob. Instead, it envisions enriching the workflow ecosystem, enabling users to craft flexible, resilient, and user-specific workflows with ease. By doing so, AiiDA-WorkTree heralds a new era of workflow management, fostering creativity, efficiency, and precision in the AiiDA community." + ] + }, + { + "cell_type": "markdown", + "id": "a0779e9d", + "metadata": {}, + "source": [ + "## What's Next\n", + "\n", + "| | |\n", + "|---------------|----------------------------------------------------|\n", + "| [Concepts](concept/index.rst) | A brief introduction of WorkTree’s main concepts. |\n", + "| [Tutorials](tutorial/index.rst) | Real-world examples in computational materials science and more. |\n", + "| [HowTo](howto/index.rst) | Advanced topics and tips, e.g flow control using `if`, `for`, `while` and `context`. |" + ] + }, + { + "cell_type": "markdown", + "id": "6ff140c8", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.10.4 ('scinode')", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "2f450c1ff08798c4974437dd057310afef0de414c25d1fd960ad375311c3f6ff" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/source/index.rst b/docs/source/index.rst index 4a6a87bc..fd3871bd 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -49,6 +49,7 @@ Here is a detailed comparison between the ``WorkTree`` with two AiiDA built-in w installation tutorial/index howto/index + blog concept/index diff --git a/docs/source/quick_start.ipynb b/docs/source/quick_start.ipynb index b8bede9d..51ff1bf4 100644 --- a/docs/source/quick_start.ipynb +++ b/docs/source/quick_start.ipynb @@ -186,7 +186,144 @@ "outputs": [ { "data": { - "image/svg+xml": "\n\n\n\n\n\n%3\n\n\n\nN2734\n\nWorkTree: first_workflow (2734)\nState: finished\nExit Code: 0\n\n\n\nN2735\n\nadd (2735)\nState: finished\nExit Code: 0\n\n\n\nN2734->N2735\n\n\nCALL_CALC\nadd\n\n\n\nN2737\n\nmultiply (2737)\nState: finished\nExit Code: 0\n\n\n\nN2734->N2737\n\n\nCALL_CALC\nmultiply\n\n\n\nN2731\n\nInt (2731)\nvalue: 2\n\n\n\nN2731->N2734\n\n\nINPUT_WORK\nnt__nodes__add__properties__x__value\n\n\n\nN2732\n\nInt (2732)\nvalue: 3\n\n\n\nN2732->N2734\n\n\nINPUT_WORK\nnt__nodes__add__properties__y__value\n\n\n\nN2733\n\nInt (2733)\nvalue: 4\n\n\n\nN2733->N2734\n\n\nINPUT_WORK\nnt__nodes__multiply__properties__y__value\n\n\n\nN2736\n\nInt (2736)\nvalue: 5\n\n\n\nN2735->N2736\n\n\nCREATE\nresult\n\n\n\nN2736->N2737\n\n\nINPUT_CALC\nx\n\n\n\nN2738\n\nInt (2738)\nvalue: 20\n\n\n\nN2737->N2738\n\n\nCREATE\nresult\n\n\n\n", + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "N2734\n", + "\n", + "WorkTree: first_workflow (2734)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2735\n", + "\n", + "add (2735)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2734->N2735\n", + "\n", + "\n", + "CALL_CALC\n", + "add\n", + "\n", + "\n", + "\n", + "N2737\n", + "\n", + "multiply (2737)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2734->N2737\n", + "\n", + "\n", + "CALL_CALC\n", + "multiply\n", + "\n", + "\n", + "\n", + "N2731\n", + "\n", + "Int (2731)\n", + "value: 2\n", + "\n", + "\n", + "\n", + "N2731->N2734\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add__properties__x__value\n", + "\n", + "\n", + "\n", + "N2732\n", + "\n", + "Int (2732)\n", + "value: 3\n", + "\n", + "\n", + "\n", + "N2732->N2734\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add__properties__y__value\n", + "\n", + "\n", + "\n", + "N2733\n", + "\n", + "Int (2733)\n", + "value: 4\n", + "\n", + "\n", + "\n", + "N2733->N2734\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__multiply__properties__y__value\n", + "\n", + "\n", + "\n", + "N2736\n", + "\n", + "Int (2736)\n", + "value: 5\n", + "\n", + "\n", + "\n", + "N2735->N2736\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n", + "N2736->N2737\n", + "\n", + "\n", + "INPUT_CALC\n", + "x\n", + "\n", + "\n", + "\n", + "N2738\n", + "\n", + "Int (2738)\n", + "value: 20\n", + "\n", + "\n", + "\n", + "N2737->N2738\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n" + ], "text/plain": [ "" ] @@ -335,7 +472,119 @@ "outputs": [ { "data": { - "image/svg+xml": "\n\n\n\n\n\n%3\n\n\n\nN2739\n\nWorkTree: test_add_multiply (2739)\nState: finished\nExit Code: 0\n\n\n\nN2740\n\nArithmeticAddCalculation (2740)\nState: finished\nExit Code: 0\n\n\n\nN2739->N2740\n\n\nCALL_CALC\nadd1\n\n\n\nN2731\n\nInt (2731)\nvalue: 2\n\n\n\nN2731->N2739\n\n\nINPUT_WORK\nnt__nodes__add1__properties__x__value\n\n\n\nN2732\n\nInt (2732)\nvalue: 3\n\n\n\nN2732->N2739\n\n\nINPUT_WORK\nnt__nodes__add1__properties__y__value\n\n\n\nN2741\n\nRemoteData (2741)\n@localhost\n\n\n\nN2740->N2741\n\n\nCREATE\nremote_folder\n\n\n\nN2742\n\nFolderData (2742)\n\n\n\nN2740->N2742\n\n\nCREATE\nretrieved\n\n\n\nN2743\n\nInt (2743)\nvalue: 5\n\n\n\nN2740->N2743\n\n\nCREATE\nsum\n\n\n\n", + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "N2739\n", + "\n", + "WorkTree: test_add_multiply (2739)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2740\n", + "\n", + "ArithmeticAddCalculation (2740)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2739->N2740\n", + "\n", + "\n", + "CALL_CALC\n", + "add1\n", + "\n", + "\n", + "\n", + "N2731\n", + "\n", + "Int (2731)\n", + "value: 2\n", + "\n", + "\n", + "\n", + "N2731->N2739\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add1__properties__x__value\n", + "\n", + "\n", + "\n", + "N2732\n", + "\n", + "Int (2732)\n", + "value: 3\n", + "\n", + "\n", + "\n", + "N2732->N2739\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add1__properties__y__value\n", + "\n", + "\n", + "\n", + "N2741\n", + "\n", + "RemoteData (2741)\n", + "@localhost\n", + "\n", + "\n", + "\n", + "N2740->N2741\n", + "\n", + "\n", + "CREATE\n", + "remote_folder\n", + "\n", + "\n", + "\n", + "N2742\n", + "\n", + "FolderData (2742)\n", + "\n", + "\n", + "\n", + "N2740->N2742\n", + "\n", + "\n", + "CREATE\n", + "retrieved\n", + "\n", + "\n", + "\n", + "N2743\n", + "\n", + "Int (2743)\n", + "value: 5\n", + "\n", + "\n", + "\n", + "N2740->N2743\n", + "\n", + "\n", + "CREATE\n", + "sum\n", + "\n", + "\n", + "\n" + ], "text/plain": [ "" ] @@ -369,7 +618,7 @@ "\n", "# use node.group decorator, expose the output of \"multiply\" node\n", "# as the output of the `WorkTree`.\n", - "@node.group(outputs = [[\"multiply\", \"result\", \"result\"]])\n", + "@node.group(outputs = [[\"multiply.result\", \"result\"]])\n", "def add_multiply(x, y, z):\n", " # Create a WorkTree\n", " wt = WorkTree()\n", @@ -457,7 +706,294 @@ "outputs": [ { "data": { - "image/svg+xml": "\n\n\n\n\n\n%3\n\n\n\nN2744\n\nWorkTree: test_node_group (2744)\nState: finished\nExit Code: 0\n\n\n\nN2745\n\nWorkTree: add_multiply1 (2745)\nState: finished\nExit Code: 0\n\n\n\nN2744->N2745\n\n\nCALL_WORK\nadd_multiply1\n\n\n\nN2750\n\nWorkTree: add_multiply2 (2750)\nState: finished\nExit Code: 0\n\n\n\nN2744->N2750\n\n\nCALL_WORK\nadd_multiply2\n\n\n\nN2731\n\nInt (2731)\nvalue: 2\n\n\n\nN2731->N2744\n\n\nINPUT_WORK\nnt__nodes__add_multiply1__properties__x__value\n\n\n\nN2731->N2744\n\n\nINPUT_WORK\nnt__nodes__add_multiply2__properties__x__value\n\n\n\nN2732\n\nInt (2732)\nvalue: 3\n\n\n\nN2732->N2744\n\n\nINPUT_WORK\nnt__nodes__add_multiply2__properties__y__value\n\n\n\nN2732->N2744\n\n\nINPUT_WORK\nnt__nodes__add_multiply1__properties__y__value\n\n\n\nN2733\n\nInt (2733)\nvalue: 4\n\n\n\nN2733->N2744\n\n\nINPUT_WORK\nnt__nodes__add_multiply1__properties__z__value\n\n\n\nN2747\n\nInt (2747)\nvalue: 5\n\n\n\nN2748\n\nmultiply (2748)\nState: finished\nExit Code: 0\n\n\n\nN2747->N2748\n\n\nINPUT_CALC\ny\n\n\n\nN2746\n\nadd (2746)\nState: finished\nExit Code: 0\n\n\n\nN2746->N2747\n\n\nCREATE\nresult\n\n\n\nN2749\n\nInt (2749)\nvalue: 20\n\n\n\nN2753\n\nmultiply (2753)\nState: finished\nExit Code: 0\n\n\n\nN2749->N2753\n\n\nINPUT_CALC\nx\n\n\n\nN2749->N2750\n\n\nINPUT_WORK\nnt__nodes__multiply__properties__x__value\n\n\n\nN2748->N2749\n\n\nCREATE\nresult\n\n\n\nN2745->N2746\n\n\nCALL_CALC\nadd\n\n\n\nN2745->N2749\n\n\nRETURN\ngroup_outputs__result\n\n\n\nN2745->N2748\n\n\nCALL_CALC\nmultiply\n\n\n\nN2752\n\nInt (2752)\nvalue: 5\n\n\n\nN2752->N2753\n\n\nINPUT_CALC\ny\n\n\n\nN2751\n\nadd (2751)\nState: finished\nExit Code: 0\n\n\n\nN2751->N2752\n\n\nCREATE\nresult\n\n\n\nN2754\n\nInt (2754)\nvalue: 100\n\n\n\nN2753->N2754\n\n\nCREATE\nresult\n\n\n\nN2750->N2751\n\n\nCALL_CALC\nadd\n\n\n\nN2750->N2754\n\n\nRETURN\ngroup_outputs__result\n\n\n\nN2750->N2753\n\n\nCALL_CALC\nmultiply\n\n\n\n", + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "N2744\n", + "\n", + "WorkTree: test_node_group (2744)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2745\n", + "\n", + "WorkTree: add_multiply1 (2745)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2744->N2745\n", + "\n", + "\n", + "CALL_WORK\n", + "add_multiply1\n", + "\n", + "\n", + "\n", + "N2750\n", + "\n", + "WorkTree: add_multiply2 (2750)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2744->N2750\n", + "\n", + "\n", + "CALL_WORK\n", + "add_multiply2\n", + "\n", + "\n", + "\n", + "N2731\n", + "\n", + "Int (2731)\n", + "value: 2\n", + "\n", + "\n", + "\n", + "N2731->N2744\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add_multiply1__properties__x__value\n", + "\n", + "\n", + "\n", + "N2731->N2744\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add_multiply2__properties__x__value\n", + "\n", + "\n", + "\n", + "N2732\n", + "\n", + "Int (2732)\n", + "value: 3\n", + "\n", + "\n", + "\n", + "N2732->N2744\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add_multiply2__properties__y__value\n", + "\n", + "\n", + "\n", + "N2732->N2744\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add_multiply1__properties__y__value\n", + "\n", + "\n", + "\n", + "N2733\n", + "\n", + "Int (2733)\n", + "value: 4\n", + "\n", + "\n", + "\n", + "N2733->N2744\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__add_multiply1__properties__z__value\n", + "\n", + "\n", + "\n", + "N2747\n", + "\n", + "Int (2747)\n", + "value: 5\n", + "\n", + "\n", + "\n", + "N2748\n", + "\n", + "multiply (2748)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2747->N2748\n", + "\n", + "\n", + "INPUT_CALC\n", + "y\n", + "\n", + "\n", + "\n", + "N2746\n", + "\n", + "add (2746)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2746->N2747\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n", + "N2749\n", + "\n", + "Int (2749)\n", + "value: 20\n", + "\n", + "\n", + "\n", + "N2753\n", + "\n", + "multiply (2753)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2749->N2753\n", + "\n", + "\n", + "INPUT_CALC\n", + "x\n", + "\n", + "\n", + "\n", + "N2749->N2750\n", + "\n", + "\n", + "INPUT_WORK\n", + "nt__nodes__multiply__properties__x__value\n", + "\n", + "\n", + "\n", + "N2748->N2749\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n", + "N2745->N2746\n", + "\n", + "\n", + "CALL_CALC\n", + "add\n", + "\n", + "\n", + "\n", + "N2745->N2749\n", + "\n", + "\n", + "RETURN\n", + "group_outputs__result\n", + "\n", + "\n", + "\n", + "N2745->N2748\n", + "\n", + "\n", + "CALL_CALC\n", + "multiply\n", + "\n", + "\n", + "\n", + "N2752\n", + "\n", + "Int (2752)\n", + "value: 5\n", + "\n", + "\n", + "\n", + "N2752->N2753\n", + "\n", + "\n", + "INPUT_CALC\n", + "y\n", + "\n", + "\n", + "\n", + "N2751\n", + "\n", + "add (2751)\n", + "State: finished\n", + "Exit Code: 0\n", + "\n", + "\n", + "\n", + "N2751->N2752\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n", + "N2754\n", + "\n", + "Int (2754)\n", + "value: 100\n", + "\n", + "\n", + "\n", + "N2753->N2754\n", + "\n", + "\n", + "CREATE\n", + "result\n", + "\n", + "\n", + "\n", + "N2750->N2751\n", + "\n", + "\n", + "CALL_CALC\n", + "add\n", + "\n", + "\n", + "\n", + "N2750->N2754\n", + "\n", + "\n", + "RETURN\n", + "group_outputs__result\n", + "\n", + "\n", + "\n", + "N2750->N2753\n", + "\n", + "\n", + "CALL_CALC\n", + "multiply\n", + "\n", + "\n", + "\n" + ], "text/plain": [ "" ] diff --git a/examples/eos-2.py b/examples/eos-2.py index 1103920c..4e546074 100644 --- a/examples/eos-2.py +++ b/examples/eos-2.py @@ -20,7 +20,7 @@ def scale_structure(structure, scales): # Output result from context -@node.group(outputs=[["ctx", "result", "result"]]) +@node.group(outputs=[["ctx.result", "result"]]) def all_scf(structures, code, parameters, kpoints, pseudos, metadata): from aiida_worktree import WorkTree