ExpressionFactory#
- class lsst.daf.butler.queries.expression_factory.ExpressionFactory(universe: DimensionUniverse)#
Bases:
objectA 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.
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.
Parameters#
- first
tree.Predicate First operand (required).
- *args
Additional operands.
Returns#
- logical_and
tree.Predicate A boolean expression that evaluates to
Trueonly if all operands evaluate to `True.
- first
- any(first: Predicate, /, *args: Predicate) Predicate#
Combine a sequence of boolean expressions with logical OR.
Parameters#
- first
tree.Predicate First operand (required).
- *args
Additional operands.
Returns#
- logical_or
tree.Predicate A boolean expression that evaluates to
Trueif any operand evaluates to `True.
- first
- 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.
Returns#
- expression
ExpressionProxy Expression wrapper for this literal.
- value
- not_(operand: Predicate) Predicate#
Apply a logical NOT operation to a boolean expression.
Parameters#
- operand
tree.Predicate Expression to invetree.
Returns#
- logical_not
tree.Predicate A boolean expression that evaluates to the opposite of
operand.
- operand
- static unwrap(proxy: ExpressionProxy) Annotated[IntColumnLiteral | StringColumnLiteral | FloatColumnLiteral | HashColumnLiteral | UUIDColumnLiteral | DateTimeColumnLiteral | TimespanColumnLiteral | RegionColumnLiteral | DimensionKeyReference | DimensionFieldReference | DatasetFieldReference | UnaryExpression | BinaryExpression, FieldInfo(annotation=NoneType, required=True, discriminator='expression_type')]#
Return the column expression object that backs a proxy.
Parameters#
- proxy
ExpressionProxy Proxy constructed via an
ExpressionFactory.
Returns#
- expression
tree.ColumnExpression Underlying column expression object.
- proxy
- universe