LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
An argument parser for pipeline tasks that is based on argparse.ArgumentParser. More...
Public Member Functions | |
def | __init__ |
Construct an ArgumentParser. More... | |
def | add_id_argument |
Add a data ID argument. More... | |
def | parse_args |
Parse arguments for a pipeline task. More... | |
def | handleCamera |
Perform camera-specific operations before parsing the command line. More... | |
def | convert_arg_line_to_args |
Allow files of arguments referenced by @<path> to contain multiple values on each line. More... | |
Private Member Functions | |
def | _processDataIds |
Process the parsed data for each data ID argument. More... | |
def | _applyInitialOverrides |
Apply obs-package-specific and camera-specific config override files, if found. More... | |
Private Attributes | |
_name | |
_dataIdArgDict | |
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 196 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 207 of file argumentParser.py.
|
private |
Apply obs-package-specific and camera-specific config override files, if found.
[in] | namespace | parsed namespace (an argparse.Namespace); reads these attributes:
|
Look in the package namespace.obsPkg for files:
Definition at line 455 of file argumentParser.py.
|
private |
Process the parsed data for each data ID argument.
Processing includes:
[in,out] | namespace | parsed namespace (an argparse.Namespace); reads these attributes:
|
Definition at line 426 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 | name of name (including leading dashes, if wanted) |
[in] | datasetType | type of dataset; supply a string for a fixed dataset type, or a 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 264 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 492 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 479 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 pex_logging 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 313 of file argumentParser.py.
|
private |
Definition at line 215 of file argumentParser.py.
|
private |
Definition at line 214 of file argumentParser.py.