Predicate¶
- class lsst.daf.relation.Predicate¶
- Bases: - ABC- An abstract base class and factory for boolean column expressions. - Predicateinheritance is closed to the types already provided by this package, but considerable custom behavior can still be provided via the- PredicateFunctionclass and an- Enginethat knows how to interpret its- namevalue. These concrete types can all be constructed via factory methods on- Predicateitself,- ColumnExpression, or- ColumnContainer, so the derived types themselves only need to be referenced when writing- matchexpressions that process an expression tree. See Extensibility for rationale and details.- Attributes Summary - Methods Summary - Attempt to simplify this expression into a constant boolean. - is_supported_by(engine)- Test whether the given engine is capable of evaluating this expression. - literal(value)- Construct a boolean expression that is a constant - Trueor- False.- Return a boolean expression that is the logical AND of the given ones. - Return a boolean expression that is the logical NOT of this one. - Return a boolean expression that is the logical OR of the given ones. - reference(tag)- Construct an expression that refers to a boolean column in a relation. - Attributes Documentation - columns_required¶
- Columns required by this expression ( - Set[- ColumnTag]).- This includes columns required by expressions nested within this one. 
 - Methods Documentation - abstract is_supported_by(engine: Engine) bool¶
- Test whether the given engine is capable of evaluating this expression. 
 - classmethod literal(value: bool) PredicateLiteral¶
- Construct a boolean expression that is a constant - Trueor- False.- Parameters:
- valuebool
- Value for the expression. 
 
- value
- Returns:
- literalPredicateLiteral
- A boolean column expression set to the given value. 
 
- literal
 
 - logical_and() Predicate¶
- Return a boolean expression that is the logical AND of the given ones. - Parameters:
- *operandsPredicate
- Existing boolean expressions to AND together. 
 
- *operands
- Returns:
- logical_andPredicate
- Logical AND expression. If no operands are provided, a - PredicateLiteralfor- Trueis returned. If one operand is provided, it is returned directly.
 
- logical_and
 
 - logical_not() LogicalNot¶
- Return a boolean expression that is the logical NOT of this one. - Returns:
- logical_notPredicate
- Logical NOT expression. 
 
- logical_not
 
 - logical_or() Predicate¶
- Return a boolean expression that is the logical OR of the given ones. - Parameters:
- *operandsPredicate
- Existing boolean expressions to OR together. 
 
- *operands
- Returns:
- logical_andPredicate
- Logical OR expression. If no operands are provided, a - PredicateLiteralfor- Falseis returned. If one operand is provided, it is returned directly.
 
- logical_and
 
 - classmethod reference(tag: ColumnTag) PredicateReference¶
- Construct an expression that refers to a boolean column in a relation. - Parameters:
- tagColumnTag
- Identifier for the column to reference. 
 
- tag
- Returns:
- referencePredicateReference
- A column expression that refers the given relation column. 
 
- reference