66from 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