scaffold.hydra.config_helpers ============================= .. py:module:: scaffold.hydra.config_helpers Attributes ---------- .. autoapisummary:: scaffold.hydra.config_helpers.CONFIG_STORE Classes ------- .. autoapisummary:: scaffold.hydra.config_helpers.StructuredConfig Functions --------- .. autoapisummary:: scaffold.hydra.config_helpers.check_cfg_for_missing_values scaffold.hydra.config_helpers.structured_config Module Contents --------------- .. py:class:: StructuredConfig .. py:method:: get_store_args() -> Dict[str, str] :classmethod: :abstractmethod: Returns the arguments used to store this dataclass in the config store. .. py:method:: get_store_path() -> str :classmethod: :abstractmethod: Returns the path to the node of the StructuredConfig inside the config store. .. py:function:: check_cfg_for_missing_values(allowed_missing: Optional[List[str]] = None) Decorator function that ensures we have no entries with MISSING values. .. deprecated:: Use :func:`hydra_zen.builds` with ``populate_full_signature=True`` and rely on hydra's built-in ``MISSING`` handling instead. This helper will be removed in a future release. It checks entries to see if they have not been overwritten via YAML or CLI. Entries ending with logging are not checked. Usage: >>> @hydra.main( ... config_name="my_config", ... ) ... @check_cfg_for_missing_values(['myconfig.subconfig_tree.this_entry_may_be_missing']) ... def main(cfg: DictConfig) -> None: ... pass .. py:function:: structured_config(_cls: Optional[Type] = None, name: Optional[str] = None, group: Optional[str] = None, package: Optional[str] = None, provider: Optional[str] = None, frozen: bool = False) -> Callable Decorator which extends the @dataclass in the following ways: 1. Adds the decorated class to the config store with reasonable defaults for name (class name) and provider (python package) 2. Adds the base type StructuredConfig to the class 3. Adds a class method get_store_args() which can be used to get the store location from the class. .. deprecated:: Use :func:`hydra_zen.builds` and :func:`hydra_zen.store` instead:: from hydra_zen import builds from scaffold.conf import scaffold_store MyConf = builds(MyClass, arg=value) scaffold_store(MyConf, group="my/group", name="MyConf") This decorator will be removed in a future release. NOTE: The decorated class is only registered, if the module containing it is imported! Example: .. code-block:: python @structured_config class MyRootConfig(): ... @structured_config(group="my/group") class MyGroupConfig(): ... :param name: Name of the config node. By default the class.__name__. :type name: Optional[str] :param group: Config group, subgroup separator is '/'. If None, will be placed in the root. :type group: Optional[str] :param package: Config package, which specifies where the config is applied. By default, this is derived from the group ("my/group" -> my.group) :type package: Optional[str] :param provider: The name of the module/app providing this config. Helps debugging. By default this is set to the python module of the structured_config. :type provider: Optional[str] :param frozen: Whether the dataclass should be read only. :type frozen: Optional[bool] :returns: Class decorator. .. py:data:: CONFIG_STORE