src.config package

Submodules

src.config.parser module

Generally unused older config scheme. If possible DO NOT USE.

src.config.parser.read_config(path, schema)

Read configuration file from path :param path: Relative path to the yaml config file. :type path: str :param schema: Strictyaml validator :type schema: sl.validator

src.config.schema module

Store schema from older config system. DO NOT USE.

src.config.yamlize module

New auto-config system, to make easy configuration management.

class src.config.yamlize.ConfigurableDict(**kwargs)

Bases: dict

Dict specification for nested config files.

config: dict
name: str
class src.config.yamlize.NameToSourcePath(value)

Bases: Enum

Map Enum from name to source path location.

Parameters

Enum (str) – Path to import class from.

agent = 'src.agents'
buffer = 'src.buffers'
encoder = 'src.encoders'
logger = 'src.loggers'
network = 'src.networks'
planner = 'src.agents.petsplanners'
runner = 'src.runners'
src.config.yamlize.create_configurable(config_yaml, name_to_path)

Create configurable object from config file path and source location

Parameters
  • config_yaml (str) – Config yaml location

  • name_to_path (NameToSourcePath) – Map from class type to source location

Returns

Instantiated object.

Return type

object

src.config.yamlize.create_configurable_from_dict(config_dict, name_to_path)

Create configurable object from config dict and soruce location

Parameters
  • config_dict (dict) – Config dict

  • name_to_path (NameToSourcePath) – Map from class type to source location

Returns

Instantiated object.

Return type

object

src.config.yamlize.yamlize(configurable_class)

Class decorator for configuration. See any of the configurable classes for more.

Parameters

configurable_class (type) – Some class to add configuration parameters to.

Module contents