Skip to content

Commit d9743a1

Browse files
authored
Fix jobflow loading pyiron_base (#6)
* Fix jobflow loading pyiron_base * Execute notebook
1 parent d1a9781 commit d9743a1

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/pyiron.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ jobs:
2525
pip install -e python_workflow_definition
2626
conda install -c conda-forge jupyter papermill
2727
export ESPRESSO_PSEUDO=$(pwd)/espresso/pseudo
28-
papermill universal_qe_to_pyiron_base.ipynb universal_qe_to_pyiron_base_out.ipynb -k "python3"
28+
papermill universal_qe_to_pyiron_base.ipynb universal_qe_to_pyiron_base_out.ipynb -k "python3"
29+
papermill pyiron_base_to_jobflow.ipynb pyiron_base_to_jobflow_out.ipynb -k "python3"

pyiron_base_to_jobflow.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

python_workflow_definition/src/python_workflow_definition/jobflow.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def get_attr_helper(obj, source_handle):
164164
obj=memory_dict[vw['source']], source_handle=vw['sourceHandle'])
165165
for kw, vw in total_dict[k].items()
166166
}
167-
print(k, kwargs)
167+
# print(k, kwargs)
168168
memory_dict[k] = fn(**kwargs)
169169
return list(memory_dict.values())
170170

@@ -193,7 +193,20 @@ def load_workflow_json(file_name):
193193
with open(file_name, "r") as f:
194194
content = json.load(f)
195195

196-
edges_new_lst = content["edges"]
196+
edges_new_lst = []
197+
for edge in content["edges"]:
198+
if edge['sourceHandle'] is None:
199+
edges_new_lst.append(edge)
200+
else:
201+
edges_new_lst.append(
202+
{
203+
'target': edge['target'],
204+
'targetHandle': edge['targetHandle'],
205+
'source': edge['source'],
206+
'sourceHandle': str(edge['sourceHandle']),
207+
}
208+
)
209+
197210
nodes_new_dict = {}
198211
for k, v in content["nodes"].items():
199212
if isinstance(v, str) and "." in v:

0 commit comments

Comments
 (0)