core.config#
The Config class initializes and parses configurations for all other steps. It supports CLI argument parsing, loading from YAML file, and overrides to allow flexible setup in various environments.
Module Contents#
- core.config.EMPTY_CONFIG#
- class core.config.DefaultValidatingParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)#
Bases:
argparse.ArgumentParserObject for parsing command line strings into Python objects.
- Keyword Arguments:
(default (- usage -- A usage message) –
os.path.basename(sys.argv[0]))(default – auto-generated from arguments)
does (- description -- A description of what the program)
descriptions (- epilog -- Text following the argument)
one (- parents -- Parsers whose arguments should be copied into this)
messages (- formatter_class -- HelpFormatter class for printing help)
arguments (- argument_default -- The default value for all)
containing (- fromfile_prefix_chars -- Characters that prefix files) – additional arguments
arguments
conflicts (- conflict_handler -- String indicating how to handle)
option (- add_help -- Add a -h/-help)
unambiguously (- allow_abbrev -- Allow long options to be abbreviated)
with (- exit_on_error -- Determines whether or not ArgumentParser exits) – error info when an error occurs
- error(message)#
Override of error to format a nicer looking error message using logger
- parse_known_args(args=None, namespace=None)#
Override of parse_known_args to also check the ‘defaults’ values - which are passed in from the config file
- core.config.to_dot_notation(yaml_conf: ruamel.yaml.CommentedMap | dict) dict#
- core.config.from_dot_notation(dotdict: dict) dict#
- core.config.is_list_type(value)#
- core.config.is_dict_type(value)#
- core.config.merge_dicts(dotdict: dict, yaml_dict: ruamel.yaml.CommentedMap) ruamel.yaml.CommentedMap#
- core.config.read_yaml(yaml_filename: str) ruamel.yaml.CommentedMap#
- core.config.store_yaml(config: ruamel.yaml.CommentedMap, yaml_filename: str) None#