python-workflow-definition 0.1.3__py2.py3-none-any.whl → 0.1.5__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.3'
32
- __version_tuple__ = version_tuple = (0, 1, 3)
31
+ __version__ = version = '0.1.5'
32
+ __version_tuple__ = version_tuple = (0, 1, 5)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -6,7 +6,7 @@ from aiida_pythonjob.data.serializer import general_serializer
6
6
  from aiida_workgraph import WorkGraph, task, Task, namespace
7
7
  from aiida_workgraph.socket import TaskSocketNamespace
8
8
  from dataclasses import replace
9
- from node_graph.node_spec import SchemaSource
9
+ from node_graph.task_spec import SchemaSource
10
10
  from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
11
11
  from python_workflow_definition.shared import (
12
12
  convert_nodes_list_to_dict,
@@ -30,10 +30,15 @@ def load_workflow_json(file_name: str) -> WorkGraph:
30
30
  wg = WorkGraph()
31
31
  task_name_mapping = {}
32
32
 
33
+ nodes_types_dict = {int(n["id"]): n["type"] for n in data[NODES_LABEL]}
33
34
  for id, identifier in convert_nodes_list_to_dict(
34
35
  nodes_list=data[NODES_LABEL]
35
36
  ).items():
36
- if isinstance(identifier, str) and "." in identifier:
37
+ if (
38
+ nodes_types_dict[int(id)] == "function"
39
+ and isinstance(identifier, str)
40
+ and "." in identifier
41
+ ):
37
42
  p, m = identifier.rsplit(".", 1)
38
43
  mod = import_module(p)
39
44
  func = getattr(mod, m)
@@ -109,9 +114,9 @@ def write_workflow_json(wg: WorkGraph, file_name: str) -> dict:
109
114
  # if the from socket is the default result, we set it to None
110
115
  if link_data["from_socket"] == "result":
111
116
  link_data["from_socket"] = None
112
- link_data[TARGET_LABEL] = node_name_mapping[link_data.pop("to_node")]
117
+ link_data[TARGET_LABEL] = node_name_mapping[link_data.pop("to_task")]
113
118
  link_data[TARGET_PORT_LABEL] = link_data.pop("to_socket")
114
- link_data[SOURCE_LABEL] = node_name_mapping[link_data.pop("from_node")]
119
+ link_data[SOURCE_LABEL] = node_name_mapping[link_data.pop("from_task")]
115
120
  link_data[SOURCE_PORT_LABEL] = link_data.pop("from_socket")
116
121
  data[EDGES_LABEL].append(link_data)
117
122
 
@@ -47,8 +47,9 @@ def load_workflow_json(file_name: str, exe: Executor):
47
47
  edges_new_lst = content[EDGES_LABEL]
48
48
  nodes_new_dict = {}
49
49
 
50
+ nodes_types_dict = {int(n["id"]): n["type"] for n in content[NODES_LABEL]}
50
51
  for k, v in convert_nodes_list_to_dict(nodes_list=content[NODES_LABEL]).items():
51
- if isinstance(v, str) and "." in v:
52
+ if nodes_types_dict[int(k)] == "function" and isinstance(v, str) and "." in v:
52
53
  p, m = v.rsplit(".", 1)
53
54
  mod = import_module(p)
54
55
  nodes_new_dict[int(k)] = getattr(mod, m)
@@ -295,8 +295,9 @@ def load_workflow_json(file_name: str) -> Flow:
295
295
  )
296
296
 
297
297
  nodes_new_dict = {}
298
+ nodes_types_dict = {int(n["id"]): n["type"] for n in content[NODES_LABEL]}
298
299
  for k, v in convert_nodes_list_to_dict(nodes_list=content[NODES_LABEL]).items():
299
- if isinstance(v, str) and "." in v:
300
+ if nodes_types_dict[int(k)] == "function" and isinstance(v, str) and "." in v:
300
301
  p, m = v.rsplit(".", 1)
301
302
  mod = import_module(p)
302
303
  nodes_new_dict[int(k)] = getattr(mod, m)
@@ -75,8 +75,9 @@ def load_workflow_json(file_name: str):
75
75
 
76
76
  edges_new_lst = content[EDGES_LABEL]
77
77
  nodes_new_dict = {}
78
+ nodes_types_dict = {int(n["id"]): n["type"] for n in content[NODES_LABEL]}
78
79
  for k, v in convert_nodes_list_to_dict(nodes_list=content[NODES_LABEL]).items():
79
- if isinstance(v, str) and "." in v:
80
+ if nodes_types_dict[int(k)] == "function" and isinstance(v, str) and "." in v:
80
81
  p, m = v.rsplit(".", 1)
81
82
  mod = import_module(p)
82
83
  nodes_new_dict[int(k)] = getattr(mod, m)
@@ -239,9 +239,10 @@ def load_workflow_json(file_name: str, project: Optional[Project] = None):
239
239
  )
240
240
 
241
241
  edges_new_lst = content[EDGES_LABEL]
242
+ nodes_types_dict = {int(n["id"]): n["type"] for n in content[NODES_LABEL]}
242
243
  nodes_new_dict = {}
243
244
  for k, v in convert_nodes_list_to_dict(nodes_list=content[NODES_LABEL]).items():
244
- if isinstance(v, str) and "." in v:
245
+ if nodes_types_dict[int(k)] == "function" and isinstance(v, str) and "." in v:
245
246
  p, m = v.rsplit(".", 1)
246
247
  if p == "python_workflow_definition.shared":
247
248
  p = "python_workflow_definition.pyiron_base"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_workflow_definition
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Python Workflow Definition - workflow interoperability for aiida, jobflow and pyiron
5
5
  Author-email: Jan Janssen <janssen@mpie.de>, Janine George <janine.geogre@bam.de>, Julian Geiger <julian.geiger@psi.ch>, Xing Wang <xing.wang@psi.ch>, Marnik Bercx <marnik.bercx@psi.ch>, Christina Ertural <christina.ertural@bam.de>
6
6
  License: BSD 3-Clause License
@@ -34,14 +34,18 @@ License: BSD 3-Clause License
34
34
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  License-File: LICENSE
36
36
  Requires-Dist: numpy>=1.21
37
- Requires-Dist: pydantic<=2.12.4,>=2.7.0
37
+ Requires-Dist: pydantic<2.13.0,>=2.7.0
38
38
  Provides-Extra: aiida
39
- Requires-Dist: aiida-workgraph<=0.7.6,>=0.5.1; extra == 'aiida'
39
+ Requires-Dist: aiida-workgraph<=0.8.1,>=0.5.1; extra == 'aiida'
40
+ Provides-Extra: executorlib
41
+ Requires-Dist: executorlib<=1.9.1,>=1.7.4; extra == 'executorlib'
40
42
  Provides-Extra: jobflow
41
- Requires-Dist: jobflow<=0.2.1,>=0.1.18; extra == 'jobflow'
43
+ Requires-Dist: jobflow<=0.3.1,>=0.1.18; extra == 'jobflow'
42
44
  Provides-Extra: plot
43
45
  Requires-Dist: ipython<=9.8.0,>=7.33.0; extra == 'plot'
44
46
  Requires-Dist: networkx<=3.5,>=2.8.8; extra == 'plot'
45
47
  Requires-Dist: pygraphviz<=1.14,>=1.10; extra == 'plot'
46
48
  Provides-Extra: pyiron
47
49
  Requires-Dist: pyiron-base<=0.15.12,>=0.11.10; extra == 'pyiron'
50
+ Provides-Extra: pyiron-workflow
51
+ Requires-Dist: pyiron-workflow<=0.15.5,>=0.13.0; extra == 'pyiron-workflow'
@@ -0,0 +1,17 @@
1
+ python_workflow_definition/__init__.py,sha256=h99LG51BctvOaZSCwDOOD1-t_5dNHVNnf2aaWFOnyiQ,106
2
+ python_workflow_definition/_version.py,sha256=rdxBMYpwzYxiWk08QbPLHSAxHoDfeKWwyaJIAM0lSic,704
3
+ python_workflow_definition/aiida.py,sha256=QGi0vLLGh6CclJQFQWJKdFM2lNIQ50DoMUlG_AvyXO0,6283
4
+ python_workflow_definition/executorlib.py,sha256=jJiw3RrDbHlMWjqKaIg7U2IN5Isb0HQaMfPpqEX4J5Y,2431
5
+ python_workflow_definition/jobflow.py,sha256=e4Ho9Tx_yublC_UartvHUwphp2Z3wpEvFKcn9ufdguQ,12500
6
+ python_workflow_definition/models.py,sha256=R9Kclp4fGlg4H--NHNohjgat1WTDDpO7pis5r-_lX8c,9049
7
+ python_workflow_definition/plot.py,sha256=Y_X2HF2kCXaoIdi-b7ZMdySUIb6S1pjL2hwHRu3Zey8,1633
8
+ python_workflow_definition/purepython.py,sha256=QX2MOIqfC_lP-yE4v2zb7nOBsrolsHe8yBecI4QmT9s,3443
9
+ python_workflow_definition/pyiron_base.py,sha256=bSSohSjGzr7o8HeGjN5w8MDaUpWYJpvWndqRBG25Ro8,11730
10
+ python_workflow_definition/pyiron_workflow.py,sha256=UuzykgWI6YkecMKcX2lZtTx-hY3wH2fOCqLvNnm0VxA,15035
11
+ python_workflow_definition/shared.py,sha256=t0YKxpXYfPFxs6KqmjGy4oU89xcUHO1xANzxBE5oP7c,3468
12
+ python_workflow_definition/cwl/__init__.py,sha256=GTYsSbkzsRZPQ2NW4Rxf-bLVyZlW6B00sNf9Uz0DsW4,7750
13
+ python_workflow_definition/cwl/__main__.py,sha256=x5QHMqPt-J3EpSNKNNzE0v9GH6eiM8hVE43iNEf7y28,1584
14
+ python_workflow_definition-0.1.5.dist-info/METADATA,sha256=-UKUx-wbQRb06u6raQ0s6mcD5EQcmIjHOakuvkRApaU,2874
15
+ python_workflow_definition-0.1.5.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
16
+ python_workflow_definition-0.1.5.dist-info/licenses/LICENSE,sha256=weTxRQ0keMOdgE0qJlsyCAIgm3BB62Bb3mS6_4iUv7Q,1511
17
+ python_workflow_definition-0.1.5.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- python_workflow_definition/__init__.py,sha256=h99LG51BctvOaZSCwDOOD1-t_5dNHVNnf2aaWFOnyiQ,106
2
- python_workflow_definition/_version.py,sha256=q5nF98G8SoVeJqaknL0xdyxtv0egsqb0fK06_84Izu8,704
3
- python_workflow_definition/aiida.py,sha256=A8MYRgkFCLEenXxe6H3fhYX-At3nt1VB-AXw1xRg7mM,6115
4
- python_workflow_definition/executorlib.py,sha256=lRMIPznpNX5yrtybhN0Ghb13ED-LABcUXgorzuBqQ6Q,2309
5
- python_workflow_definition/jobflow.py,sha256=gZmtcD4JMg5qdoyDdvlpwM6MgR_mOocDEMQ4ZUvNJRk,12378
6
- python_workflow_definition/models.py,sha256=R9Kclp4fGlg4H--NHNohjgat1WTDDpO7pis5r-_lX8c,9049
7
- python_workflow_definition/plot.py,sha256=Y_X2HF2kCXaoIdi-b7ZMdySUIb6S1pjL2hwHRu3Zey8,1633
8
- python_workflow_definition/purepython.py,sha256=-9PcmYttKpgpcUiEwknfsLDDjL7PW0TsEu-A-57uv6Y,3321
9
- python_workflow_definition/pyiron_base.py,sha256=kgUaVNGqmwY4fv2fZx6ErA0THl97xIDEmHcShqNicm4,11608
10
- python_workflow_definition/pyiron_workflow.py,sha256=UuzykgWI6YkecMKcX2lZtTx-hY3wH2fOCqLvNnm0VxA,15035
11
- python_workflow_definition/shared.py,sha256=t0YKxpXYfPFxs6KqmjGy4oU89xcUHO1xANzxBE5oP7c,3468
12
- python_workflow_definition/cwl/__init__.py,sha256=GTYsSbkzsRZPQ2NW4Rxf-bLVyZlW6B00sNf9Uz0DsW4,7750
13
- python_workflow_definition/cwl/__main__.py,sha256=x5QHMqPt-J3EpSNKNNzE0v9GH6eiM8hVE43iNEf7y28,1584
14
- python_workflow_definition-0.1.3.dist-info/METADATA,sha256=vFJCXO4KAqWEWlblEj5nmm7L6E1lbZoO_PYqrdtgjUQ,2673
15
- python_workflow_definition-0.1.3.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
16
- python_workflow_definition-0.1.3.dist-info/licenses/LICENSE,sha256=weTxRQ0keMOdgE0qJlsyCAIgm3BB62Bb3mS6_4iUv7Q,1511
17
- python_workflow_definition-0.1.3.dist-info/RECORD,,