Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/python_workflow_definition/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union
from typing import Tuple, Union

VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
Expand Down
17 changes: 9 additions & 8 deletions src/python_workflow_definition/aiida.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
from importlib import import_module
import traceback
from dataclasses import replace
from importlib import import_module

from aiida import orm
from aiida_pythonjob.data.serializer import general_serializer
from aiida_workgraph import WorkGraph, task, Task, namespace
from aiida_workgraph import Task, WorkGraph, namespace, task
from aiida_workgraph.socket import TaskSocketNamespace
from dataclasses import replace
from node_graph.task_spec import SchemaSource

from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.shared import (
convert_nodes_list_to_dict,
update_node_names,
set_result_node,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
VERSION_NUMBER,
VERSION_LABEL,
VERSION_NUMBER,
convert_nodes_list_to_dict,
set_result_node,
update_node_names,
)


Expand Down
16 changes: 7 additions & 9 deletions src/python_workflow_definition/cwl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import json
import pickle
from yaml import CDumper as Dumper, dump

from yaml import CDumper as Dumper
from yaml import dump

from python_workflow_definition.purepython import (
group_edges,
resort_total_lst,
)
from python_workflow_definition.purepython import group_edges, resort_total_lst
from python_workflow_definition.shared import (
convert_nodes_list_to_dict,
remove_result,
EDGES_LABEL,
NODES_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
convert_nodes_list_to_dict,
remove_result,
)


Expand Down
4 changes: 2 additions & 2 deletions src/python_workflow_definition/cwl/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import importlib.util
import pickle
import sys
from ast import literal_eval
import importlib.util


def load_function(file_name, funct):
Expand Down
15 changes: 7 additions & 8 deletions src/python_workflow_definition/executorlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
from importlib import import_module
from inspect import isfunction


from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.purepython import group_edges, resort_total_lst
from python_workflow_definition.shared import (
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
convert_nodes_list_to_dict,
get_dict,
get_list,
get_kwargs,
get_list,
get_source_handles,
convert_nodes_list_to_dict,
remove_result,
NODES_LABEL,
EDGES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
)
from python_workflow_definition.purepython import resort_total_lst, group_edges


def get_item(obj, key):
Expand Down
22 changes: 11 additions & 11 deletions src/python_workflow_definition/jobflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
from inspect import isfunction

import numpy as np
from jobflow import job, Flow
from jobflow import Flow, job

from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.shared import (
get_dict,
get_list,
get_kwargs,
get_source_handles,
update_node_names,
convert_nodes_list_to_dict,
remove_result,
set_result_node,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
VERSION_NUMBER,
VERSION_LABEL,
VERSION_NUMBER,
convert_nodes_list_to_dict,
get_dict,
get_kwargs,
get_list,
get_source_handles,
remove_result,
set_result_node,
update_node_names,
)


Expand Down
23 changes: 10 additions & 13 deletions src/python_workflow_definition/models.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import json
import logging
from pathlib import Path
from typing import (
List,
Union,
Optional,
Literal,
Any,
Annotated,
Type,
TypeVar,
from typing import Annotated, Any, List, Literal, Optional, Type, TypeVar, Union

from pydantic import (
BaseModel,
Field,
ValidationError,
field_serializer,
field_validator,
)
from typing_extensions import TypeAliasType
from pydantic import BaseModel, Field, field_validator, field_serializer
from pydantic import ValidationError
import json
import logging

logger = logging.getLogger(__name__)

Expand Down
9 changes: 4 additions & 5 deletions src/python_workflow_definition/plot.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
from IPython.display import SVG, display
import networkx as nx

from IPython.display import SVG, display

from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.purepython import group_edges
from python_workflow_definition.shared import (
get_kwargs,
convert_nodes_list_to_dict,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
convert_nodes_list_to_dict,
get_kwargs,
)


Expand Down
15 changes: 7 additions & 8 deletions src/python_workflow_definition/purepython.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
from importlib import import_module
from inspect import isfunction


from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.shared import (
get_dict,
get_list,
get_kwargs,
get_source_handles,
convert_nodes_list_to_dict,
remove_result,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
convert_nodes_list_to_dict,
get_dict,
get_kwargs,
get_list,
get_source_handles,
remove_result,
)


Expand Down
18 changes: 9 additions & 9 deletions src/python_workflow_definition/pyiron_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
from typing import Optional

import numpy as np
from pyiron_base import job, Project
from pyiron_base import Project, job
from pyiron_base.project.delayed import DelayedObject

from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.shared import (
get_kwargs,
get_source_handles,
convert_nodes_list_to_dict,
update_node_names,
remove_result,
set_result_node,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
VERSION_NUMBER,
VERSION_LABEL,
VERSION_NUMBER,
convert_nodes_list_to_dict,
get_kwargs,
get_source_handles,
remove_result,
set_result_node,
update_node_names,
)


Expand Down
16 changes: 8 additions & 8 deletions src/python_workflow_definition/pyiron_workflow.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
from collections import Counter
from inspect import isfunction
from importlib import import_module
from inspect import isfunction
from typing import Any

import numpy as np
from pyiron_workflow import as_function_node, function_node, Workflow
from pyiron_workflow import Workflow, as_function_node, function_node
from pyiron_workflow.api import Function

from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
from python_workflow_definition.shared import (
get_dict,
update_node_names,
set_result_node,
remove_result,
NODES_LABEL,
EDGES_LABEL,
NODES_LABEL,
SOURCE_LABEL,
SOURCE_PORT_LABEL,
TARGET_LABEL,
TARGET_PORT_LABEL,
VERSION_NUMBER,
VERSION_LABEL,
VERSION_NUMBER,
get_dict,
remove_result,
set_result_node,
update_node_names,
)


Expand Down
Loading