DataIdMatch

class lsst.pipe.base.tests.mocks.DataIdMatch(expression: str)

Bases: object

Class that can match DataId against the user-defined string expression.

Parameters:
expressionstr

User-defined expression, supports syntax defined by daf_butler expression parser. Maps identifiers in the expression to the values of DataId.

Methods Summary

match(dataId)

Match DataId contents against the expression.

Methods Documentation

match(dataId: DataCoordinate | Mapping[str, Any]) bool

Match DataId contents against the expression.

Parameters:
dataIdDataId

DataId that is matched against an expression.

Returns:
matchbool

Result of expression evaluation.

Raises:
KeyError

Raised when identifier in expression is not defined for given DataId.

TypeError

Raised when expression evaluates to a non-boolean type or when operation in expression cannot be performed on operand types.

NotImplementedError

Raised when expression includes valid but unsupported syntax, e.g. function call.