Skip to content

Commit 7b6b3cf

Browse files
committed
Found bug in WorkGraph. Continue now with task order.
1 parent 533825e commit 7b6b3cf

File tree

6 files changed

+919
-729
lines changed

6 files changed

+919
-729
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,13 @@ workflow_qe_pyiron_base.json
189189
mini/
190190
.bak/
191191
workgraph_qe.json
192+
aiida-qe-construct.json
193+
aiida_to_jobflow_qe.html
194+
aiida_to_pyiron_base_qe.html
195+
evcurve.png
196+
strain_0/
197+
strain_1/
198+
strain_2/
199+
strain_3/
200+
strain_4/
192201

aiida_to_jobflow_qe.ipynb

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 5,
5+
"execution_count": 1,
66
"metadata": {},
7-
"outputs": [],
7+
"outputs": [
8+
{
9+
"name": "stderr",
10+
"output_type": "stream",
11+
"text": [
12+
"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.\n",
13+
" \"cipher\": algorithms.TripleDES,\n",
14+
"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.\n",
15+
" \"class\": algorithms.TripleDES,\n"
16+
]
17+
}
18+
],
819
"source": [
920
"from python_workflow_definition.aiida import write_workflow_json, construct_wg_qe\n",
1021
"from python_workflow_definition.jobflow import load_workflow_json\n",
@@ -18,7 +29,7 @@
1829
},
1930
{
2031
"cell_type": "code",
21-
"execution_count": 6,
32+
"execution_count": 2,
2233
"metadata": {},
2334
"outputs": [
2435
{
@@ -36,10 +47,10 @@
3647
" "
3748
],
3849
"text/plain": [
39-
"<IPython.lib.display.IFrame at 0x7f649f7e6770>"
50+
"<IPython.lib.display.IFrame at 0x7fef4c99d390>"
4051
]
4152
},
42-
"execution_count": 6,
53+
"execution_count": 2,
4354
"metadata": {},
4455
"output_type": "execute_result"
4556
}
@@ -90,7 +101,7 @@
90101
},
91102
{
92103
"cell_type": "code",
93-
"execution_count": 7,
104+
"execution_count": 3,
94105
"metadata": {},
95106
"outputs": [],
96107
"source": [
@@ -99,54 +110,61 @@
99110
},
100111
{
101112
"cell_type": "code",
102-
"execution_count": 8,
113+
"execution_count": 4,
103114
"metadata": {},
104-
"outputs": [
105-
{
106-
"ename": "KeyError",
107-
"evalue": "0",
108-
"output_type": "error",
109-
"traceback": [
110-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
111-
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
112-
"Cell \u001b[0;32mIn[8], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m flow \u001b[38;5;241m=\u001b[39m \u001b[43mload_workflow_json\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mworkflow_json_filename\u001b[49m\u001b[43m)\u001b[49m\n",
113-
"File \u001b[0;32m~/aiida_projects/adis/git-repos/python-workflow-definition/python_workflow_definition/src/python_workflow_definition/jobflow.py:188\u001b[0m, in \u001b[0;36mload_workflow_json\u001b[0;34m(file_name)\u001b[0m\n\u001b[1;32m 186\u001b[0m input_dict \u001b[38;5;241m=\u001b[39m _get_input_dict(nodes_dict\u001b[38;5;241m=\u001b[39mnodes_new_dict)\n\u001b[1;32m 187\u001b[0m new_total_dict \u001b[38;5;241m=\u001b[39m _resort_total_lst(total_dict\u001b[38;5;241m=\u001b[39mtotal_dict, nodes_dict\u001b[38;5;241m=\u001b[39mnodes_new_dict)\n\u001b[0;32m--> 188\u001b[0m task_lst \u001b[38;5;241m=\u001b[39m \u001b[43m_get_workflow\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 189\u001b[0m \u001b[43m \u001b[49m\u001b[43mnodes_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnodes_new_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 190\u001b[0m \u001b[43m \u001b[49m\u001b[43minput_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minput_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 191\u001b[0m \u001b[43m \u001b[49m\u001b[43mtotal_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnew_total_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 192\u001b[0m \u001b[43m \u001b[49m\u001b[43msource_handles_dict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msource_handles_dict\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 193\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m Flow(task_lst)\n",
114-
"File \u001b[0;32m~/aiida_projects/adis/git-repos/python-workflow-definition/python_workflow_definition/src/python_workflow_definition/jobflow.py:141\u001b[0m, in \u001b[0;36m_get_workflow\u001b[0;34m(nodes_dict, input_dict, total_dict, source_handles_dict)\u001b[0m\n\u001b[1;32m 139\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 140\u001b[0m fn \u001b[38;5;241m=\u001b[39m job(method\u001b[38;5;241m=\u001b[39mv)\n\u001b[0;32m--> 141\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 142\u001b[0m kw: input_dict[vw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msource\u001b[39m\u001b[38;5;124m'\u001b[39m]] \u001b[38;5;28;01mif\u001b[39;00m vw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msource\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;129;01min\u001b[39;00m input_dict \u001b[38;5;28;01melse\u001b[39;00m get_attr_helper(\n\u001b[1;32m 143\u001b[0m obj\u001b[38;5;241m=\u001b[39mmemory_dict[vw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msource\u001b[39m\u001b[38;5;124m'\u001b[39m]], source_handle\u001b[38;5;241m=\u001b[39mvw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msourceHandle\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m kw, vw \u001b[38;5;129;01min\u001b[39;00m total_dict[k]\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 145\u001b[0m }\n\u001b[1;32m 146\u001b[0m memory_dict[k] \u001b[38;5;241m=\u001b[39m fn(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mlist\u001b[39m(memory_dict\u001b[38;5;241m.\u001b[39mvalues())\n",
115-
"File \u001b[0;32m~/aiida_projects/adis/git-repos/python-workflow-definition/python_workflow_definition/src/python_workflow_definition/jobflow.py:143\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 139\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 140\u001b[0m fn \u001b[38;5;241m=\u001b[39m job(method\u001b[38;5;241m=\u001b[39mv)\n\u001b[1;32m 141\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 142\u001b[0m kw: input_dict[vw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msource\u001b[39m\u001b[38;5;124m'\u001b[39m]] \u001b[38;5;28;01mif\u001b[39;00m vw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msource\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;129;01min\u001b[39;00m input_dict \u001b[38;5;28;01melse\u001b[39;00m get_attr_helper(\n\u001b[0;32m--> 143\u001b[0m obj\u001b[38;5;241m=\u001b[39m\u001b[43mmemory_dict\u001b[49m\u001b[43m[\u001b[49m\u001b[43mvw\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msource\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m]\u001b[49m, source_handle\u001b[38;5;241m=\u001b[39mvw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msourceHandle\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m kw, vw \u001b[38;5;129;01min\u001b[39;00m total_dict[k]\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 145\u001b[0m }\n\u001b[1;32m 146\u001b[0m memory_dict[k] \u001b[38;5;241m=\u001b[39m fn(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mlist\u001b[39m(memory_dict\u001b[38;5;241m.\u001b[39mvalues())\n",
116-
"\u001b[0;31mKeyError\u001b[0m: 0"
117-
]
118-
}
119-
],
115+
"outputs": [],
120116
"source": [
121117
"\n",
122118
"flow = load_workflow_json(file_name=workflow_json_filename)"
123119
]
124120
},
125121
{
126122
"cell_type": "code",
127-
"execution_count": null,
123+
"execution_count": 5,
128124
"metadata": {},
129125
"outputs": [
130126
{
131127
"name": "stdout",
132128
"output_type": "stream",
133129
"text": [
134-
"2025-03-15 11:21:45,872 INFO Started executing jobs locally\n",
135-
"2025-03-15 11:21:46,028 INFO Starting job - add_x_and_y (31bed0f7-49cd-4e63-9a53-8c9679e74dd2)\n",
136-
"2025-03-15 11:21:46,030 INFO Finished job - add_x_and_y (31bed0f7-49cd-4e63-9a53-8c9679e74dd2)\n",
137-
"2025-03-15 11:21:46,031 INFO Starting job - add_x_and_y_and_z (7d74164e-3d5b-40d0-b72b-4fc5434a98e1)\n",
138-
"2025-03-15 11:21:46,033 INFO Finished job - add_x_and_y_and_z (7d74164e-3d5b-40d0-b72b-4fc5434a98e1)\n",
139-
"2025-03-15 11:21:46,033 INFO Finished executing jobs locally\n"
130+
"2025-03-17 13:03:08,254 INFO Started executing jobs locally\n",
131+
"2025-03-17 13:03:08,350 INFO Starting job - get_bulk_structure (2752a57d-0f42-46d2-b030-a2061311d315)\n",
132+
"2025-03-17 13:03:08,506 INFO Finished job - get_bulk_structure (2752a57d-0f42-46d2-b030-a2061311d315)\n",
133+
"2025-03-17 13:03:08,507 INFO Starting job - get_dict (798cca09-0626-4cf6-8236-c5c6f5340458)\n",
134+
"> \u001b[0;32m/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/reference.py\u001b[0m(189)\u001b[0;36mresolve\u001b[0;34m()\u001b[0m\n",
135+
"\u001b[0;32m 188 \u001b[0;31m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mattr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
136+
"\u001b[0m\u001b[0;32m--> 189 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mattr_type\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"i\"\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
137+
"\u001b[0m\u001b[0;32m 190 \u001b[0;31m \u001b[0;32melse\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
138+
"\u001b[0m\n",
139+
"--KeyboardInterrupt--\n",
140+
"\n",
141+
"KeyboardInterrupt: Interrupted by user\n",
142+
"2025-03-17 13:04:08,108 INFO get_dict failed with exception:\n",
143+
"Traceback (most recent call last):\n",
144+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/managers/local.py\", line 117, in _run_job\n",
145+
" response = job.run(store=store)\n",
146+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/job.py\", line 593, in run\n",
147+
" self.resolve_args(store=store)\n",
148+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/job.py\", line 709, in resolve_args\n",
149+
" resolved_kwargs = find_and_resolve_references(\n",
150+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/reference.py\", line 474, in find_and_resolve_references\n",
151+
" resolved_references = resolve_references(\n",
152+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/reference.py\", line 362, in resolve_references\n",
153+
" resolved_references[ref] = ref.resolve(\n",
154+
" File \"/home/geiger_j/.aiida_venvs/adis/lib/python3.10/site-packages/jobflow/core/reference.py\", line 188, in resolve\n",
155+
" data[attr]\n",
156+
"KeyError: 'result'\n",
157+
"\n",
158+
"2025-03-17 13:04:08,109 INFO Finished executing jobs locally\n"
140159
]
141160
},
142161
{
143162
"data": {
144163
"text/plain": [
145-
"{'31bed0f7-49cd-4e63-9a53-8c9679e74dd2': {1: Response(output={'x': 1, 'y': 2, 'z': 3}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/geiger_j/aiida_projects/adis/git-repos/python-workflow-definition'))},\n",
146-
" '7d74164e-3d5b-40d0-b72b-4fc5434a98e1': {1: Response(output=6, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/geiger_j/aiida_projects/adis/git-repos/python-workflow-definition'))}}"
164+
"{'2752a57d-0f42-46d2-b030-a2061311d315': {1: Response(output={'numbers': [13, 13, 13, 13], 'positions': [[0.0, 0.0, 0.0], [0.0, 2.025, 2.025], [2.025, 0.0, 2.025], [2.025, 2.025, 0.0]], 'cell': [[4.05, 0.0, 0.0], [0.0, 4.05, 0.0], [0.0, 0.0, 4.05]], 'pbc': [True, True, True]}, detour=None, addition=None, replace=None, stored_data=None, stop_children=False, stop_jobflow=False, job_dir=PosixPath('/home/geiger_j/aiida_projects/adis/git-repos/python-workflow-definition'))}}"
147165
]
148166
},
149-
"execution_count": 6,
167+
"execution_count": 5,
150168
"metadata": {},
151169
"output_type": "execute_result"
152170
}

0 commit comments

Comments
 (0)