lsst.pipe.tasks gbbe75d3d81+f128b91f83
Loading...
Searching...
No Matches
Classes | Functions | Variables
lsst.pipe.tasks.dataFrameActions._evalColumnExpression Namespace Reference

Classes

class  ExpressionParser
 

Functions

Type[DataFrameActionmakeColumnExpressionAction (str className, str expr, Optional[Mapping[str, Union[DataFrameAction, Type[DataFrameAction]]]] exprDefaults=None, str docstring=None)
 

Variables

dictionary OPERATORS
 
dictionary EXTRA_MATH = {"cos": cos, "sin": sin, "cosh": cosh, "sinh": sinh, "log": log}
 

Function Documentation

◆ makeColumnExpressionAction()

Type[DataFrameAction] lsst.pipe.tasks.dataFrameActions._evalColumnExpression.makeColumnExpressionAction ( str  className,
str  expr,
Optional[Mapping[str, Union[DataFrameAction, Type[DataFrameAction]]]]   exprDefaults = None,
str   docstring = None 
)
Factory function for producing ConfigurableAction classes which are
realizations of arithmetic operations.

Parameters
----------
className : `str`
    The name of the class that will be produced
expr : `str`
    An arithmetic expression that will be parsed to produce the output
    ConfigurableAction. Individual variable names will be the name of
    individual `ConfigActions` inside the expression (i.e. "x+y" will
    produce an action with configAction.actions.x and
    configAction.actions.y). Expression can contain arithmatic python
    operators as well as; sin, cos, sinh, cosh, log (which is base 10).
exprDefaults : `Mapping` of `str` to `DataFrameAction` optional
    A mapping of strings which correspond to the names in the expression to
    values which are default `ConfigurableActions` to assign in the
    expression. If no default for a action is supplied `SingleColumnAction`
    is set as the default.
docstring : `str`
    A string that is assigned as the resulting classes docstring

Returns
-------
action : `Type` of `DataFrameAction`
    A `DataFrameAction` class that was programatically constructed from the
    input expression.

Definition at line 83 of file _evalColumnExpression.py.

Variable Documentation

◆ EXTRA_MATH

dictionary lsst.pipe.tasks.dataFrameActions._evalColumnExpression.EXTRA_MATH = {"cos": cos, "sin": sin, "cosh": cosh, "sinh": sinh, "log": log}

Definition at line 43 of file _evalColumnExpression.py.

◆ OPERATORS

dictionary lsst.pipe.tasks.dataFrameActions._evalColumnExpression.OPERATORS
Initial value:
1= {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul,
2 ast.Div: op.truediv, ast.Pow: op.pow, ast.BitXor: op.xor,
3 ast.USub: op.neg}

Definition at line 39 of file _evalColumnExpression.py.