zea.config¶

Config module for managing configuration settings.

This module provides the Config class for managing configuration settings, with support for loading from YAML files, HuggingFace Hub, and dot notation access.

Features¶

  • Dot notation access to dictionary keys.

  • Recursive conversion of nested dictionaries/lists to Config objects.

  • Attribute access logging and suggestion of similar attribute names.

  • Freezing/unfreezing to prevent/allow new attributes.

  • Serialization to YAML/JSON.

  • Integration with Hugging Face Hub.

Example Usage¶

>>> from zea import Config

>>> # Load from YAML
>>> config = Config.from_path("../configs/config_echonet.yaml")
>>> # Load from HuggingFace Hub
>>> config = Config.from_path("hf://zeahub/configs/config_picmus_rf.yaml")

>>> # Access attributes with dot notation
>>> print(config.data.local)
False

>>> # Update recursively
>>> config.update_recursive({"data": {"local": False}})

>>> # Save to YAML
>>> config.to_yaml("new_config.yaml")

Functions

check_config(config[, verbose])

Check a config given dictionary

Classes

Config([dictionary, __parent__])

Config class.

zea.config.check_config(config, verbose=False)[source]¶

Check a config given dictionary