src/orion/core/io/config.py
def add_arguments(self, parser, rename=None):
        """Add arguments to an `argparse` parser based on configuration

        This does not support subconfigurations. They will be ignored.

        Parameters
        ----------
        parser: `argparse.ArgumentParser`
            Parser to which this function will add arguments
        rename: dict, optional
            Mappings to provide different commandline names. Ex `{key: --my-arg}`

        """
        if rename is None:
            rename = dict()

        for key in self._config:
            # TODO: Try with list and nargs='*', but it may case issues with
            # nargs=argparse.REMAINDER.
            if self._config[key]["type"] in (dict, list, tuple):
                continue

            # NOTE: Do not set default, if parser.parse_argv().options[key] is None, then code
            # should look to config[key].
            arg_name = rename.get(key, "--{}".format(key.replace("_", "-")))
            parser.add_argument(
                arg_name,
                type=self._config[key]["type"],
                help=self._config[key].get("help"),
            )
Add arguments to an `argparse` parser based on configuration

        This does not support subconfigurations. They will be ignored.

        Parameters
        ----------
        parser: `argparse.ArgumentParser`
            Parser to which this function will add arguments
        rename: dict, optional
            Mappings to provide different commandline names. Ex `{key: --my-arg}`

        
Add arguments to an `argparse` parser based on configuration
This does not support subconfigurations. They will be ignored.

Parameters

`argparse.ArgumentParser`
Parser to which this function will add arguments
rename: dict, optional
Mappings to provide different commandline names.
Add arguments to an ` argparse ` parser based on configuration This does not support subconfigurations . They will be ignored . Parameters ` argparse . ArgumentParser ` Parser to which this function will add arguments rename : dict optional Mappings to provide different commandline names .
def add_arguments(self, parser, rename=None):
        if rename is None:
            rename = dict()
        for key in self._config:
            if self._config[key]["type"] in (dict, list, tuple):
                continue
            arg_name = rename.get(key, "--{}".format(key.replace("_", "-")))
            parser.add_argument(
                arg_name,
                type=self._config[key]["type"],
                help=self._config[key].get("help"),
            )
def add_arguments ( self , parser , rename = None ) : if rename is None : rename = dict ( ) for key in self . _config : if self . _config [ key ] [ "type" ] in ( dict , list , tuple ) : continue arg_name = rename . get ( key , "--{}" . format ( key . replace ( "_" , "-" ) ) ) parser . add_argument ( arg_name , type = self . _config [ key ] [ "type" ] , help = self . _config [ key ] . get ( "help" ) , )
Add arguments to an `argparse` parser based on configuration
This does not support subconfigurations.
Add arguments to an ` argparse ` parser based on configuration This does not support subconfigurations .
"""Add arguments to an `argparse` parser based on configuration

        This does not support subconfigurations. They will be ignored.

        Parameters
        ----------
        parser: `argparse.ArgumentParser`
            Parser to which this function will add arguments
        rename: dict, optional
            Mappings to provide different commandline names. Ex `{key: --my-arg}`

        """ # TODO: Try with list and nargs='*', but it may case issues with # nargs=argparse.REMAINDER. # NOTE: Do not set default, if parser.parse_argv().options[key] is None, then code # should look to config[key].
self
parser
rename