Skip to content

Commit bd2244c

Browse files
committed
mypy
1 parent ae92e8e commit bd2244c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/opengeodeweb_viewer/rpc/mesh/mesh_protocols.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def SetMeshVisibility(self, params: RpcParams) -> None:
8181
@exportRpc(mesh_prefix + mesh_schemas_dict["opacity"]["rpc"])
8282
def setMeshOpacity(self, params: RpcParams) -> None:
8383
validate_schema(params, self.mesh_schemas_dict["opacity"], self.mesh_prefix)
84-
data_id, opacity = str(params["id"]), float(params["opacity"])
84+
data_id, opacity = str(params["id"]), float(
85+
cast(int | float, params["opacity"])
86+
)
8587
self.SetOpacity(data_id, opacity)
8688

8789
@exportRpc(mesh_prefix + mesh_schemas_dict["color"]["rpc"])

src/opengeodeweb_viewer/utils_functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def get_schemas_dict(path):
3030
return schemas_dict
3131

3232

33-
def validate_schema(params: RpcParams, schema: dict, prefix: str = "") -> None:
33+
def validate_schema(
34+
params: RpcParams, schema: dict[str, JsonValue], prefix: str = ""
35+
) -> None:
3436
print(f"{prefix}{schema['rpc']}", f"{params=}", flush=True)
3537
try:
3638
validate = fastjsonschema.compile(schema)

src/opengeodeweb_viewer/vtk_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_data(self, data_id: str) -> dict[str, Union[str, list[str], None]]:
5151
print(f"Error fetching data {data_id}: {e}")
5252
raise
5353

54-
def get_data_file_path(self, data_id: str, filename: str) -> str:
54+
def get_data_file_path(self, data_id: str, filename: str | None = None) -> str:
5555
if filename is None:
5656
data = self.get_data(data_id)
5757
viewable_file_name = data["viewable_file_name"]

0 commit comments

Comments
 (0)