Skip to content

Commit 83acba5

Browse files
committed
sort imports using isort
1 parent 31a4a56 commit 83acba5

11 files changed

Lines changed: 78 additions & 142 deletions

File tree

src/python_workflow_definition/_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
TYPE_CHECKING = False
77
if TYPE_CHECKING:
8-
from typing import Tuple
9-
from typing import Union
8+
from typing import Tuple, Union
109

1110
VERSION_TUPLE = Tuple[Union[int, str], ...]
1211
else:

src/python_workflow_definition/aiida.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
from importlib import import_module
21
import traceback
2+
from dataclasses import replace
3+
from importlib import import_module
34

45
from aiida import orm
56
from aiida_pythonjob.data.serializer import general_serializer
6-
from aiida_workgraph import WorkGraph, task, Task, namespace
7+
from aiida_workgraph import Task, WorkGraph, namespace, task
78
from aiida_workgraph.socket import TaskSocketNamespace
8-
from dataclasses import replace
99
from node_graph.task_spec import SchemaSource
10+
1011
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
11-
from python_workflow_definition.shared import (
12-
convert_nodes_list_to_dict,
13-
update_node_names,
14-
set_result_node,
15-
NODES_LABEL,
16-
EDGES_LABEL,
17-
SOURCE_LABEL,
18-
SOURCE_PORT_LABEL,
19-
TARGET_LABEL,
20-
TARGET_PORT_LABEL,
21-
VERSION_NUMBER,
22-
VERSION_LABEL,
23-
)
12+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
13+
SOURCE_LABEL, SOURCE_PORT_LABEL,
14+
TARGET_LABEL, TARGET_PORT_LABEL,
15+
VERSION_LABEL, VERSION_NUMBER,
16+
convert_nodes_list_to_dict,
17+
set_result_node,
18+
update_node_names)
2419

2520

2621
def load_workflow_json(file_name: str) -> WorkGraph:

src/python_workflow_definition/cwl/__init__.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
import json
22
import pickle
3-
from yaml import CDumper as Dumper, dump
4-
5-
6-
from python_workflow_definition.purepython import (
7-
group_edges,
8-
resort_total_lst,
9-
)
10-
from python_workflow_definition.shared import (
11-
convert_nodes_list_to_dict,
12-
remove_result,
13-
EDGES_LABEL,
14-
NODES_LABEL,
15-
TARGET_LABEL,
16-
TARGET_PORT_LABEL,
17-
SOURCE_LABEL,
18-
SOURCE_PORT_LABEL,
19-
)
3+
4+
from yaml import CDumper as Dumper
5+
from yaml import dump
6+
7+
from python_workflow_definition.purepython import group_edges, resort_total_lst
8+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
9+
SOURCE_LABEL, SOURCE_PORT_LABEL,
10+
TARGET_LABEL, TARGET_PORT_LABEL,
11+
convert_nodes_list_to_dict,
12+
remove_result)
2013

2114

2215
def _get_function_argument(argument: str, position: int = 3) -> dict:

src/python_workflow_definition/cwl/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import sys
1+
import importlib.util
22
import pickle
3+
import sys
34
from ast import literal_eval
4-
import importlib.util
55

66

77
def load_function(file_name, funct):

src/python_workflow_definition/executorlib.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
from importlib import import_module
33
from inspect import isfunction
44

5-
65
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
7-
from python_workflow_definition.shared import (
8-
get_dict,
9-
get_list,
10-
get_kwargs,
11-
get_source_handles,
12-
convert_nodes_list_to_dict,
13-
remove_result,
14-
NODES_LABEL,
15-
EDGES_LABEL,
16-
SOURCE_LABEL,
17-
SOURCE_PORT_LABEL,
18-
)
19-
from python_workflow_definition.purepython import resort_total_lst, group_edges
6+
from python_workflow_definition.purepython import group_edges, resort_total_lst
7+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
8+
SOURCE_LABEL, SOURCE_PORT_LABEL,
9+
convert_nodes_list_to_dict,
10+
get_dict, get_kwargs, get_list,
11+
get_source_handles,
12+
remove_result)
2013

2114

2215
def get_item(obj, key):

src/python_workflow_definition/jobflow.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,18 @@
22
from inspect import isfunction
33

44
import numpy as np
5-
from jobflow import job, Flow
5+
from jobflow import Flow, job
66

77
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
8-
from python_workflow_definition.shared import (
9-
get_dict,
10-
get_list,
11-
get_kwargs,
12-
get_source_handles,
13-
update_node_names,
14-
convert_nodes_list_to_dict,
15-
remove_result,
16-
set_result_node,
17-
NODES_LABEL,
18-
EDGES_LABEL,
19-
SOURCE_LABEL,
20-
SOURCE_PORT_LABEL,
21-
TARGET_LABEL,
22-
TARGET_PORT_LABEL,
23-
VERSION_NUMBER,
24-
VERSION_LABEL,
25-
)
8+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
9+
SOURCE_LABEL, SOURCE_PORT_LABEL,
10+
TARGET_LABEL, TARGET_PORT_LABEL,
11+
VERSION_LABEL, VERSION_NUMBER,
12+
convert_nodes_list_to_dict,
13+
get_dict, get_kwargs, get_list,
14+
get_source_handles,
15+
remove_result, set_result_node,
16+
update_node_names)
2617

2718

2819
def _get_function_dict(flow: Flow):

src/python_workflow_definition/models.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
from pathlib import Path
2-
from typing import (
3-
List,
4-
Union,
5-
Optional,
6-
Literal,
7-
Any,
8-
Annotated,
9-
Type,
10-
TypeVar,
11-
)
12-
from typing_extensions import TypeAliasType
13-
from pydantic import BaseModel, Field, field_validator, field_serializer
14-
from pydantic import ValidationError
151
import json
162
import logging
3+
from pathlib import Path
4+
from typing import (Annotated, Any, List, Literal, Optional, Type, TypeVar,
5+
Union)
6+
7+
from pydantic import (BaseModel, Field, ValidationError, field_serializer,
8+
field_validator)
9+
from typing_extensions import TypeAliasType
1710

1811
logger = logging.getLogger(__name__)
1912

src/python_workflow_definition/plot.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
from IPython.display import SVG, display
21
import networkx as nx
3-
2+
from IPython.display import SVG, display
43

54
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
65
from python_workflow_definition.purepython import group_edges
7-
from python_workflow_definition.shared import (
8-
get_kwargs,
9-
convert_nodes_list_to_dict,
10-
NODES_LABEL,
11-
EDGES_LABEL,
12-
SOURCE_LABEL,
13-
SOURCE_PORT_LABEL,
14-
)
6+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
7+
SOURCE_LABEL, SOURCE_PORT_LABEL,
8+
convert_nodes_list_to_dict,
9+
get_kwargs)
1510

1611

1712
def plot(file_name: str):

src/python_workflow_definition/purepython.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
from importlib import import_module
22
from inspect import isfunction
33

4-
54
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
6-
from python_workflow_definition.shared import (
7-
get_dict,
8-
get_list,
9-
get_kwargs,
10-
get_source_handles,
11-
convert_nodes_list_to_dict,
12-
remove_result,
13-
NODES_LABEL,
14-
EDGES_LABEL,
15-
SOURCE_LABEL,
16-
SOURCE_PORT_LABEL,
17-
TARGET_LABEL,
18-
TARGET_PORT_LABEL,
19-
)
5+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
6+
SOURCE_LABEL, SOURCE_PORT_LABEL,
7+
TARGET_LABEL, TARGET_PORT_LABEL,
8+
convert_nodes_list_to_dict,
9+
get_dict, get_kwargs, get_list,
10+
get_source_handles,
11+
remove_result)
2012

2113

2214
def resort_total_lst(total_lst: list, nodes_dict: dict) -> list:

src/python_workflow_definition/pyiron_base.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,18 @@
33
from typing import Optional
44

55
import numpy as np
6-
from pyiron_base import job, Project
6+
from pyiron_base import Project, job
77
from pyiron_base.project.delayed import DelayedObject
88

99
from python_workflow_definition.models import PythonWorkflowDefinitionWorkflow
10-
from python_workflow_definition.shared import (
11-
get_kwargs,
12-
get_source_handles,
13-
convert_nodes_list_to_dict,
14-
update_node_names,
15-
remove_result,
16-
set_result_node,
17-
NODES_LABEL,
18-
EDGES_LABEL,
19-
SOURCE_LABEL,
20-
SOURCE_PORT_LABEL,
21-
TARGET_LABEL,
22-
TARGET_PORT_LABEL,
23-
VERSION_NUMBER,
24-
VERSION_LABEL,
25-
)
10+
from python_workflow_definition.shared import (EDGES_LABEL, NODES_LABEL,
11+
SOURCE_LABEL, SOURCE_PORT_LABEL,
12+
TARGET_LABEL, TARGET_PORT_LABEL,
13+
VERSION_LABEL, VERSION_NUMBER,
14+
convert_nodes_list_to_dict,
15+
get_kwargs, get_source_handles,
16+
remove_result, set_result_node,
17+
update_node_names)
2618

2719

2820
def _resort_total_lst(total_lst: list, nodes_dict: dict) -> list:

0 commit comments

Comments
 (0)