lsst.pipe.base  21.0.0-16-g0fb55c1+0a61ef3a55
Public Member Functions | Public Attributes | List of all members
lsst.pipe.base.configOverrides.ConfigExpressionParser Class Reference
Inheritance diagram for lsst.pipe.base.configOverrides.ConfigExpressionParser:

Public Member Functions

def __init__ (self, namespace)
 
def visit_Name (self, node)
 
def visit_List (self, node)
 
def visit_Tuple (self, node)
 
def visit_Constant (self, node)
 
def visit_Dict (self, node)
 
def visit_Set (self, node)
 
def visit_UnaryOp (self, node)
 
def generic_visit (self, node)
 

Public Attributes

 variables
 

Detailed Description

An expression parser that will be used to transform configuration
strings supplied from the command line or a pipeline into a python
object.

This is roughly equivalent to ast.literal_parser, but with the ability to
transform strings that are valid variable names into the value associated
with the name. Variables that should be considered valid are supplied to
the constructor as a dictionary that maps a string to its corresponding
value.

This class in an internal implementation detail, and should not be exposed
outside this module.

Parameters
----------
namespace : `dict` of `str` to variable
    This is a mapping of strings corresponding to variable names, to the
    object that is associated with that name

Definition at line 38 of file configOverrides.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.__init__ (   self,
  namespace 
)

Definition at line 59 of file configOverrides.py.

Member Function Documentation

◆ generic_visit()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.generic_visit (   self,
  node 
)
This method is called for all other node types. It will just raise
a value error, because this is a type of expression that we do not
support.

Definition at line 113 of file configOverrides.py.

◆ visit_Constant()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_Constant (   self,
  node 
)
This method is visited if the node is a constant

Definition at line 86 of file configOverrides.py.

◆ visit_Dict()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_Dict (   self,
  node 
)
This method is visited if the node is a dict. It builds a dict out
of the component nodes.

Definition at line 91 of file configOverrides.py.

◆ visit_List()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_List (   self,
  node 
)
This method is visited if the node is a list. Constructs a list out
of the sub nodes.

Definition at line 74 of file configOverrides.py.

◆ visit_Name()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_Name (   self,
  node 
)
This method gets called when the parser has determined a node
corresponds to a variable name.

Definition at line 62 of file configOverrides.py.

◆ visit_Set()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_Set (   self,
  node 
)
This method is visited if the node is a set. It builds a set out
of the component nodes.

Definition at line 97 of file configOverrides.py.

◆ visit_Tuple()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_Tuple (   self,
  node 
)
This method is visited if the node is a tuple. Constructs a list out
of the sub nodes, and then turns it into a tuple.

Definition at line 80 of file configOverrides.py.

◆ visit_UnaryOp()

def lsst.pipe.base.configOverrides.ConfigExpressionParser.visit_UnaryOp (   self,
  node 
)
This method is visited if the node is a unary operator. Currently
The only operator we support is the negative (-) operator, all others
are passed to generic_visit method.

Definition at line 103 of file configOverrides.py.

Member Data Documentation

◆ variables

lsst.pipe.base.configOverrides.ConfigExpressionParser.variables

Definition at line 60 of file configOverrides.py.


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