tseda.config.config_loader module

Configuration loader for TSEDA.

This module handles loading and accessing configuration values from the tseda_config.yaml file. The configuration is loaded once at startup and provides a singleton interface for accessing configuration throughout the application.

class tseda.config.config_loader.ConfigurationManager[source]

Bases: object

Singleton configuration manager for TSEDA.

Ensure only one instance exists.

classmethod load_config() dict[str, Any][source]

Load configuration from YAML file.

Returns:

Configuration dictionary.

Raises:
  • FileNotFoundError – If config file is not found.

  • yaml.YAMLError – If YAML parsing fails.

classmethod get(key_path: str, default: Any = None) Any[source]

Get configuration value by dot-separated path.

Parameters:
  • key_path – Dot-separated path to config value (e.g., “file_upload.max_file_lines”).

  • default – Default value if key is not found.

Returns:

Configuration value or default if not found.

Example

>>> max_lines = ConfigurationManager.get("file_upload.max_file_lines")
>>> dw_low = ConfigurationManager.get("noise_validation.dw_low", 1.5)
classmethod get_section(section: str) dict[str, Any][source]

Get entire configuration section.

Parameters:

section – Top-level section name (e.g., “file_upload”, “grouping_heuristic”).

Returns:

Dictionary containing the section, or empty dict if not found.

Example

>>> window_config = ConfigurationManager.get_section("window_selection")
classmethod reload() dict[str, Any][source]

Force reload of configuration from file.

Returns:

Reloaded configuration dictionary.

classmethod reset() None[source]

Reset configuration (for testing).

tseda.config.config_loader.get_config(key_path: str, default: Any = None) Any[source]

Convenience function to get configuration value.

Parameters:
  • key_path – Dot-separated path to config value.

  • default – Default value if key is not found.

Returns:

Configuration value or default.

Example

>>> max_lines = get_config("file_upload.max_file_lines")
tseda.config.config_loader.get_config_section(section: str) dict[str, Any][source]

Convenience function to get entire configuration section.

Parameters:

section – Top-level section name.

Returns:

Dictionary containing the section.

Example

>>> window_cfg = get_config_section("window_selection")