From 67116ec4ab74f9d77ef125ff4505a630ace0c54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 12 Apr 2025 08:36:09 +0200 Subject: [PATCH 1/5] Convert nodes to list of dictionaries --- .../src/python_workflow_definition/aiida.py | 9 +++++---- .../src/python_workflow_definition/executorlib.py | 5 +++-- .../src/python_workflow_definition/jobflow.py | 14 +++++++------- .../src/python_workflow_definition/purepython.py | 4 ++-- .../src/python_workflow_definition/pyiron_base.py | 14 +++++++------- .../src/python_workflow_definition/shared.py | 9 ++++++++- workflow_simple.json | 12 ++++++------ 7 files changed, 38 insertions(+), 29 deletions(-) diff --git a/python_workflow_definition/src/python_workflow_definition/aiida.py b/python_workflow_definition/src/python_workflow_definition/aiida.py index dc9e8e6..3679458 100644 --- a/python_workflow_definition/src/python_workflow_definition/aiida.py +++ b/python_workflow_definition/src/python_workflow_definition/aiida.py @@ -5,6 +5,7 @@ import json from aiida import orm +from python_workflow_definition.shared import convert_nodes_list_to_dict def load_workflow_json(file_name): @@ -14,7 +15,7 @@ def load_workflow_json(file_name): wg = WorkGraph() task_name_mapping = {} - for id, identifier in data["nodes"].items(): + for id, identifier in convert_nodes_list_to_dict(nodes_list=data["nodes"]).items(): if isinstance(identifier, str) and "." in identifier: p, m = identifier.rsplit(".", 1) mod = import_module(p) @@ -66,7 +67,7 @@ def load_workflow_json(file_name): def write_workflow_json(wg, file_name): from aiida_workgraph.socket import TaskSocketNamespace - data = {"nodes": {}, "edges": []} + data = {"nodes": [], "edges": []} node_name_mapping = {} data_node_name_mapping = {} i = 0 @@ -76,7 +77,7 @@ def write_workflow_json(wg, file_name): callable_name = executor["callable_name"] callable_name = f"{executor['module_path']}.{callable_name}" - data["nodes"][str(i)] = callable_name + data["nodes"].append({"id": i, "value": callable_name}) i += 1 for link in wg.links: @@ -105,7 +106,7 @@ def write_workflow_json(wg, file_name): raw_value.pop("node_type", None) else: raw_value = input.value.value - data["nodes"][str(i)] = raw_value + data["nodes"].append({"id": i, "value": raw_value}) input_node_name = i data_node_name_mapping[input.value.uuid] = input_node_name i += 1 diff --git a/python_workflow_definition/src/python_workflow_definition/executorlib.py b/python_workflow_definition/src/python_workflow_definition/executorlib.py index 3e301a5..9a27dad 100644 --- a/python_workflow_definition/src/python_workflow_definition/executorlib.py +++ b/python_workflow_definition/src/python_workflow_definition/executorlib.py @@ -3,7 +3,7 @@ from inspect import isfunction -from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles +from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles, convert_nodes_list_to_dict from python_workflow_definition.purepython import resort_total_lst, group_edges @@ -31,7 +31,8 @@ def load_workflow_json(file_name, exe): edges_new_lst = content["edges"] nodes_new_dict = {} - for k, v in content["nodes"].items(): + + for k, v in convert_nodes_list_to_dict(nodes_list=content["nodes"]).items(): if isinstance(v, str) and "." in v: p, m = v.rsplit('.', 1) mod = import_module(p) diff --git a/python_workflow_definition/src/python_workflow_definition/jobflow.py b/python_workflow_definition/src/python_workflow_definition/jobflow.py index b3d3203..d737c0f 100644 --- a/python_workflow_definition/src/python_workflow_definition/jobflow.py +++ b/python_workflow_definition/src/python_workflow_definition/jobflow.py @@ -5,7 +5,7 @@ import numpy as np from jobflow import job, Flow -from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles +from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles, convert_nodes_list_to_dict def _get_function_dict(flow): @@ -173,7 +173,7 @@ def load_workflow_json(file_name): ) nodes_new_dict = {} - for k, v in content["nodes"].items(): + for k, v in convert_nodes_list_to_dict(nodes_list=content["nodes"]).items(): if isinstance(v, str) and "." in v: p, m = v.rsplit('.', 1) mod = import_module(p) @@ -204,14 +204,14 @@ def write_workflow_json(flow, file_name="workflow.json"): nodes_dict=nodes_dict, ) - nodes_store_dict = {} + nodes_store_lst = [] for k, v in nodes_dict.items(): if isfunction(v): - nodes_store_dict[k] = v.__module__ + "." + v.__name__ + nodes_store_lst.append({"id": k, "value": v.__module__ + "." + v.__name__}) elif isinstance(v, np.ndarray): - nodes_store_dict[k] = v.tolist() + nodes_store_lst.append({"id": k, "value": v.tolist()}) else: - nodes_store_dict[k] = v + nodes_store_lst.append({"id": k, "value": v}) with open(file_name, "w") as f: - json.dump({"nodes": nodes_store_dict, "edges": edges_lst}, f) + json.dump({"nodes": nodes_store_lst, "edges": edges_lst}, f) diff --git a/python_workflow_definition/src/python_workflow_definition/purepython.py b/python_workflow_definition/src/python_workflow_definition/purepython.py index 019f029..815144e 100644 --- a/python_workflow_definition/src/python_workflow_definition/purepython.py +++ b/python_workflow_definition/src/python_workflow_definition/purepython.py @@ -3,7 +3,7 @@ from inspect import isfunction -from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles +from python_workflow_definition.shared import get_dict, get_list, get_kwargs, get_source_handles, convert_nodes_list_to_dict def resort_total_lst(total_lst, nodes_dict): @@ -55,7 +55,7 @@ def load_workflow_json(file_name): edges_new_lst = content["edges"] nodes_new_dict = {} - for k, v in content["nodes"].items(): + for k, v in convert_nodes_list_to_dict(nodes_list=content["nodes"]).items(): if isinstance(v, str) and "." in v: p, m = v.rsplit('.', 1) mod = import_module(p) diff --git a/python_workflow_definition/src/python_workflow_definition/pyiron_base.py b/python_workflow_definition/src/python_workflow_definition/pyiron_base.py index 0e31924..159d7d7 100644 --- a/python_workflow_definition/src/python_workflow_definition/pyiron_base.py +++ b/python_workflow_definition/src/python_workflow_definition/pyiron_base.py @@ -6,7 +6,7 @@ from pyiron_base import job from pyiron_base.project.delayed import DelayedObject -from python_workflow_definition.shared import get_kwargs, get_source_handles +from python_workflow_definition.shared import get_kwargs, get_source_handles, convert_nodes_list_to_dict def _resort_total_lst(total_lst, nodes_dict): @@ -181,7 +181,7 @@ def load_workflow_json(project, file_name): edges_new_lst = content["edges"] nodes_new_dict = {} - for k, v in content["nodes"].items(): + for k, v in convert_nodes_list_to_dict(nodes_list=content["nodes"]).items(): if isinstance(v, str) and "." in v: p, m = v.rsplit('.', 1) if p == "python_workflow_definition.shared": @@ -211,17 +211,17 @@ def write_workflow_json(delayed_object, file_name="workflow.json"): nodes_new_dict = _get_nodes(connection_dict=connection_dict, delayed_object_updated_dict=delayed_object_updated_dict) edges_new_lst = _get_edges_dict(edges_lst=edges_lst, nodes_dict=nodes_dict, connection_dict=connection_dict, lookup_dict=lookup_dict) - nodes_store_dict = {} + nodes_store_lst = [] for k, v in nodes_new_dict.items(): if isfunction(v): mod = v.__module__ if mod == "python_workflow_definition.pyiron_base": mod = "python_workflow_definition.shared" - nodes_store_dict[k] = mod + "." + v.__name__ + nodes_store_lst.append({"id": k, "value": mod + "." + v.__name__}) elif isinstance(v, np.ndarray): - nodes_store_dict[k] = v.tolist() + nodes_store_lst.append({"id": k, "value": v.tolist()}) else: - nodes_store_dict[k] = v + nodes_store_lst.append({"id": k, "value": v}) with open(file_name, "w") as f: - json.dump({"nodes": nodes_store_dict, "edges": edges_new_lst}, f) + json.dump({"nodes": nodes_store_lst, "edges": edges_new_lst}, f) diff --git a/python_workflow_definition/src/python_workflow_definition/shared.py b/python_workflow_definition/src/python_workflow_definition/shared.py index 444aee6..cbb3de9 100644 --- a/python_workflow_definition/src/python_workflow_definition/shared.py +++ b/python_workflow_definition/src/python_workflow_definition/shared.py @@ -22,4 +22,11 @@ def get_source_handles(edges_lst): return { k: list(range(len(v))) if len(v) > 1 and all([el is None for el in v]) else v for k, v in source_handle_dict.items() - } \ No newline at end of file + } + + +def convert_nodes_list_to_dict(nodes_list): + return { + str(el["id"]): el["value"] + for el in sorted(nodes_list, key=lambda d: d["id"]) + } diff --git a/workflow_simple.json b/workflow_simple.json index 4a30bce..512e9c3 100644 --- a/workflow_simple.json +++ b/workflow_simple.json @@ -1,10 +1,10 @@ { - "nodes": { - "0": "simple_workflow.add_x_and_y", - "1": "simple_workflow.add_x_and_y_and_z", - "2": 1, - "3": 2 - }, + "nodes": [ + {"id": 0, "value": "simple_workflow.add_x_and_y"}, + {"id": 1, "value": "simple_workflow.add_x_and_y_and_z"}, + {"id": 2, "value": 1}, + {"id": 3, "value": 2} + ], "edges": [ {"tn": 0, "th": "x", "sn": 2, "sh": null}, {"tn": 0, "th": "y", "sn": 3, "sh": null}, From e10a475b4def87c70d37c2f370169f4974f067d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 12 Apr 2025 10:06:01 +0200 Subject: [PATCH 2/5] update workflows --- workflow_nfdi.json | 18 ++++++------ workflow_qe.json | 68 +++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/workflow_nfdi.json b/workflow_nfdi.json index 141d170..ced1183 100644 --- a/workflow_nfdi.json +++ b/workflow_nfdi.json @@ -1,13 +1,13 @@ { - "nodes": { - "0": "nfdi_ing_workflow.generate_mesh", - "1": "nfdi_ing_workflow.convert_to_xdmf", - "2": "nfdi_ing_workflow.poisson", - "3": "nfdi_ing_workflow.plot_over_line", - "4": "nfdi_ing_workflow.substitute_macros", - "5": "nfdi_ing_workflow.compile_paper", - "6": 2.0 - }, + "nodes": [ + {"id": 0, "value": "nfdi_ing_workflow.generate_mesh"}, + {"id": 1, "value": "nfdi_ing_workflow.convert_to_xdmf"}, + {"id": 2, "value": "nfdi_ing_workflow.poisson"}, + {"id": 3, "value": "nfdi_ing_workflow.plot_over_line"}, + {"id": 4, "value": "nfdi_ing_workflow.substitute_macros"}, + {"id": 5, "value": "nfdi_ing_workflow.compile_paper"}, + {"id": 6, "value": 2.0} + ], "edges": [ {"tn": 0, "th": "domain_size", "sn": 6, "sh": null}, {"tn": 1, "th": "gmsh_output_file", "sn": 0, "sh": null}, diff --git a/workflow_qe.json b/workflow_qe.json index b26b658..c157961 100644 --- a/workflow_qe.json +++ b/workflow_qe.json @@ -1,38 +1,38 @@ { - "nodes": { - "0": "quantum_espresso_workflow.get_bulk_structure", - "1": "quantum_espresso_workflow.calculate_qe", - "2": "quantum_espresso_workflow.generate_structures", - "3": "quantum_espresso_workflow.calculate_qe", - "4": "quantum_espresso_workflow.calculate_qe", - "5": "quantum_espresso_workflow.calculate_qe", - "6": "quantum_espresso_workflow.calculate_qe", - "7": "quantum_espresso_workflow.calculate_qe", - "8": "quantum_espresso_workflow.plot_energy_volume_curve", - "9": "Al", - "10": 4.05, - "11": true, - "12": "mini", - "13": "python_workflow_definition.shared.get_dict", - "14": {"Al": "Al.pbe-n-kjpaw_psl.1.0.0.UPF"}, - "15": [3, 3, 3], - "16": "vc-relax", - "17": 0.02, - "18": [0.9, 0.95, 1.0, 1.05, 1.1], - "19": "strain_0", - "20": "python_workflow_definition.shared.get_dict", - "21": "scf", - "22": "strain_1", - "23": "python_workflow_definition.shared.get_dict", - "24": "strain_2", - "25": "python_workflow_definition.shared.get_dict", - "26": "strain_3", - "27": "python_workflow_definition.shared.get_dict", - "28": "strain_4", - "29": "python_workflow_definition.shared.get_dict", - "30": "python_workflow_definition.shared.get_list", - "31": "python_workflow_definition.shared.get_list" - }, + "nodes": [ + {"id": 0, "value": "quantum_espresso_workflow.get_bulk_structure"}, + {"id": 1, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 2, "value": "quantum_espresso_workflow.generate_structures"}, + {"id": 3, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 4, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 5, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 6, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 7, "value": "quantum_espresso_workflow.calculate_qe"}, + {"id": 8, "value": "quantum_espresso_workflow.plot_energy_volume_curve"}, + {"id": 9, "value": "Al"}, + {"id": 10, "value": 4.05}, + {"id": 11, "value": true}, + {"id": 12, "value": "mini"}, + {"id": 13, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 14, "value": {"Al": "Al.pbe-n-kjpaw_psl.1.0.0.UPF"}}, + {"id": 15, "value": [3, 3, 3]}, + {"id": 16, "value": "vc-relax"}, + {"id": 17, "value": 0.02}, + {"id": 18, "value": [0.9, 0.95, 1.0, 1.05, 1.1]}, + {"id": 19, "value": "strain_0"}, + {"id": 20, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 21, "value": "scf"}, + {"id": 22, "value": "strain_1"}, + {"id": 23, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 24, "value": "strain_2"}, + {"id": 25, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 26, "value": "strain_3"}, + {"id": 27, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 28, "value": "strain_4"}, + {"id": 29, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 30, "value": "python_workflow_definition.shared.get_list"}, + {"id": 31, "value": "python_workflow_definition.shared.get_list"} + ], "edges": [ {"tn": 0, "th": "element", "sn": 9, "sh": null}, {"tn": 0, "th": "a", "sn": 10, "sh": null}, From 8c13fafdccdc8c60664b1fb7ef3861c25b290360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 12 Apr 2025 10:11:55 +0200 Subject: [PATCH 3/5] Update readme --- README.md | 16 ++++++++-------- book/simple.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 03cf108..dd7e5f3 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ Python module. The connection of the Python functions are stored in the [workflo JSON file: ``` { - "nodes": { - "0": "simple_workflow.add_x_and_y_and_z", - "1": "simple_workflow.add_x_and_y", - "2": "simple_workflow.add_x_and_y", - "3": "simple_workflow.add_x_and_y", - "4": 1, - "5": 2 - }, + "nodes": [ + {"id": 0, "value": "simple_workflow.add_x_and_y_and_z"}, + {"id": 1, "value": "simple_workflow.add_x_and_y"}, + {"id": 2, "value": "simple_workflow.add_x_and_y"}, + {"id": 3, "value": "simple_workflow.add_x_and_y"}, + {"id": 4, "value": 1}, + {"id": 5, "value": 2} + ], "edges": [ {"target": 0, "targetPort": "x", "source": 1, "sourcePort": "x"}, {"target": 1, "targetPort": "x", "source": 4, "sourcePort": null}, diff --git a/book/simple.md b/book/simple.md index d38abcb..f9cbfe4 100644 --- a/book/simple.md +++ b/book/simple.md @@ -19,14 +19,14 @@ Python module. The connection of the Python functions are stored in the [workflo JSON file: ``` { - "nodes": { - "0": "simple_workflow.add_x_and_y_and_z", - "1": "simple_workflow.add_x_and_y", - "2": "simple_workflow.add_x_and_y", - "3": "simple_workflow.add_x_and_y", - "4": 1, - "5": 2 - }, + "nodes": [ + {"id": 0, "value": "simple_workflow.add_x_and_y_and_z"}, + {"id": 1, "value": "simple_workflow.add_x_and_y"}, + {"id": 2, "value": "simple_workflow.add_x_and_y"}, + {"id": 3, "value": "simple_workflow.add_x_and_y"}, + {"id": 4, "value": 1}, + {"id": 5, "value": 2} + ], "edges": [ {"target": 0, "targetPort": "x", "source": 1, "sourcePort": "x"}, {"target": 1, "targetPort": "x", "source": 4, "sourcePort": null}, From 55b569ef4b843a72847f6c46f63e803a474d8ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 12 Apr 2025 10:16:22 +0200 Subject: [PATCH 4/5] separate values and functions --- .../src/python_workflow_definition/aiida.py | 2 +- .../src/python_workflow_definition/jobflow.py | 2 +- .../python_workflow_definition/pyiron_base.py | 2 +- .../src/python_workflow_definition/shared.py | 2 +- workflow_nfdi.json | 12 +++---- workflow_qe.json | 34 +++++++++---------- workflow_simple.json | 4 +-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/python_workflow_definition/src/python_workflow_definition/aiida.py b/python_workflow_definition/src/python_workflow_definition/aiida.py index 5896047..bfb51c0 100644 --- a/python_workflow_definition/src/python_workflow_definition/aiida.py +++ b/python_workflow_definition/src/python_workflow_definition/aiida.py @@ -78,7 +78,7 @@ def write_workflow_json(wg, file_name): callable_name = executor["callable_name"] callable_name = f"{executor['module_path']}.{callable_name}" - data["nodes"].append({"id": i, "value": callable_name}) + data["nodes"].append({"id": i, "function": callable_name}) i += 1 for link in wg.links: diff --git a/python_workflow_definition/src/python_workflow_definition/jobflow.py b/python_workflow_definition/src/python_workflow_definition/jobflow.py index 7b3124d..a5ebdce 100644 --- a/python_workflow_definition/src/python_workflow_definition/jobflow.py +++ b/python_workflow_definition/src/python_workflow_definition/jobflow.py @@ -207,7 +207,7 @@ def write_workflow_json(flow, file_name="workflow.json"): nodes_store_lst = [] for k, v in nodes_dict.items(): if isfunction(v): - nodes_store_lst.append({"id": k, "value": v.__module__ + "." + v.__name__}) + nodes_store_lst.append({"id": k, "function": v.__module__ + "." + v.__name__}) elif isinstance(v, np.ndarray): nodes_store_lst.append({"id": k, "value": v.tolist()}) else: diff --git a/python_workflow_definition/src/python_workflow_definition/pyiron_base.py b/python_workflow_definition/src/python_workflow_definition/pyiron_base.py index 471173e..3e7b14e 100644 --- a/python_workflow_definition/src/python_workflow_definition/pyiron_base.py +++ b/python_workflow_definition/src/python_workflow_definition/pyiron_base.py @@ -217,7 +217,7 @@ def write_workflow_json(delayed_object, file_name="workflow.json"): mod = v.__module__ if mod == "python_workflow_definition.pyiron_base": mod = "python_workflow_definition.shared" - nodes_store_lst.append({"id": k, "value": mod + "." + v.__name__}) + nodes_store_lst.append({"id": k, "function": mod + "." + v.__name__}) elif isinstance(v, np.ndarray): nodes_store_lst.append({"id": k, "value": v.tolist()}) else: diff --git a/python_workflow_definition/src/python_workflow_definition/shared.py b/python_workflow_definition/src/python_workflow_definition/shared.py index 9426765..ca7cbe8 100644 --- a/python_workflow_definition/src/python_workflow_definition/shared.py +++ b/python_workflow_definition/src/python_workflow_definition/shared.py @@ -27,6 +27,6 @@ def get_source_handles(edges_lst): def convert_nodes_list_to_dict(nodes_list): return { - str(el["id"]): el["value"] + str(el["id"]): el["value"] if "value" in el else el["function"] for el in sorted(nodes_list, key=lambda d: d["id"]) } diff --git a/workflow_nfdi.json b/workflow_nfdi.json index 265f239..820fb43 100644 --- a/workflow_nfdi.json +++ b/workflow_nfdi.json @@ -1,11 +1,11 @@ { "nodes": [ - {"id": 0, "value": "nfdi_ing_workflow.generate_mesh"}, - {"id": 1, "value": "nfdi_ing_workflow.convert_to_xdmf"}, - {"id": 2, "value": "nfdi_ing_workflow.poisson"}, - {"id": 3, "value": "nfdi_ing_workflow.plot_over_line"}, - {"id": 4, "value": "nfdi_ing_workflow.substitute_macros"}, - {"id": 5, "value": "nfdi_ing_workflow.compile_paper"}, + {"id": 0, "function": "nfdi_ing_workflow.generate_mesh"}, + {"id": 1, "function": "nfdi_ing_workflow.convert_to_xdmf"}, + {"id": 2, "function": "nfdi_ing_workflow.poisson"}, + {"id": 3, "function": "nfdi_ing_workflow.plot_over_line"}, + {"id": 4, "function": "nfdi_ing_workflow.substitute_macros"}, + {"id": 5, "function": "nfdi_ing_workflow.compile_paper"}, {"id": 6, "value": 2.0} ], "edges": [ diff --git a/workflow_qe.json b/workflow_qe.json index 12f05c1..872bda0 100644 --- a/workflow_qe.json +++ b/workflow_qe.json @@ -1,37 +1,37 @@ { "nodes": [ - {"id": 0, "value": "quantum_espresso_workflow.get_bulk_structure"}, - {"id": 1, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 2, "value": "quantum_espresso_workflow.generate_structures"}, - {"id": 3, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 4, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 5, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 6, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 7, "value": "quantum_espresso_workflow.calculate_qe"}, - {"id": 8, "value": "quantum_espresso_workflow.plot_energy_volume_curve"}, + {"id": 0, "function": "quantum_espresso_workflow.get_bulk_structure"}, + {"id": 1, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 2, "function": "quantum_espresso_workflow.generate_structures"}, + {"id": 3, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 4, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 5, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 6, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 7, "function": "quantum_espresso_workflow.calculate_qe"}, + {"id": 8, "function": "quantum_espresso_workflow.plot_energy_volume_curve"}, {"id": 9, "value": "Al"}, {"id": 10, "value": 4.05}, {"id": 11, "value": true}, {"id": 12, "value": "mini"}, - {"id": 13, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 13, "function": "python_workflow_definition.shared.get_dict"}, {"id": 14, "value": {"Al": "Al.pbe-n-kjpaw_psl.1.0.0.UPF"}}, {"id": 15, "value": [3, 3, 3]}, {"id": 16, "value": "vc-relax"}, {"id": 17, "value": 0.02}, {"id": 18, "value": [0.9, 0.95, 1.0, 1.05, 1.1]}, {"id": 19, "value": "strain_0"}, - {"id": 20, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 20, "function": "python_workflow_definition.shared.get_dict"}, {"id": 21, "value": "scf"}, {"id": 22, "value": "strain_1"}, - {"id": 23, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 23, "function": "python_workflow_definition.shared.get_dict"}, {"id": 24, "value": "strain_2"}, - {"id": 25, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 25, "function": "python_workflow_definition.shared.get_dict"}, {"id": 26, "value": "strain_3"}, - {"id": 27, "value": "python_workflow_definition.shared.get_dict"}, + {"id": 27, "function": "python_workflow_definition.shared.get_dict"}, {"id": 28, "value": "strain_4"}, - {"id": 29, "value": "python_workflow_definition.shared.get_dict"}, - {"id": 30, "value": "python_workflow_definition.shared.get_list"}, - {"id": 31, "value": "python_workflow_definition.shared.get_list"} + {"id": 29, "function": "python_workflow_definition.shared.get_dict"}, + {"id": 30, "function": "python_workflow_definition.shared.get_list"}, + {"id": 31, "function": "python_workflow_definition.shared.get_list"} ], "edges": [ {"target": 0, "targetPort": "element", "source": 9, "sourcePort": null}, diff --git a/workflow_simple.json b/workflow_simple.json index 1e88cef..69b6e00 100644 --- a/workflow_simple.json +++ b/workflow_simple.json @@ -1,7 +1,7 @@ { "nodes": [ - {"id": 0, "value": "simple_workflow.add_x_and_y"}, - {"id": 1, "value": "simple_workflow.add_x_and_y_and_z"}, + {"id": 0, "function": "simple_workflow.add_x_and_y"}, + {"id": 1, "function": "simple_workflow.add_x_and_y_and_z"}, {"id": 2, "value": 1}, {"id": 3, "value": 2} ], From 975e0ddc90dbf7bdb66e461a5c134ade65e50872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sat, 12 Apr 2025 10:17:18 +0200 Subject: [PATCH 5/5] update readme --- README.md | 8 ++++---- book/simple.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index dd7e5f3..1e0cd35 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,10 @@ JSON file: ``` { "nodes": [ - {"id": 0, "value": "simple_workflow.add_x_and_y_and_z"}, - {"id": 1, "value": "simple_workflow.add_x_and_y"}, - {"id": 2, "value": "simple_workflow.add_x_and_y"}, - {"id": 3, "value": "simple_workflow.add_x_and_y"}, + {"id": 0, "function": "simple_workflow.add_x_and_y_and_z"}, + {"id": 1, "function": "simple_workflow.add_x_and_y"}, + {"id": 2, "function": "simple_workflow.add_x_and_y"}, + {"id": 3, "function": "simple_workflow.add_x_and_y"}, {"id": 4, "value": 1}, {"id": 5, "value": 2} ], diff --git a/book/simple.md b/book/simple.md index f9cbfe4..2330b8d 100644 --- a/book/simple.md +++ b/book/simple.md @@ -20,10 +20,10 @@ JSON file: ``` { "nodes": [ - {"id": 0, "value": "simple_workflow.add_x_and_y_and_z"}, - {"id": 1, "value": "simple_workflow.add_x_and_y"}, - {"id": 2, "value": "simple_workflow.add_x_and_y"}, - {"id": 3, "value": "simple_workflow.add_x_and_y"}, + {"id": 0, "function": "simple_workflow.add_x_and_y_and_z"}, + {"id": 1, "function": "simple_workflow.add_x_and_y"}, + {"id": 2, "function": "simple_workflow.add_x_and_y"}, + {"id": 3, "function": "simple_workflow.add_x_and_y"}, {"id": 4, "value": 1}, {"id": 5, "value": 2} ],