Skip to content

Commit 8556c06

Browse files
committed
black formatting
1 parent 83e5644 commit 8556c06

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

python_workflow_definition/src/python_workflow_definition/jobflow.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,10 @@ def write_workflow_json(flow: Flow, file_name: str = "workflow.json"):
331331
nodes_store_lst.append({"id": k, "type": "input", "value": v})
332332

333333
with open(file_name, "w") as f:
334-
json.dump(update_node_names(content={
335-
NODES_LABEL: nodes_store_lst,
336-
EDGES_LABEL: edges_lst
337-
}), f, indent=2)
334+
json.dump(
335+
update_node_names(
336+
content={NODES_LABEL: nodes_store_lst, EDGES_LABEL: edges_lst}
337+
),
338+
f,
339+
indent=2,
340+
)

python_workflow_definition/src/python_workflow_definition/pyiron_base.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ def write_workflow_json(
292292
nodes_store_lst.append({"id": k, "type": "input", "value": v})
293293

294294
with open(file_name, "w") as f:
295-
json.dump(update_node_names(content={
296-
NODES_LABEL: nodes_store_lst,
297-
EDGES_LABEL: edges_new_lst
298-
}), f, indent=2)
295+
json.dump(
296+
update_node_names(
297+
content={NODES_LABEL: nodes_store_lst, EDGES_LABEL: edges_new_lst}
298+
),
299+
f,
300+
indent=2,
301+
)

python_workflow_definition/src/python_workflow_definition/shared.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ def update_node_names(content: dict) -> dict:
5050
node_names_final_dict = {}
5151
input_nodes = [n for n in content[NODES_LABEL] if n["type"] == "input"]
5252
node_names_dict = {
53-
n["id"]: list(set([e[TARGET_PORT_LABEL] for e in content[EDGES_LABEL] if e[SOURCE_LABEL] == n["id"]]))[0]
53+
n["id"]: list(
54+
set(
55+
[
56+
e[TARGET_PORT_LABEL]
57+
for e in content[EDGES_LABEL]
58+
if e[SOURCE_LABEL] == n["id"]
59+
]
60+
)
61+
)[0]
5462
for n in input_nodes
5563
}
5664

@@ -66,4 +74,4 @@ def update_node_names(content: dict) -> dict:
6674
for n in content[NODES_LABEL]:
6775
if n["type"] == "input":
6876
n["name"] = node_names_final_dict[n["id"]]
69-
return content
77+
return content

0 commit comments

Comments
 (0)