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
ifTYPE_CHECKING:
8-
fromtypingimportTuple
9-
fromtypingimportUnion
8+
fromtypingimportTuple, 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-
fromimportlibimportimport_module
21
importtraceback
2+
fromdataclassesimportreplace
3+
fromimportlibimportimport_module
34

45
fromaiidaimportorm
56
fromaiida_pythonjob.data.serializerimportgeneral_serializer
6-
fromaiida_workgraphimportWorkGraph, task, Task, namespace
7+
fromaiida_workgraphimportTask, WorkGraph, namespace, task
78
fromaiida_workgraph.socketimportTaskSocketNamespace
8-
fromdataclassesimportreplace
99
fromnode_graph.task_specimportSchemaSource
10+
1011
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
11-
frompython_workflow_definition.sharedimport (
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+
frompython_workflow_definition.sharedimport (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
defload_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
importjson
22
importpickle
3-
fromyamlimportCDumperasDumper, dump
4-
5-
6-
frompython_workflow_definition.purepythonimport (
7-
group_edges,
8-
resort_total_lst,
9-
)
10-
frompython_workflow_definition.sharedimport (
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+
fromyamlimportCDumperasDumper
5+
fromyamlimportdump
6+
7+
frompython_workflow_definition.purepythonimportgroup_edges, resort_total_lst
8+
frompython_workflow_definition.sharedimport (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-
importsys
1+
importimportlib.util
22
importpickle
3+
importsys
34
fromastimportliteral_eval
4-
importimportlib.util
55

66

77
defload_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
fromimportlibimportimport_module
33
frominspectimportisfunction
44

5-
65
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
7-
frompython_workflow_definition.sharedimport (
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-
frompython_workflow_definition.purepythonimportresort_total_lst, group_edges
6+
frompython_workflow_definition.purepythonimportgroup_edges, resort_total_lst
7+
frompython_workflow_definition.sharedimport (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
defget_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
frominspectimportisfunction
33

44
importnumpyasnp
5-
fromjobflowimportjob, Flow
5+
fromjobflowimportFlow, job
66

77
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
8-
frompython_workflow_definition.sharedimport (
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+
frompython_workflow_definition.sharedimport (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-
frompathlibimportPath
2-
fromtypingimport (
3-
List,
4-
Union,
5-
Optional,
6-
Literal,
7-
Any,
8-
Annotated,
9-
Type,
10-
TypeVar,
11-
)
12-
fromtyping_extensionsimportTypeAliasType
13-
frompydanticimportBaseModel, Field, field_validator, field_serializer
14-
frompydanticimportValidationError
151
importjson
162
importlogging
3+
frompathlibimportPath
4+
fromtypingimport (Annotated, Any, List, Literal, Optional, Type, TypeVar,
5+
Union)
6+
7+
frompydanticimport (BaseModel, Field, ValidationError, field_serializer,
8+
field_validator)
9+
fromtyping_extensionsimportTypeAliasType
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-
fromIPython.displayimportSVG, display
21
importnetworkxasnx
3-
2+
fromIPython.displayimportSVG, display
43

54
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
65
frompython_workflow_definition.purepythonimportgroup_edges
7-
frompython_workflow_definition.sharedimport (
8-
get_kwargs,
9-
convert_nodes_list_to_dict,
10-
NODES_LABEL,
11-
EDGES_LABEL,
12-
SOURCE_LABEL,
13-
SOURCE_PORT_LABEL,
14-
)
6+
frompython_workflow_definition.sharedimport (EDGES_LABEL, NODES_LABEL,
7+
SOURCE_LABEL, SOURCE_PORT_LABEL,
8+
convert_nodes_list_to_dict,
9+
get_kwargs)
1510

1611

1712
defplot(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
fromimportlibimportimport_module
22
frominspectimportisfunction
33

4-
54
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
6-
frompython_workflow_definition.sharedimport (
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+
frompython_workflow_definition.sharedimport (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
defresort_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
fromtypingimportOptional
44

55
importnumpyasnp
6-
frompyiron_baseimportjob, Project
6+
frompyiron_baseimportProject, job
77
frompyiron_base.project.delayedimportDelayedObject
88

99
frompython_workflow_definition.modelsimportPythonWorkflowDefinitionWorkflow
10-
frompython_workflow_definition.sharedimport (
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+
frompython_workflow_definition.sharedimport (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)