Skip to content

Commit 701efb7

Browse files
committed
Latest file versions. Should we use nbstripout?
1 parent 76cd86a commit 701efb7

File tree

8 files changed

+736
-345
lines changed

8 files changed

+736
-345
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,16 @@ strain_1/
187187
strain_2/
188188
strain_3/
189189
strain_4/
190+
aiida_to_pyiron_base_qe.json
191+
pyiron_base_to_aiida_qe.json
192+
jobflow_to_pyiron_base_simple.json
193+
aiida_to_pyiron_base_simple.json
194+
jobflow_to_aiida_simple.json
195+
pyiron_base_to_jobflow_simple.json
196+
aiida_to_jobflow_simple.json
197+
jobflow_to_pyiron_base_qe.json
198+
jobflow_to_aiida_qe.json
199+
aiida_to_jobflow_qe.json
200+
pyiron_base_to_aiida_simple.json
201+
pyiron_base_to_jobflow_qe.json
190202

jobflow_to_aiida_qe.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
},
8686
{
8787
"cell_type": "code",
88-
"execution_count": null,
88+
"execution_count": 7,
8989
"metadata": {},
9090
"outputs": [],
9191
"source": [
@@ -218,7 +218,7 @@
218218
"output_type": "stream",
219219
"text": [
220220
"\u001b[38;5;238m───────┬────────────────────────────────────────────────────────────────────────\u001b[0m\n",
221-
" \u001b[38;5;238m│ \u001b[0mFile: \u001b[1mworkflow_qe_jobflow.json\u001b[0m\n",
221+
" \u001b[38;5;238m│ \u001b[0mFile: \u001b[1mjobflow_to_aiida_qe.json\u001b[0m\n",
222222
"\u001b[38;5;238m───────┼────────────────────────────────────────────────────────────────────────\u001b[0m\n",
223223
"\u001b[38;5;238m 1\u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;231m{\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208mnodes\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;231m{\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m0\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mquantum_espresso_workflow.get_bulk_structure\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m1\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mq\u001b[0m\n",
224224
"\u001b[38;5;238m \u001b[0m \u001b[38;5;238m│\u001b[0m \u001b[38;5;186muantum_espresso_workflow.calculate_qe\u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;231m,\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;208m2\u001b[0m\u001b[38;5;208m\"\u001b[0m\u001b[38;5;231m:\u001b[0m\u001b[38;5;231m \u001b[0m\u001b[38;5;186m\"\u001b[0m\u001b[38;5;186mquantum_espresso_workflow\u001b[0m\n",

jobflow_to_pyiron_base_qe.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
},
9191
{
9292
"cell_type": "code",
93-
"execution_count": null,
93+
"execution_count": 7,
9494
"id": "80fb0d34",
9595
"metadata": {},
9696
"outputs": [],

pyiron_base_to_aiida_qe.ipynb

Lines changed: 355 additions & 183 deletions
Large diffs are not rendered by default.

pyiron_base_to_jobflow_qe.ipynb

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 14,
66
"id": "28d69730-d8cb-4174-ae3f-aa70da8a8108",
77
"metadata": {
88
"trusted": true
@@ -14,30 +14,19 @@
1414
},
1515
{
1616
"cell_type": "code",
17-
"execution_count": 2,
17+
"execution_count": 15,
1818
"id": "cacaa0a8-27c8-44de-9e37-69cd3d13408b",
1919
"metadata": {
2020
"trusted": true
2121
},
22-
"outputs": [
23-
{
24-
"name": "stderr",
25-
"output_type": "stream",
26-
"text": [
27-
"/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",
28-
" \"cipher\": algorithms.TripleDES,\n",
29-
"/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",
30-
" \"class\": algorithms.TripleDES,\n"
31-
]
32-
}
33-
],
22+
"outputs": [],
3423
"source": [
3524
"from jobflow.managers.local import run_locally"
3625
]
3726
},
3827
{
3928
"cell_type": "code",
40-
"execution_count": 4,
29+
"execution_count": 16,
4130
"id": "14d87342-706e-4120-99e6-b5363f724601",
4231
"metadata": {
4332
"trusted": true
@@ -49,7 +38,7 @@
4938
},
5039
{
5140
"cell_type": "code",
52-
"execution_count": 5,
41+
"execution_count": 17,
5342
"id": "a2ed2608-9e1b-4a81-81cb-5079573ea2d1",
5443
"metadata": {
5544
"trusted": true
@@ -61,7 +50,7 @@
6150
},
6251
{
6352
"cell_type": "code",
64-
"execution_count": 6,
53+
"execution_count": 18,
6554
"id": "444347b0-d5ba-4903-b8d4-a9d7fc35d268",
6655
"metadata": {
6756
"trusted": true
@@ -73,7 +62,7 @@
7362
},
7463
{
7564
"cell_type": "code",
76-
"execution_count": 7,
65+
"execution_count": 19,
7766
"id": "b75c2530-9b89-4185-838f-a17e517fa68f",
7867
"metadata": {
7968
"trusted": true
@@ -90,7 +79,7 @@
9079
},
9180
{
9281
"cell_type": "code",
93-
"execution_count": null,
82+
"execution_count": 20,
9483
"id": "07a950ca",
9584
"metadata": {},
9685
"outputs": [],
@@ -100,7 +89,7 @@
10089
},
10190
{
10291
"cell_type": "code",
103-
"execution_count": 10,
92+
"execution_count": 21,
10493
"id": "208ddfb8-dfda-4227-aa1f-3dc29e34ea82",
10594
"metadata": {
10695
"trusted": true
@@ -115,7 +104,7 @@
115104
},
116105
{
117106
"cell_type": "code",
118-
"execution_count": 11,
107+
"execution_count": 22,
119108
"id": "5071d3a0-7c1f-44c5-85e0-dede1566c10c",
120109
"metadata": {
121110
"trusted": true
@@ -127,7 +116,7 @@
127116
},
128117
{
129118
"cell_type": "code",
130-
"execution_count": 12,
119+
"execution_count": 23,
131120
"id": "13debfcd-362d-4fd0-a91f-5ab33632fceb",
132121
"metadata": {
133122
"trusted": true
@@ -136,7 +125,7 @@
136125
{
137126
"data": {
138127
"application/vnd.jupyter.widget-view+json": {
139-
"model_id": "ca214d411c864d6c846aca7e1449701a",
128+
"model_id": "0c30d907e2cc45ecb5447f75b42fb69d",
140129
"version_major": 2,
141130
"version_minor": 0
142131
},
@@ -155,7 +144,7 @@
155144
},
156145
{
157146
"cell_type": "code",
158-
"execution_count": 13,
147+
"execution_count": 24,
159148
"id": "1f1cb12f-4001-478d-8ea0-b369f4f2981a",
160149
"metadata": {
161150
"trusted": true
@@ -172,7 +161,7 @@
172161
},
173162
{
174163
"cell_type": "code",
175-
"execution_count": 14,
164+
"execution_count": 25,
176165
"id": "4140f07b-af54-41ef-be22-df6b5b53bf95",
177166
"metadata": {
178167
"trusted": true
@@ -194,7 +183,7 @@
194183
},
195184
{
196185
"cell_type": "code",
197-
"execution_count": 15,
186+
"execution_count": 26,
198187
"id": "3c4dae11-8750-42d5-807c-cd19f2b65706",
199188
"metadata": {
200189
"trusted": true
@@ -212,7 +201,7 @@
212201
},
213202
{
214203
"cell_type": "code",
215-
"execution_count": 16,
204+
"execution_count": 27,
216205
"id": "fdf3b62d-6cce-4312-8a5b-057224e36aca",
217206
"metadata": {
218207
"trusted": true
@@ -237,7 +226,7 @@
237226
},
238227
{
239228
"cell_type": "code",
240-
"execution_count": 17,
229+
"execution_count": 28,
241230
"id": "b2823306-0a8a-4ae6-bb1f-104e90e2fe41",
242231
"metadata": {
243232
"trusted": true
@@ -253,7 +242,7 @@
253242
},
254243
{
255244
"cell_type": "code",
256-
"execution_count": 18,
245+
"execution_count": 29,
257246
"id": "52646121-335f-48e6-bd5e-a1d69d00e8bc",
258247
"metadata": {
259248
"trusted": true

python_workflow_definition/src/python_workflow_definition/aiida.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ def load_workflow_json(file_name):
1818
task_name_mapping = {}
1919

2020
for id, identifier in data["nodes"].items():
21-
# if isinstance(identifier, str) and identifier in func_mapping:
2221
if isinstance(identifier, str) and "." in identifier:
2322
p, m = identifier.rsplit(".", 1)
2423
mod = import_module(p)
2524
_func = getattr(mod, m)
2625
func = task.pythonjob()(_func)
27-
# func = func_mapping[identifier]
2826
# I use the register_pickle_by_value, because the function is defined in a local file
2927
wg.add_task(func, register_pickle_by_value=True)
3028

@@ -44,9 +42,11 @@ def load_workflow_json(file_name):
4442
# because we are not define the outputs explicitly during the pythonjob creation
4543
# we add it here, and assume the output exit
4644
if link["sourceHandle"] not in from_task.outputs:
45+
# if str(link["sourceHandle"]) not in from_task.outputs:
4746
from_socket = from_task.add_output(
4847
"workgraph.any",
4948
name=link["sourceHandle"],
49+
# name=str(link["sourceHandle"]),
5050
metadata={"is_function_output": True},
5151
)
5252
else:

python_workflow_definition/src/python_workflow_definition/pyiron_base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,17 @@ def load_workflow_json(project, file_name):
207207
def write_workflow_json(delayed_object, file_name="workflow.json"):
208208
nodes_dict, edges_lst = delayed_object.get_graph()
209209
nodes_dict, edges_lst = _remove_server_obj(nodes_dict=nodes_dict, edges_lst=edges_lst)
210+
211+
# import ipdb; ipdb.set_trace()
210212
delayed_object_updated_dict, match_dict = _get_unique_objects(nodes_dict=nodes_dict)
213+
214+
# import ipdb; ipdb.set_trace()
211215
connection_dict, lookup_dict = _get_connection_dict(delayed_object_updated_dict=delayed_object_updated_dict, match_dict=match_dict)
216+
217+
# import ipdb; ipdb.set_trace()
212218
nodes_new_dict = _get_nodes(connection_dict=connection_dict, delayed_object_updated_dict=delayed_object_updated_dict)
219+
220+
# import ipdb; ipdb.set_trace()
213221
edges_new_lst = _get_edges_dict(edges_lst=edges_lst, nodes_dict=nodes_dict, connection_dict=connection_dict, lookup_dict=lookup_dict)
214222

215223
nodes_store_dict = {}
@@ -223,6 +231,8 @@ def write_workflow_json(delayed_object, file_name="workflow.json"):
223231
nodes_store_dict[k] = v.tolist()
224232
else:
225233
nodes_store_dict[k] = v
234+
235+
# import ipdb; ipdb.set_trace()
226236

227237
with open(file_name, "w") as f:
228238
json.dump({"nodes": nodes_store_dict, "edges": edges_new_lst}, f)

0 commit comments

Comments
 (0)