nicetoolbox.utils.base_detectors

Helper functions for method and feature detector base classes.

Functions

flatten_inference_config

Build flattened inference config dictionary (Static + Runtime).

input_map_to_string_keys

Convert input_map with tuple keys to string keys and paths for serialization.

input_map_to_tuple_keys

Convert input_map with string keys back to tuple keys with Path objects.

string_key_to_tuple

Convert string key back to tuple.

tuple_key_to_string

Convert tuple key to string for TOML serialization.

nicetoolbox.utils.base_detectors.flatten_inference_config(static_config: BaseModel, runtime_config: BaseModel) Dict[str, Any][source]

Build flattened inference config dictionary (Static + Runtime).

Parameters:
  • static_config – The loaded static properties (e.g. from TOML).

  • runtime_config – The computed runtime properties.

Returns:

Flattened dictionary ready for serialization to run_config.toml

nicetoolbox.utils.base_detectors.input_map_to_string_keys(input_map: Dict[Tuple[str, str], Path]) Dict[str, str][source]

Convert input_map with tuple keys to string keys and paths for serialization.

nicetoolbox.utils.base_detectors.input_map_to_tuple_keys(input_map: Dict[str, str]) Dict[Tuple[str, str], Path][source]

Convert input_map with string keys back to tuple keys with Path objects.

nicetoolbox.utils.base_detectors.string_key_to_tuple(key: str) Tuple[str, str][source]

Convert string key back to tuple.

nicetoolbox.utils.base_detectors.tuple_key_to_string(key: Tuple[str, str]) str[source]

Convert tuple key to string for TOML serialization.