Skip to content

Commit 55b569e

Browse files
committed
separate values and functions
1 parent 8c13faf commit 55b569e

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

python_workflow_definition/src/python_workflow_definition/aiida.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def write_workflow_json(wg, file_name):
7878

7979
callable_name = executor["callable_name"]
8080
callable_name = f"{executor['module_path']}.{callable_name}"
81-
data["nodes"].append({"id": i, "value": callable_name})
81+
data["nodes"].append({"id": i, "function": callable_name})
8282
i += 1
8383

8484
for link in wg.links:

python_workflow_definition/src/python_workflow_definition/jobflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def write_workflow_json(flow, file_name="workflow.json"):
207207
nodes_store_lst = []
208208
for k, v in nodes_dict.items():
209209
if isfunction(v):
210-
nodes_store_lst.append({"id": k, "value": v.__module__ + "." + v.__name__})
210+
nodes_store_lst.append({"id": k, "function": v.__module__ + "." + v.__name__})
211211
elif isinstance(v, np.ndarray):
212212
nodes_store_lst.append({"id": k, "value": v.tolist()})
213213
else:

python_workflow_definition/src/python_workflow_definition/pyiron_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def write_workflow_json(delayed_object, file_name="workflow.json"):
217217
mod = v.__module__
218218
if mod == "python_workflow_definition.pyiron_base":
219219
mod = "python_workflow_definition.shared"
220-
nodes_store_lst.append({"id": k, "value": mod + "." + v.__name__})
220+
nodes_store_lst.append({"id": k, "function": mod + "." + v.__name__})
221221
elif isinstance(v, np.ndarray):
222222
nodes_store_lst.append({"id": k, "value": v.tolist()})
223223
else:

python_workflow_definition/src/python_workflow_definition/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def get_source_handles(edges_lst):
2727

2828
def convert_nodes_list_to_dict(nodes_list):
2929
return {
30-
str(el["id"]): el["value"]
30+
str(el["id"]): el["value"] if "value" in el else el["function"]
3131
for el in sorted(nodes_list, key=lambda d: d["id"])
3232
}

workflow_nfdi.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"nodes": [
3-
{"id": 0, "value": "nfdi_ing_workflow.generate_mesh"},
4-
{"id": 1, "value": "nfdi_ing_workflow.convert_to_xdmf"},
5-
{"id": 2, "value": "nfdi_ing_workflow.poisson"},
6-
{"id": 3, "value": "nfdi_ing_workflow.plot_over_line"},
7-
{"id": 4, "value": "nfdi_ing_workflow.substitute_macros"},
8-
{"id": 5, "value": "nfdi_ing_workflow.compile_paper"},
3+
{"id": 0, "function": "nfdi_ing_workflow.generate_mesh"},
4+
{"id": 1, "function": "nfdi_ing_workflow.convert_to_xdmf"},
5+
{"id": 2, "function": "nfdi_ing_workflow.poisson"},
6+
{"id": 3, "function": "nfdi_ing_workflow.plot_over_line"},
7+
{"id": 4, "function": "nfdi_ing_workflow.substitute_macros"},
8+
{"id": 5, "function": "nfdi_ing_workflow.compile_paper"},
99
{"id": 6, "value": 2.0}
1010
],
1111
"edges": [

workflow_qe.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
{
22
"nodes": [
3-
{"id": 0, "value": "quantum_espresso_workflow.get_bulk_structure"},
4-
{"id": 1, "value": "quantum_espresso_workflow.calculate_qe"},
5-
{"id": 2, "value": "quantum_espresso_workflow.generate_structures"},
6-
{"id": 3, "value": "quantum_espresso_workflow.calculate_qe"},
7-
{"id": 4, "value": "quantum_espresso_workflow.calculate_qe"},
8-
{"id": 5, "value": "quantum_espresso_workflow.calculate_qe"},
9-
{"id": 6, "value": "quantum_espresso_workflow.calculate_qe"},
10-
{"id": 7, "value": "quantum_espresso_workflow.calculate_qe"},
11-
{"id": 8, "value": "quantum_espresso_workflow.plot_energy_volume_curve"},
3+
{"id": 0, "function": "quantum_espresso_workflow.get_bulk_structure"},
4+
{"id": 1, "function": "quantum_espresso_workflow.calculate_qe"},
5+
{"id": 2, "function": "quantum_espresso_workflow.generate_structures"},
6+
{"id": 3, "function": "quantum_espresso_workflow.calculate_qe"},
7+
{"id": 4, "function": "quantum_espresso_workflow.calculate_qe"},
8+
{"id": 5, "function": "quantum_espresso_workflow.calculate_qe"},
9+
{"id": 6, "function": "quantum_espresso_workflow.calculate_qe"},
10+
{"id": 7, "function": "quantum_espresso_workflow.calculate_qe"},
11+
{"id": 8, "function": "quantum_espresso_workflow.plot_energy_volume_curve"},
1212
{"id": 9, "value": "Al"},
1313
{"id": 10, "value": 4.05},
1414
{"id": 11, "value": true},
1515
{"id": 12, "value": "mini"},
16-
{"id": 13, "value": "python_workflow_definition.shared.get_dict"},
16+
{"id": 13, "function": "python_workflow_definition.shared.get_dict"},
1717
{"id": 14, "value": {"Al": "Al.pbe-n-kjpaw_psl.1.0.0.UPF"}},
1818
{"id": 15, "value": [3, 3, 3]},
1919
{"id": 16, "value": "vc-relax"},
2020
{"id": 17, "value": 0.02},
2121
{"id": 18, "value": [0.9, 0.95, 1.0, 1.05, 1.1]},
2222
{"id": 19, "value": "strain_0"},
23-
{"id": 20, "value": "python_workflow_definition.shared.get_dict"},
23+
{"id": 20, "function": "python_workflow_definition.shared.get_dict"},
2424
{"id": 21, "value": "scf"},
2525
{"id": 22, "value": "strain_1"},
26-
{"id": 23, "value": "python_workflow_definition.shared.get_dict"},
26+
{"id": 23, "function": "python_workflow_definition.shared.get_dict"},
2727
{"id": 24, "value": "strain_2"},
28-
{"id": 25, "value": "python_workflow_definition.shared.get_dict"},
28+
{"id": 25, "function": "python_workflow_definition.shared.get_dict"},
2929
{"id": 26, "value": "strain_3"},
30-
{"id": 27, "value": "python_workflow_definition.shared.get_dict"},
30+
{"id": 27, "function": "python_workflow_definition.shared.get_dict"},
3131
{"id": 28, "value": "strain_4"},
32-
{"id": 29, "value": "python_workflow_definition.shared.get_dict"},
33-
{"id": 30, "value": "python_workflow_definition.shared.get_list"},
34-
{"id": 31, "value": "python_workflow_definition.shared.get_list"}
32+
{"id": 29, "function": "python_workflow_definition.shared.get_dict"},
33+
{"id": 30, "function": "python_workflow_definition.shared.get_list"},
34+
{"id": 31, "function": "python_workflow_definition.shared.get_list"}
3535
],
3636
"edges": [
3737
{"target": 0, "targetPort": "element", "source": 9, "sourcePort": null},

workflow_simple.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"nodes": [
3-
{"id": 0, "value": "simple_workflow.add_x_and_y"},
4-
{"id": 1, "value": "simple_workflow.add_x_and_y_and_z"},
3+
{"id": 0, "function": "simple_workflow.add_x_and_y"},
4+
{"id": 1, "function": "simple_workflow.add_x_and_y_and_z"},
55
{"id": 2, "value": 1},
66
{"id": 3, "value": 2}
77
],

0 commit comments

Comments
 (0)