lsst.obs.base  20.0.0-16-gd6747cf
Public Member Functions | Public Attributes | List of all members
lsst.obs.base.gen2to3.repoWalker.builders.BuilderSkipInput Class Reference
Inheritance diagram for lsst.obs.base.gen2to3.repoWalker.builders.BuilderSkipInput:
lsst.obs.base.gen2to3.repoWalker.builders.BuilderInput lsst.obs.base.gen2to3.repoWalker.builders.BuilderNode

Public Member Functions

def __init__ (self, str template, Dict[str, type] keys, Optional[str] message=None, *bool isForFiles=True)
 
PathElementHandler build (self, PathElementParser parser, Dict[str, type] allKeys, Dict[str, type] cumulativeKeys, *Optional[re.Pattern] fileIgnoreRegEx, Optional[re.Pattern] dirIgnoreRegEx)
 
Tuple[BuilderNode, List[str], bool] prune (self)
 

Public Attributes

 template
 
 keys
 
 elements
 

Detailed Description

An input to a `RepoWalker` that indicates that matched files should be
skipped, possibly with a warning message.

BuilderSkipInputs can be pruned.  When they are not pruned, they build
`SkipHandler` instances.

Parameters
----------
template : `str`
    The complete Gen2 template to be matched (not just the template for
    one path element).
keys : `dict` [`str`, `type`]
    A mapping from Gen2 data ID key to the type of its value.
message : `str`, optional
    If not `None`, a warning message that should be printed either when a
    matching file is enountered or a directory that may contain such files
    is skipped.
isForFiles : `bool`, optional
    If `True` (default), this handler should be run on files.  Otherwise it
    should be run on directories.

Definition at line 137 of file builders.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.base.gen2to3.repoWalker.builders.BuilderSkipInput.__init__ (   self,
str  template,
Dict[str, type]  keys,
Optional[str]   message = None,
*bool   isForFiles = True 
)

Definition at line 159 of file builders.py.

Member Function Documentation

◆ build()

PathElementHandler lsst.obs.base.gen2to3.repoWalker.builders.BuilderSkipInput.build (   self,
PathElementParser  parser,
Dict[str, type]  allKeys,
Dict[str, type]  cumulativeKeys,
*Optional[re.Pattern]  fileIgnoreRegEx,
Optional[re.Pattern]   dirIgnoreRegEx 
)
Transform this node in the build tree into a corresponding
`PathElementHandler`, recursing to any children.

Must be called after `prune`.

Parameters
----------
parser : `PathElementParser`
    An object that matches the path element the new handler is
    responsible for and extracts a (partial) Gen2 data ID from it.
allKeys : `dict` [`str`, `type`]
    A mapping from Gen2 data ID key to the type of its value.  Will
    contain all keys that may be extracted by the given parser, and
    possibly others.
cumulativeKeys : `dict` [`str`, `type`], optional
    A dictionary containing key strings and types for Gen2 data ID keys
    that have been extracted from previous path elements for this
    template, including those extracted by ``parser``.

Returns
-------
handler : `PathElementHandler`
    A new handler object.

Reimplemented from lsst.obs.base.gen2to3.repoWalker.builders.BuilderNode.

Definition at line 165 of file builders.py.

◆ prune()

Tuple[BuilderNode, List[str], bool] lsst.obs.base.gen2to3.repoWalker.builders.BuilderSkipInput.prune (   self)
Attempt to prune this node and its children from the tree.

Returns
-------
replacement : `BuilderNode`
    The result of recursively pruning child nodes; often just ``self``.
messages : `list` [`str`]
    Warning messages that should be logged by a parent node when a
    matching path element is encountered, if this node is pruned.
prune : `bool`
    If `True`, this node may be pruned from the tree (but will not
    necessarily be - it may correspond to a path element that should
    be skipped with siblings that should not be).

Reimplemented from lsst.obs.base.gen2to3.repoWalker.builders.BuilderNode.

Definition at line 171 of file builders.py.

Member Data Documentation

◆ elements

lsst.obs.base.gen2to3.repoWalker.builders.BuilderInput.elements
inherited

Definition at line 120 of file builders.py.

◆ keys

lsst.obs.base.gen2to3.repoWalker.builders.BuilderInput.keys
inherited

Definition at line 119 of file builders.py.

◆ template

lsst.obs.base.gen2to3.repoWalker.builders.BuilderInput.template
inherited

Definition at line 118 of file builders.py.


The documentation for this class was generated from the following file: