src/orion/core/io/config.py
def add_option(
        self, key, option_type, default=NOT_SET, env_var=None, deprecate=None, help=None
    ):
        """Add a configuration setting.

        Parameters
        ----------
        key : str
            The name of the configuration setting. This must be a valid
            Python attribute name i.e. alphanumeric with underscores.
        option_type : function
            A function such as ``float``, ``int`` or ``str`` which takes
            the configuration value and returns an object of the correct
            type.  Note that the values retrieved from environment
            variables are always strings, while those retrieved from the
            YAML file might already be parsed. Hence, the function provided
            here must accept both types of input.
        default : object, optional
            The default configuration to return if not set. By default none
            is set and an error is raised instead.
        env_var : str, optional
            The environment variable name that holds this configuration
            value. If not given, this configuration can only be set in the
            YAML configuration file.
        deprecate: `dict`, optional
            Should define dict(version, alternative), version at which the deprecated option will be
            removed and alternative to use. A deprecation warning will be logged each time this
            option is set by user. The option `name` can be used in addition to `version` and
            `alternative` to provide a different name then the key. This is useful if the key
            is in a subconfiguration and we want the deprecation error message to include the full
            path. This will add (DEPRECATED) at the beginning of the help message.
        help : str, optionial
            Documentation for the option. Can be reused to build documentation
            or to build parsers with help messages.
            Default help message is 'Undocumented'.

        """
        key = _curate(key)
        if key in self._config or key in self._subconfigs:
            raise ValueError("Configuration already contains {}".format(key))
        self._config[key] = {"type": option_type}
        if env_var is not None:
            self._config[key]["env_var"] = env_var
        if default is not NOT_SET:
            self._config[key]["default"] = default
        if deprecate is not None:
            if "version" not in deprecate:
                raise ValueError(
                    f"`version` is missing in deprecate option: {deprecate}"
                )
            self._config[key]["deprecated"] = deprecate

        if help is None:
            help = "Undocumented"

        if default is not NOT_SET:
            help += " (default: {})".format(default)
        if deprecate is not None:
            help = "(DEPRECATED) " + help
        self._config[key]["help"] = help
Add a configuration setting.

        Parameters
        ----------
        key : str
            The name of the configuration setting. This must be a valid
            Python attribute name i.e. alphanumeric with underscores.
        option_type : function
            A function such as ``float``, ``int`` or ``str`` which takes
            the configuration value and returns an object of the correct
            type.  Note that the values retrieved from environment
            variables are always strings, while those retrieved from the
            YAML file might already be parsed. Hence, the function provided
            here must accept both types of input.
        default : object, optional
            The default configuration to return if not set. By default none
            is set and an error is raised instead.
        env_var : str, optional
            The environment variable name that holds this configuration
            value. If not given, this configuration can only be set in the
            YAML configuration file.
        deprecate: `dict`, optional
            Should define dict(version, alternative), version at which the deprecated option will be
            removed and alternative to use. A deprecation warning will be logged each time this
            option is set by user. The option `name` can be used in addition to `version` and
            `alternative` to provide a different name then the key. This is useful if the key
            is in a subconfiguration and we want the deprecation error message to include the full
            path. This will add (DEPRECATED) at the beginning of the help message.
        help : str, optionial
            Documentation for the option. Can be reused to build documentation
            or to build parsers with help messages.
            Default help message is 'Undocumented'.

        
Add a configuration setting.
Parameters

key : str
The name of the configuration setting. This must be a valid
Python attribute name i.e. alphanumeric with underscores.
Add a configuration setting . Parameters key : str The name of the configuration setting . This must be a valid Python attribute name i . e . alphanumeric with underscores .
def add_option(
        self, key, option_type, default=NOT_SET, env_var=None, deprecate=None, help=None
    ):
        key = _curate(key)
        if key in self._config or key in self._subconfigs:
            raise ValueError("Configuration already contains {}".format(key))
        self._config[key] = {"type": option_type}
        if env_var is not None:
            self._config[key]["env_var"] = env_var
        if default is not NOT_SET:
            self._config[key]["default"] = default
        if deprecate is not None:
            if "version" not in deprecate:
                raise ValueError(
                    f"`version` is missing in deprecate option: {deprecate}"
                )
            self._config[key]["deprecated"] = deprecate
        if help is None:
            help = "Undocumented"
        if default is not NOT_SET:
            help += " (default: {})".format(default)
        if deprecate is not None:
            help = "(DEPRECATED) " + help
        self._config[key]["help"] = help
def add_option ( self , key , option_type , default = NOT_SET , env_var = None , deprecate = None , help = None ) : key = _curate ( key ) if key in self . _config or key in self . _subconfigs : raise ValueError ( "Configuration already contains {}" . format ( key ) ) self . _config [ key ] = { "type" : option_type } if env_var is not None : self . _config [ key ] [ "env_var" ] = env_var if default is not NOT_SET : self . _config [ key ] [ "default" ] = default if deprecate is not None : if "version" not in deprecate : raise ValueError ( f"`version` is missing in deprecate option: {deprecate}" ) self . _config [ key ] [ "deprecated" ] = deprecate if help is None : help = "Undocumented" if default is not NOT_SET : help += " (default: {})" . format ( default ) if deprecate is not None : help = "(DEPRECATED) " + help self . _config [ key ] [ "help" ] = help
Add a configuration setting.
Add a configuration setting .
"""Add a configuration setting.

        Parameters
        ----------
        key : str
            The name of the configuration setting. This must be a valid
            Python attribute name i.e. alphanumeric with underscores.
        option_type : function
            A function such as ``float``, ``int`` or ``str`` which takes
            the configuration value and returns an object of the correct
            type.  Note that the values retrieved from environment
            variables are always strings, while those retrieved from the
            YAML file might already be parsed. Hence, the function provided
            here must accept both types of input.
        default : object, optional
            The default configuration to return if not set. By default none
            is set and an error is raised instead.
        env_var : str, optional
            The environment variable name that holds this configuration
            value. If not given, this configuration can only be set in the
            YAML configuration file.
        deprecate: `dict`, optional
            Should define dict(version, alternative), version at which the deprecated option will be
            removed and alternative to use. A deprecation warning will be logged each time this
            option is set by user. The option `name` can be used in addition to `version` and
            `alternative` to provide a different name then the key. This is useful if the key
            is in a subconfiguration and we want the deprecation error message to include the full
            path. This will add (DEPRECATED) at the beginning of the help message.
        help : str, optionial
            Documentation for the option. Can be reused to build documentation
            or to build parsers with help messages.
            Default help message is 'Undocumented'.

        """
self
key
option_type
default
env_var
deprecate
help