Skip to content

Commit 3681498

Browse files
committed
fixing linter errors
1 parent 414ff42 commit 3681498

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ mypy = "^1.2.0"
3939
pylint = "^2.0.0"
4040
ruff = "^0.4.4"
4141
toml-sort = "^0.23.0"
42+
types-PyYAML = "^6.0.0"
4243
types-requests = "^2.28.11.17"
4344

4445
[tool.poetry.group.sphinx-deps.dependencies]

src/groundlight/edge/config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing_extensions import Self
77

88

9-
class GlobalConfig(BaseModel):
9+
class GlobalConfig(BaseModel): # pylint: disable=too-few-public-methods
1010
"""Global runtime settings for edge-endpoint behavior."""
1111

1212
model_config = ConfigDict(extra="forbid")
@@ -21,7 +21,7 @@ class GlobalConfig(BaseModel):
2121
)
2222

2323

24-
class InferenceConfig(BaseModel):
24+
class InferenceConfig(BaseModel): # pylint: disable=too-few-public-methods
2525
"""
2626
Configuration for edge inference on a specific detector.
2727
"""
@@ -71,7 +71,7 @@ def validate_configuration(self) -> Self:
7171
return self
7272

7373

74-
class DetectorConfig(BaseModel):
74+
class DetectorConfig(BaseModel): # pylint: disable=too-few-public-methods
7575
"""
7676
Configuration for a specific detector.
7777
"""
@@ -93,15 +93,15 @@ class ConfigBase(BaseModel):
9393
@field_validator("edge_inference_configs", mode="before")
9494
@classmethod
9595
def hydrate_inference_config_names(
96-
cls, value: dict[str, InferenceConfig | dict[str, Any]] | None
97-
) -> dict[str, InferenceConfig | dict[str, Any]]:
96+
cls, value: Optional[dict[str, Union[InferenceConfig, dict[str, Any]]]]
97+
) -> dict[str, Union[InferenceConfig, dict[str, Any]]]:
9898
"""Hydrate InferenceConfig.name from payload mapping keys."""
9999
if value is None:
100100
return {}
101101
if not isinstance(value, dict):
102102
return value
103103

104-
hydrated_configs: dict[str, InferenceConfig | dict[str, Any]] = {}
104+
hydrated_configs: dict[str, Union[InferenceConfig, dict[str, Any]]] = {}
105105
for name, config in value.items():
106106
if isinstance(config, InferenceConfig):
107107
hydrated_configs[name] = config
@@ -187,7 +187,7 @@ def from_yaml(
187187
if filename is not None:
188188
if not filename.strip():
189189
raise ValueError("filename must be a non-empty path when provided.")
190-
with open(filename, "r") as f:
190+
with open(filename, "r", encoding="utf-8") as f:
191191
yaml_str = f.read()
192192

193193
yaml_text = yaml_str or ""

0 commit comments

Comments
 (0)