BinaryOperation¶
- class lsst.daf.relation.BinaryOperation¶
- Bases: - ABC- An abstract base class for operations that act on a pair of relations. - See also - Notes - A - BinaryOperationrepresents the operation itself; the combination of an operation and the “lhs” and “rhs” relations it acts on to form a new relation is represented by the- BinaryOperationRelationclass, which should always be performed via a call to the- applymethod (or something that calls it, like the convenience methods on the- Relationclass). In many cases, applying a- BinaryOperationdoesn’t return something involving the original operation, because of some combination of defaulted-parameter population and simplification, and there are even some- BinaryOperationclasses that should never actually appear in a- BinaryOperationRelation.- BinaryOperationcannot be subclassed by external code.- All concrete - BinaryOperationtypes are frozen, equality-comparable- dataclasses. They also provide a very concise- strrepresentation (in addition to the dataclass-provided- repr) suitable for summarizing an entire relation tree.- Methods Summary - applied_columns(lhs, rhs)- Return the columns of the relation that results from applying this operation to the given targets. - applied_max_rows(lhs, rhs)- Return the maximum number of rows of the relation that results from applying this operation to the given target. - applied_min_rows(lhs, rhs)- Return the minimum number of rows of the relation that results from applying this operation to the given targets. - apply(lhs, rhs)- Create a new relation that represents the action of this operation on a pair of existing relations. - Methods Documentation - abstract applied_columns(lhs: Relation, rhs: Relation) Set[ColumnTag]¶
- Return the columns of the relation that results from applying this operation to the given targets. 
 - abstract applied_max_rows(lhs: Relation, rhs: Relation) int | None¶
- Return the maximum number of rows of the relation that results from applying this operation to the given target. 
 - abstract applied_min_rows(lhs: Relation, rhs: Relation) int¶
- Return the minimum number of rows of the relation that results from applying this operation to the given targets. 
 - final apply(lhs: Relation, rhs: Relation) Relation¶
- Create a new relation that represents the action of this operation on a pair of existing relations. - Parameters:
- Returns:
- new_relationRelation
- Relation that includes this operation. This may be - selfif the operation is a no-op, and it may not be a- BinaryOperationRelationholding this operation (or even a similar one) if the operation was inserted earlier in the tree via commutation relations.
 
- new_relation
- Raises:
- ColumnError
- Raised if the operation could not be applied due to problems with the target relations’ columns. 
- EngineError
- Raised if the operation could not be applied due to problems with the target relations’ engine(s).