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
|
argparse action callback to process a data ID into a dict More...
Public Member Functions | |
def | __call__ |
Parse –id data and append results to namespace. More... | |
argparse action callback to process a data ID into a dict
Definition at line 659 of file argumentParser.py.
def lsst.pipe.base.argumentParser.IdValueAction.__call__ | ( | self, | |
parser, | |||
namespace, | |||
values, | |||
option_string | |||
) |
Parse –id data and append results to namespace.
<argument>.idList
[in] | parser | argument parser (instance of ArgumentParser) |
[in,out] | namespace | parsed command (an instance of argparse.Namespace); updated values:
|
[in] | values | a list of data IDs; see data format below |
[in] | option_string | option value specified by the user (a str) |
The data format is: key1=value1_1[^value1_2[^value1_3...] key2=value2_1[^value2_2[^value2_3...]...
The values (e.g. value1_1) may either be a string, or of the form "int..int" (e.g. "1..3") which is interpreted as "1^2^3" (inclusive, unlike a python range). So "0^2..4^7..9" is equivalent to "0^2^3^4^7^8^9". You may also specify a stride: "1..5:2" is "1^3^5"
The cross product is computed for keys with multiple values. For example: –id visit 1^2 ccd 1,1^2,2 results in the following data ID dicts being appended to namespace.<argument>.idList: {"visit":1, "ccd":"1,1"} {"visit":2, "ccd":"1,1"} {"visit":1, "ccd":"2,2"} {"visit":2, "ccd":"2,2"}
Definition at line 662 of file argumentParser.py.