|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 1, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [], |
| 8 | + "source": [ |
| 9 | + "from python_workflow_definition.aiida import load_workflow_json" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "code", |
| 14 | + "execution_count": 2, |
| 15 | + "metadata": {}, |
| 16 | + "outputs": [], |
| 17 | + "source": [ |
| 18 | + "workgraph = load_workflow_json(filename='workflow_simple.json')" |
| 19 | + ] |
| 20 | + }, |
| 21 | + { |
| 22 | + "cell_type": "code", |
| 23 | + "execution_count": 3, |
| 24 | + "metadata": {}, |
| 25 | + "outputs": [ |
| 26 | + { |
| 27 | + "data": { |
| 28 | + "application/vnd.jupyter.widget-view+json": { |
| 29 | + "model_id": "09375dd84157413495ec5f8c07449a48", |
| 30 | + "version_major": 2, |
| 31 | + "version_minor": 1 |
| 32 | + }, |
| 33 | + "text/plain": [ |
| 34 | + "NodeGraphWidget(settings={'minimap': True}, style={'width': '90%', 'height': '600px'}, value={'name': 'WorkGra…" |
| 35 | + ] |
| 36 | + }, |
| 37 | + "execution_count": 3, |
| 38 | + "metadata": {}, |
| 39 | + "output_type": "execute_result" |
| 40 | + } |
| 41 | + ], |
| 42 | + "source": [ |
| 43 | + "\n", |
| 44 | + "# TODO: Create inputs rather than tasks out of data nodes\n", |
| 45 | + "workgraph" |
| 46 | + ] |
| 47 | + }, |
| 48 | + { |
| 49 | + "cell_type": "code", |
| 50 | + "execution_count": 4, |
| 51 | + "metadata": {}, |
| 52 | + "outputs": [ |
| 53 | + { |
| 54 | + "name": "stdout", |
| 55 | + "output_type": "stream", |
| 56 | + "text": [ |
| 57 | + "PROCESS: (<class 'aiida_workgraph.engine.workgraph.WorkGraphEngine'>, <class 'aiida.engine.processes.workchains.workchain.Protect'>)\n" |
| 58 | + ] |
| 59 | + }, |
| 60 | + { |
| 61 | + "name": "stderr", |
| 62 | + "output_type": "stream", |
| 63 | + "text": [ |
| 64 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: Continue workgraph.\n", |
| 65 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: tasks ready to run: 2,3\n", |
| 66 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|run_tasks]: Run task: 2, type: Normal\n", |
| 67 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|update_normal_task_state]: Task: 2 finished.\n", |
| 68 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: Continue workgraph.\n", |
| 69 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: tasks ready to run: 3\n", |
| 70 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|run_tasks]: Run task: 3, type: Normal\n", |
| 71 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|update_normal_task_state]: Task: 3 finished.\n", |
| 72 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: Continue workgraph.\n", |
| 73 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y\n", |
| 74 | + "03/14/2025 10:01:48 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|run_tasks]: Run task: add_x_and_y, type: PYTHONJOB\n" |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + "name": "stdout", |
| 79 | + "output_type": "stream", |
| 80 | + "text": [ |
| 81 | + "------------------------------------------------------------\n", |
| 82 | + "kwargs: {'value': '1'}\n", |
| 83 | + "------------------------------------------------------------\n", |
| 84 | + "kwargs: {'value': '2'}\n", |
| 85 | + "------------------------------------------------------------\n", |
| 86 | + "kwargs: {'register_pickle_by_value': True, 'x': '1', 'y': '2'}\n", |
| 87 | + "PROCESS: (<class 'aiida_pythonjob.calculations.pythonjob.PythonJob'>, <class 'plumpy.processes.ProcessStateMachineMeta'>)\n" |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "name": "stderr", |
| 92 | + "output_type": "stream", |
| 93 | + "text": [ |
| 94 | + "03/14/2025 10:01:49 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 6285\n", |
| 95 | + "03/14/2025 10:01:52 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|update_task_state]: Task: add_x_and_y finished.\n", |
| 96 | + "03/14/2025 10:01:53 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: Continue workgraph.\n", |
| 97 | + "03/14/2025 10:01:53 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: tasks ready to run: add_x_and_y_and_z\n", |
| 98 | + "03/14/2025 10:01:53 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|run_tasks]: Run task: add_x_and_y_and_z, type: PYTHONJOB\n" |
| 99 | + ] |
| 100 | + }, |
| 101 | + { |
| 102 | + "name": "stdout", |
| 103 | + "output_type": "stream", |
| 104 | + "text": [ |
| 105 | + "------------------------------------------------------------\n", |
| 106 | + "kwargs: {'register_pickle_by_value': True, 'x': <Str: uuid: f2fe3b5e-a209-4efa-9ba3-601723a3dc85 (pk: 6289) value: 1>, 'y': <Str: uuid: edcbc572-3d24-40b1-8cb1-6306d3b10f0d (pk: 6290) value: 2>, 'z': <Str: uuid: 66bbc8aa-9285-48d2-a88d-b5a939df46b7 (pk: 6291) value: 12>}\n", |
| 107 | + "PROCESS: (<class 'aiida_pythonjob.calculations.pythonjob.PythonJob'>, <class 'plumpy.processes.ProcessStateMachineMeta'>)\n" |
| 108 | + ] |
| 109 | + }, |
| 110 | + { |
| 111 | + "name": "stderr", |
| 112 | + "output_type": "stream", |
| 113 | + "text": [ |
| 114 | + "03/14/2025 10:01:53 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|on_wait]: Process status: Waiting for child processes: 6298\n", |
| 115 | + "03/14/2025 10:01:56 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|update_task_state]: Task: add_x_and_y_and_z finished.\n", |
| 116 | + "03/14/2025 10:01:57 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: Continue workgraph.\n", |
| 117 | + "03/14/2025 10:01:57 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|continue_workgraph]: tasks ready to run: \n", |
| 118 | + "03/14/2025 10:01:57 AM <2720405> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [6276|WorkGraphEngine|finalize]: Finalize workgraph.\n" |
| 119 | + ] |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "stdout", |
| 123 | + "output_type": "stream", |
| 124 | + "text": [ |
| 125 | + "group_outputs []\n", |
| 126 | + "group_outputs: {}\n" |
| 127 | + ] |
| 128 | + }, |
| 129 | + { |
| 130 | + "data": { |
| 131 | + "text/plain": [ |
| 132 | + "{'execution_count': <Int: uuid: 525e250b-6175-45f8-8657-d66d60c68860 (pk: 6303) value: 1>}" |
| 133 | + ] |
| 134 | + }, |
| 135 | + "execution_count": 4, |
| 136 | + "metadata": {}, |
| 137 | + "output_type": "execute_result" |
| 138 | + } |
| 139 | + ], |
| 140 | + "source": [ |
| 141 | + "from aiida import load_profile\n", |
| 142 | + "load_profile()\n", |
| 143 | + "\n", |
| 144 | + "workgraph.run()" |
| 145 | + ] |
| 146 | + } |
| 147 | + ], |
| 148 | + "metadata": { |
| 149 | + "kernelspec": { |
| 150 | + "display_name": "ADIS", |
| 151 | + "language": "python", |
| 152 | + "name": "python3" |
| 153 | + }, |
| 154 | + "language_info": { |
| 155 | + "codemirror_mode": { |
| 156 | + "name": "ipython", |
| 157 | + "version": 3 |
| 158 | + }, |
| 159 | + "file_extension": ".py", |
| 160 | + "mimetype": "text/x-python", |
| 161 | + "name": "python", |
| 162 | + "nbconvert_exporter": "python", |
| 163 | + "pygments_lexer": "ipython3", |
| 164 | + "version": "3.10.12" |
| 165 | + } |
| 166 | + }, |
| 167 | + "nbformat": 4, |
| 168 | + "nbformat_minor": 2 |
| 169 | +} |
0 commit comments