lsst.pipe.base
13.0-12-gaf0c0ec+8
|
An argument parser for pipeline tasks that is based on argparse.ArgumentParser. More...
Public Member Functions | |
def | __init__ (self, name, usage="%(prog)s input [options]", kwargs) |
Construct an ArgumentParser. More... | |
def | add_id_argument (self, name, datasetType, help, level=None, doMakeDataRefList=True, ContainerClass=DataIdContainer) |
Add a data ID argument. More... | |
def | parse_args (self, config, args=None, log=None, override=None) |
Parse arguments for a pipeline task. More... | |
def | handleCamera (self, namespace) |
Perform camera-specific operations before parsing the command line. More... | |
def | convert_arg_line_to_args (self, arg_line) |
Allow files of arguments referenced by @<path> to contain multiple values on each line. More... | |
Static Public Attributes | |
bool | requireOutput = True |
An argument parser for pipeline tasks that is based on argparse.ArgumentParser.
Users may wish to add additional arguments before calling parse_args.
Definition at line 290 of file argumentParser.py.
def lsst.pipe.base.argumentParser.ArgumentParser.__init__ | ( | self, | |
name, | |||
usage = "%(prog)s input [options]" , |
|||
kwargs | |||
) |
Construct an ArgumentParser.
[in] | name | name of top-level task; used to identify camera-specific override files |
[in] | usage | usage string |
[in] | **kwargs | additional keyword arguments for argparse.ArgumentParser |
Definition at line 303 of file argumentParser.py.
def lsst.pipe.base.argumentParser.ArgumentParser.add_id_argument | ( | self, | |
name, | |||
datasetType, | |||
help, | |||
level = None , |
|||
doMakeDataRefList = True , |
|||
ContainerClass = DataIdContainer |
|||
) |
Add a data ID argument.
Add an argument to specify data IDs. If datasetType is an instance of DatasetArgument, then add a second argument to specify the dataset type.
[in] | name | data ID argument (including leading dashes, if wanted) |
[in] | datasetType | type of dataset; supply a string for a fixed dataset type, or a DynamicDatasetType, such as DatasetArgument, for a dynamically determined dataset type |
[in] | help | help string for the argument |
[in] | level | level of dataset, for butler |
[in] | doMakeDataRefList | construct data references? |
[in] | ContainerClass | data ID container class to use to contain results; override the default if you need a special means of computing data references from data IDs |
The associated data is put into namespace.<dataIdArgument.name> as an instance of ContainerClass; the container includes fields:
Definition at line 381 of file argumentParser.py.
def lsst.pipe.base.argumentParser.ArgumentParser.convert_arg_line_to_args | ( | self, | |
arg_line | |||
) |
Allow files of arguments referenced by @<path>
to contain multiple values on each line.
[in] | arg_line | line of text read from an argument file |
Definition at line 667 of file argumentParser.py.
def lsst.pipe.base.argumentParser.ArgumentParser.handleCamera | ( | self, | |
namespace | |||
) |
Perform camera-specific operations before parsing the command line.
The default implementation does nothing.
[in,out] | namespace | namespace (an argparse.Namespace) with the following fields:
|
Definition at line 654 of file argumentParser.py.
def lsst.pipe.base.argumentParser.ArgumentParser.parse_args | ( | self, | |
config, | |||
args = None , |
|||
log = None , |
|||
override = None |
|||
) |
Parse arguments for a pipeline task.
[in,out] | config | config for the task being run |
[in] | args | argument list; if None use sys.argv[1:] |
[in] | log | log (instance lsst.log Log); if None use the default log |
[in] | override | a config override function; it must take the root config object as its only argument and must modify the config in place. This function is called after camera-specific overrides files are applied, and before command-line config overrides are applied (thus allowing the user the final word). |
Definition at line 424 of file argumentParser.py.
|
static |
Definition at line 301 of file argumentParser.py.