Skip to content

Commit 02c3ba1

Browse files
committed
add type hints
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent e896064 commit 02c3ba1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/power_grid_model_ds/_core/visualizer/callbacks/element_scaling.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: MPL-2.0
44

55
from copy import deepcopy
6+
from typing import Any
67

78
from dash import Input, Output, callback
89

@@ -15,7 +16,7 @@
1516
Input("edge-scale-input", "value"),
1617
prevent_initial_call=True,
1718
)
18-
def scale_elements(node_scale, edge_scale):
19+
def scale_elements(node_scale: float, edge_scale: float) -> list[dict[str, Any]]:
1920
"""Callback to scale the elements of the graph."""
2021
new_stylesheet = deepcopy(DEFAULT_STYLESHEET)
2122
edge_style = {

src/power_grid_model_ds/_core/visualizer/callbacks/search_form.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]>
22
#
33
# SPDX-License-Identifier: MPL-2.0
4+
from typing import Any
45

56
from dash import Input, Output, callback
67

@@ -15,7 +16,7 @@
1516
Input("search-form-operator-input", "value"),
1617
Input("search-form-value-input", "value"),
1718
)
18-
def search_element(group, column, operator, value):
19+
def search_element(group: str, column: str, operator: str, value: str) -> list[dict[str, Any]]:
1920
"""Color the specified element red based on the input values."""
2021
if not group or not column or not value:
2122
return DEFAULT_STYLESHEET

0 commit comments

Comments
 (0)