deepr.config.parse_config

deepr.config.parse_config(config, macros=None)[source]

Fill macro parameters and references in config from macros.

Example

>>> from deepr.config import parse_config
>>> config = {"x": "$params:x", "y": 2}
>>> macros = {"params": {"x": 1}}
>>> parse_config(config, macros)
{'x': 1, 'y': 2}
Parameters:
  • config (Dict) – Config dictionary

  • macros (Dict, optional) – Dictionary of macro parameters.

Returns:

Parsed Config, without macro parameters and references.

Return type:

Dict

Raises:

ValueError – If some macro parameter in config not found in macros. If some references not found.