|
lsst.obs.base
20.0.0-69-g8f355a9+701c885a11
|
Public Member Functions | |
| def | __init__ (self, str template, Dict[str, type] allKeys, *Optional[Dict[str, type]] previousKeys=None) |
| def | __str__ (self) |
| Optional[dict] | parse (self, str name, dict lastDataId, *Optional[Log] log=None) |
Public Attributes | |
| template | |
| keys | |
| regex | |
An object that matches Gen2 file names and extracts Gen2 data IDs.
Parameters
----------
target : `str`
Either a full Gen2 path template or the part of one the corresponds to
a single path element (a subdirectory or file name).
allKeys : `dict` [`str`, `type`]
A dictionary that provides types for all Gen2 data ID keys that are
substituted into the given template. Additional key-value pairs may
be present and will be ignored.
previousKeys : `dict` [`str`, `type`], optional
A dictionary containing key strings and types for Gen2 data ID keys
that have been extracted from previous path elements of the same
template. Values for these keys must be provided via the
``lastDataId`` argument when calling `parse`.
| def lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.__init__ | ( | self, | |
| str | template, | ||
| Dict[str, type] | allKeys, | ||
| *Optional[Dict[str, type]] | previousKeys = None |
||
| ) |
| def lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.__str__ | ( | self | ) |
| Optional[dict] lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.parse | ( | self, | |
| str | name, | ||
| dict | lastDataId, | ||
| *Optional[Log] | log = None |
||
| ) |
Parse the path element.
Parameters
----------
name : `str`
The path name to parse.
lastDataId : `dict`
The cumulative Gen2 data ID obtaining by calling `parse` on parsers
for parent directories of the same path.
log : `Log`, optional
Log to use to report warnings and debug information.
Returns
-------
dataId : `dict` or `None`
Gen2 data ID that combines key-value pairs obtained from this path
with those from ``lastDataId``. `None` if ``name`` is not matched
by this parser. If the keys extracted are inconsistent with those
in ``lastDataID``, a warning is sent to ``log`` and `None` is
returned.
| lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.keys |
| lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.regex |
| lsst.obs.base.gen2to3.repoWalker.parser.PathElementParser.template |
1.8.18