algotom.util.config

Functions:

class algotom.util.config.Params(sections=())[source]

Bases: object

add_arguments(parser)[source]
add_parser_args(parser)[source]
get_defaults()[source]
algotom.util.config.config_to_list(config_name='/home/docs/algotom.conf')[source]

Read arguments from config file and convert them to a list of keys and values as sys.argv does when they are specified on the command line. config_name is the file name of the config file.

algotom.util.config.get_config_name()[source]

Get the command line –config option.

algotom.util.config.log_values(args)[source]

Log all values set in the args namespace.

Arguments are grouped according to their section and logged alphabetically using the DEBUG log level thus –verbose is required.

algotom.util.config.parse_known_args(parser, subparser=False)[source]

Parse arguments from file and then override by the ones specified on the command line. Use parser for parsing and is subparser is True take into account that there is a value on the command line specifying the subparser.

algotom.util.config.show_config(args)[source]

Log all values set in the args namespace.

Arguments are grouped according to their section and logged alphabetically using the DEBUG log level thus –verbose is required.

algotom.util.config.write(config_file, args=None, sections=None)[source]

Write config_file with values from args if they are specified, otherwise use the defaults. If sections are specified, write values from args only to those sections, use the defaults on the remaining ones.