skyllh.scripting package
Submodules
skyllh.scripting.argparser module
This module contains utility functions for the argument parser of an analysis script.
- skyllh.scripting.argparser.create_argparser(description: str | None = None, options: bool | dict | None = True) ArgumentParser
Creates an argparser with the given description and adds common options useful for analysis scripts.
- Parameters:
description – The description for the argparser.
options – If set to None or False, no options will be added. If set to True, all common analysis script options will be added. If set to a dictionary, individual options can be turned on and off. See the
add_argparser_options()for possible options. Default isTrue.
- Returns:
An instance of ArgumentParser with the given description and options.
- skyllh.scripting.argparser.add_argparser_options(parser: ArgumentParser, config: bool = True, data_basepath: bool = True, debug_logfile: bool = True, enable_tracing: bool = True, n_cpu: bool = True, seed: bool = True) None
Adds common argparser options to the given argparser instance, useful for analysis scripts.
- Parameters:
parser – The instance of ArgumentParser to which options should get added.
config – If set to
True, the--configoption of typestrwill be added. It specifies the configuration file. The default value isNone. The option destination isconfig.data_basepath – If set to
True, the--data-basepathoption of typestrwill be added. It specifies the base path to the data samples. The default value isNone. The option destination isdata_basepath.debug_logfile – If set to
True, the--debug-logfileoption of typestrwill be added. If notNone, it specifies the log file for dubug information. The default value isNone. The option destination isdebug_logfile.enable_tracing – If set to
True, the--enable-tracingoption of typeboolwill be added. If specified, enables the logging on the tracing level, i.e. a lot of DEBUG messages. The default value isFalse. The option destination isenable_tracing.n_cpu – If set to
True, the--n-cpuoption of typeintwill be added. It specifies the number of CPUs to utilize where parallelization is possible. The default value is1. The option destination isn_cpu.seed – If set to
True, the--seedoption of typeintwill be added. It specifies the seed for the random number generator. The default value is0. The option destination isseed.