Skip to content

Config Loading

Most users only need these helpers:

  • Use load_default_preset() to start from the built-in default settings and change a few values in Python.
  • Use load_config() to load your own YAML config file.
  • Use load_preset() when loading a named preset packaged with matchminer-ai.

matchminer_ai.config

Configuration helpers for MatchMiner-AI.

load_config

load_config(path: str | Path) -> MMAIConfig

Load a configuration YAML file from a user-provided path.

Source code in src/matchminer_ai/config.py
83
84
85
86
87
88
89
90
def load_config(path: str | Path) -> MMAIConfig:
    """Load a configuration YAML file from a user-provided path."""
    config_path = Path(path)
    with config_path.open("r", encoding="utf-8") as handle:
        data = yaml.safe_load(handle) or {}
    if not isinstance(data, dict):
        raise ValueError(f"Config {config_path} did not parse into a mapping.")
    return _config_from_data(data, preset_name=str(config_path))

load_default_preset

load_default_preset() -> MMAIConfig

Load the default configuration preset.

Source code in src/matchminer_ai/config.py
93
94
95
def load_default_preset() -> MMAIConfig:
    """Load the default configuration preset."""
    return load_preset("default")

load_preset

load_preset(name: str) -> MMAIConfig

Load a named configuration preset.

Source code in src/matchminer_ai/config.py
77
78
79
80
def load_preset(name: str) -> MMAIConfig:
    """Load a named configuration preset."""
    data = _load_preset_data(name)
    return _config_from_data(data, preset_name=name)