hots.config.loader API

Configuration loader for the HOTS application.

class hots.config.loader.AppConfig(*, time_limit: ~types.Annotated[int | None, ~annotated_types.Ge(ge=0)] = None, kafka: ~hots.config.loader.KafkaConfig | None = None, clustering: ~hots.config.loader.ClusteringConfig, optimization: ~hots.config.loader.OptimizationConfig, problem: ~hots.config.loader.ProblemConfig, connector: ~hots.config.loader.ConnectorConfig, logging: ~hots.config.loader.LoggingConfig, reporting: ~hots.config.loader.ReportingConfig, visualization: ~hots.config.loader.VisualizationConfig = <factory>)[source]

Bases: _Cfg

Top-level application configuration, combining all sub-configs.

clustering: ClusteringConfig
connector: ConnectorConfig
kafka: KafkaConfig | None
logging: LoggingConfig
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

optimization: OptimizationConfig
problem: ProblemConfig
reporting: ReportingConfig
time_limit: int | None
viz: VisualizationConfig
class hots.config.loader.ClusteringConfig(*, method: str, nb_clusters: int, parameters: dict[str, Any])[source]

Bases: _Cfg

Configuration for the clustering plugin: method name and its parameters.

method: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nb_clusters: int
parameters: dict[str, Any]
class hots.config.loader.ColorConfig(*, clusters: Sequence[str] = ('blue', 'orange', 'green', 'red', 'purple', 'brown', 'pink', 'gray', 'olive', 'cyan', 'turquoise', 'chocolate', 'navy', 'lightcoral', 'violet'), highlight: Sequence[str] = ('violet', 'lightcoral', 'navy', 'chocolate', 'turquoise'))[source]

Bases: _Cfg

clusters: Sequence[str]
highlight: Sequence[str]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hots.config.loader.ConnectorConfig(*, type: str, parameters: dict[str, Any])[source]

Bases: _Cfg

Configuration for the connector plugin: type and its parameters.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parameters: dict[str, Any]
type: str
class hots.config.loader.DendrogramConfig(*, leaf_rotation: float = 90.0, leaf_font_size: float = 8.0)[source]

Bases: _Cfg

leaf_font_size: float
leaf_rotation: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hots.config.loader.GraphConfig(*, spring_layout: ~hots.config.loader.SpringLayoutConfig = <factory>, show_edge_weights: bool = True)[source]

Bases: _Cfg

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

show_edge_weights: bool
spring_layout: SpringLayoutConfig
class hots.config.loader.KafkaConfig(*, topics: list[str], schema: dict[str, Any] | None = None, schema_url: str | None = None, connector_url: str = '')[source]

Bases: _Cfg

Configuration for the Kafka connector: topics and optional schema settings.

connector_url: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

schema_: dict[str, Any] | None
schema_url: str | None
topics: list[str]
class hots.config.loader.LiveConfig(*, pause_seconds: float = 0.5)[source]

Bases: _Cfg

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pause_seconds: float
class hots.config.loader.LoggingConfig(*, level: str, filename: str | None = None, fmt: str)[source]

Bases: _Cfg

Configuration for application-wide logging.

filename: str | None
fmt: str
level: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hots.config.loader.NamingConfig(*, prefix: str = '', suffix: str = '', slugify: bool = True)[source]

Bases: _Cfg

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

prefix: str
slugify: bool
suffix: str
class hots.config.loader.NodesConfig(*, capacity_margin_ratio: float = 0.2, sep_time_color: str = 'red', sep_time_style: str = '--', capacity_color: str = 'red')[source]

Bases: _Cfg

capacity_color: str
capacity_margin_ratio: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sep_time_color: str
sep_time_style: str
class hots.config.loader.OptimizationConfig(*, backend: str, parameters: dict[str, Any])[source]

Bases: _Cfg

Configuration for the optimization plugin: backend and its parameters.

backend: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parameters: dict[str, Any]
class hots.config.loader.ProblemConfig(*, type: str, parameters: dict[str, Any])[source]

Bases: _Cfg

Configuration for the domain problem plugin: type and its parameters.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parameters: dict[str, Any]
type: str
class hots.config.loader.ReportingConfig(*, results_folder: Path, metrics_file: Path, plots_folder: Path)[source]

Bases: _Cfg

Configuration for reporting: folders and file paths for outputs.

metrics_file: Path
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plots_folder: Path
results_folder: Path
class hots.config.loader.SaveConfig(*, enabled: bool = True, plots_folder: Path | None = None, default_format: str = 'png', dpi: int = 150, bbox_inches: str = 'tight', close_on_save: bool = True)[source]

Bases: _Cfg

bbox_inches: str
close_on_save: bool
default_format: str
dpi: int
enabled: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plots_folder: Path | None
class hots.config.loader.SpringLayoutConfig(*, k: float = 0.15, iterations: int = 20)[source]

Bases: _Cfg

iterations: int
k: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hots.config.loader.VisualizationConfig(*, enabled: bool = True, default_metric: str = 'cpu', save: ~hots.config.loader.SaveConfig = <factory>, colors: ~hots.config.loader.ColorConfig = <factory>, dendrogram: ~hots.config.loader.DendrogramConfig = <factory>, graphs: ~hots.config.loader.GraphConfig = <factory>, nodes: ~hots.config.loader.NodesConfig = <factory>, live: ~hots.config.loader.LiveConfig = <factory>, naming: ~hots.config.loader.NamingConfig = <factory>)[source]

Bases: _Cfg

colors: ColorConfig
default_metric: str
dendrogram: DendrogramConfig
enabled: bool
graphs: GraphConfig
live: LiveConfig
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

naming: NamingConfig
nodes: NodesConfig
save: SaveConfig
hots.config.loader.load_config(path: Path) AppConfig[source]

Load JSON configuration from the given path into nested validated models.

Parameters:

path – Path to the JSON config file.

Returns:

An AppConfig instance populated from the file.

Raises:

ValueError – if the config is invalid.