Config parser module

This module provides a config for all mldev components

See _MLDevSettings for documentation on MLDevSettings class

class _MLDevSettings(config_path=None, raise_deps=False)[исходный код]

Contains mldev configuration for the experiment.

The following are the sources of the configuration:

  • config.yaml or compatible file, see docs for more details.

  • current environment variables

MLDevSettings looks for the config file until it is found in the following places:

  • config_path parameter for constructor

  • env var MLDEV_CONFIG_PATH

  • ./.mldev/config.yaml

  • <user_home>/.config/mldev/config.yaml

Configuration parameters can be retrieved with MLDevSettings().get_value(name)

Important environ parameters that are added automatically:

  • LOG_LEVEL is the current log level as defined by logging module

  • TOOL_DIR is the MLDev location

ALL_EXTRAS = {'base': 'mldev.experiment_objects', 'bot': 'mldev_bot.bot_service', 'controller': 'mldev_controller.controller_service', 'dvc': 'mldev_dvc.dvc_stage', 'ipython': 'mldev_jupyter.ipython', 'tensorboard': 'mldev_tensorboard.tensorboard_service'}
DEFAULT_EXTRAS = {'base': 'mldev.experiment_objects'}
default_config_path()[исходный код]

Returns current path to config.yaml for mldev :return: path to config

get_extra(name)[исходный код]

Retrieves a path to the module defining the extra

Параметры:

name

Результат:

get_extra_base(name)[исходный код]

Retrieves a top-level package name for the extra

Параметры:

name

Результат:

get_value(name)[исходный код]

Get a parameter from the environ config section. :param name: :return:

is_extra(name)[исходный код]

Checks if an extra feature is defined for this experiment

Параметры:

name

Результат:

is_feature(name)[исходный код]

Checks if an environ parameter is set to True

Параметры:

name

Результат:

set_feature(name, value)[исходный код]

Enables/disables the feature in environ. For bool(True/False) sets string True/False

Параметры:
  • name

  • value

Результат:

set_value(name, value)[исходный код]

Update a parameter from the environ config section :param name: :param value: :return:

class _SingletonWrapper[исходный код]
__call__(*args, **kwargs)[исходный код]

Call self as a function.

__dict__ = mappingproxy({'__module__': 'mldev_config_parser.config_parser', '__init__': <function _SingletonWrapper.__init__>, 'forget': <function _SingletonWrapper.forget>, '__call__': <function _SingletonWrapper.__call__>, '__dict__': <attribute '__dict__' of '_SingletonWrapper' objects>, '__weakref__': <attribute '__weakref__' of '_SingletonWrapper' objects>, '__doc__': None, '__annotations__': {}})
__init__(cls)[исходный код]
__module__ = 'mldev_config_parser.config_parser'
__weakref__

list of weak references to the object (if defined)

forget()[исходный код]

Purges current instance. A new instance is created on the next „“__call__““ :return: