substation.config
The API reference for load_config.
load_config
load_config(path: str | pathlib.Path | None = None) -> AppConfig
Load the configuration a scan runs with: the shipped defaults, with your own file merged over them.
config.yaml.default, which ships with Substation and holds every setting
and band, is always loaded first. A user configuration file is then merged
over it, setting by setting, so what it gives replaces the shipped value and
everything it leaves out keeps its default.
Parameters
path: The user configuration file, as a str or pathlib.Path. When None,config.yamlin the current directory is used if there is one, and otherwise the shipped defaults alone.
Returns
AppConfig: The validated configuration, to pass toRadioScannerasconfig.
Raises
FileNotFoundError:pathnames no file.pydantic.ValidationError: The merged configuration is not valid; the error names each setting at fault.