ExpressionFactory¶
- class lsst.daf.butler.queries.expression_factory.ExpressionFactory(universe: DimensionUniverse)¶
Bases:
object
A factory for creating column expressions that uses operator overloading to form a mini-language.
Instances of this class are usually obtained from
Query.expression_factory
; see that property’s documentation for more information.- Parameters:
- universe
DimensionUniverse
Object that describes all dimensions.
- universe
Methods Summary
all
(first, /, *args)Combine a sequence of boolean expressions with logical AND.
any
(first, /, *args)Combine a sequence of boolean expressions with logical OR.
literal
(value)Return an expression proxy that represents a literal value.
not_
(operand)Apply a logical NOT operation to a boolean expression.
unwrap
(proxy)Return the column expression object that backs a proxy.
Methods Documentation
- all(first: Predicate, /, *args: Predicate) Predicate ¶
Combine a sequence of boolean expressions with logical AND.
- any(first: Predicate, /, *args: Predicate) Predicate ¶
Combine a sequence of boolean expressions with logical OR.
- static literal(value: object) ExpressionProxy ¶
Return an expression proxy that represents a literal value.
Expression proxy objects obtained from this factory can generally be compared directly to literals, so calling this method directly in user code should rarely be necessary.
- Parameters:
- value
object
Value to include as a literal in an expression tree.
- value
- Returns:
- expression
ExpressionProxy
Expression wrapper for this literal.
- expression
- not_(operand: Predicate) Predicate ¶
Apply a logical NOT operation to a boolean expression.
- Parameters:
- operand
tree.Predicate
Expression to invetree.
- operand
- Returns:
- logical_not
tree.Predicate
A boolean expression that evaluates to the opposite of
operand
.
- logical_not
- static unwrap(proxy: ExpressionProxy) IntColumnLiteral | StringColumnLiteral | FloatColumnLiteral | HashColumnLiteral | UUIDColumnLiteral | DateTimeColumnLiteral | TimespanColumnLiteral | RegionColumnLiteral | DimensionKeyReference | DimensionFieldReference | DatasetFieldReference | UnaryExpression | BinaryExpression ¶
Return the column expression object that backs a proxy.
- Parameters:
- proxy
ExpressionProxy
Proxy constructed via an
ExpressionFactory
.
- proxy
- Returns:
- expression
tree.ColumnExpression
Underlying column expression object.
- expression