load_config#
Defined in: voxatlas.config.config
- voxatlas.config.config.load_config(path)[source]#
Load a VoxAtlas YAML configuration file.
Expected YAML Format#
VoxAtlas configuration files are YAML mappings (YAML “dicts”) with a small set of conventional top-level keys. The minimal valid config contains a
featureslist:features: - acoustic.pitch.dummy
Optional keys supported by the pipeline and config layer include:
pipeline: pipeline runtime options (mapping) -n_jobs: number of worker processes per dependency layer (int) -cache: enable/disable on-disk feature caching (bool) -cache_dir: cache directory when caching is enabled (str)feature_config: per-feature parameter overrides (mapping) - keys are feature names fromfeatures- values are extractor-specific parameter mappings
Example with per-feature parameters and pipeline options:
features: - phonology.prosody.stressed - acoustic.pitch.f0 pipeline: n_jobs: 4 cache: true cache_dir: .voxatlas_cache feature_config: phonology.prosody.stressed: language: fra resource_root: /path/to/resources/phonology
- param path:
Filesystem path to a YAML configuration file.
- type path:
str
- returns:
Parsed configuration dictionary.
- rtype:
dict
- raises OSError:
Raised when the file cannot be opened.
- raises yaml.YAMLError:
Raised when the YAML document is invalid.
Notes
This function parses YAML only. It does not apply defaults or schema validation. For the recommended entry point that validates and applies defaults, see
load_and_prepare_config().Examples
>>> import tempfile >>> from pathlib import Path >>> from voxatlas.config import load_config >>> yaml_text = "features:\n - acoustic.pitch.dummy\n" >>> with tempfile.TemporaryDirectory() as tmp: ... path = Path(tmp) / "config.yaml" ... _ = path.write_text(yaml_text, encoding="utf-8") ... cfg = load_config(str(path)) ... cfg["features"] ['acoustic.pitch.dummy']
- Parameters:
path (str)
- Return type:
dict