DatasetTypeWildcard

class lsst.daf.butler.registry.wildcards.DatasetTypeWildcard(values: collections.abc.Mapping[str, lsst.daf.butler.core.datasets.type.DatasetType | None[lsst.daf.butler.core.datasets.type.DatasetType, None]] = <factory>, patterns: tuple[re.Pattern, ...] | ellipsis[tuple, ellipsis] = Ellipsis)

Bases: object

A validated expression that resolves to one or more dataset types.

The from_expression method should almost always be used to construct instances, as the regular constructor performs no checking of inputs (and that can lead to confusing error messages downstream).

Attributes Summary

patterns Regular expressions to be matched against dataset type names, or the special value ... indicating all dataset types.

Methods Summary

from_expression(expression) Construct an instance by analyzing the given expression.

Attributes Documentation

patterns = Ellipsis

Regular expressions to be matched against dataset type names, or the special value ... indicating all dataset types.

Any pattern matching a dataset type is considered an overall match for the expression.

Methods Documentation

classmethod from_expression(expression: Any) → lsst.daf.butler.registry.wildcards.DatasetTypeWildcard

Construct an instance by analyzing the given expression.

Parameters:
expression

Expression to analyze. May be any of the following:

  • a str dataset type name;
  • a DatasetType instance;
  • a re.Pattern to match against dataset type names;
  • an iterable whose elements may be any of the above (any dataset type matching any element in the list is an overall match);
  • an existing DatasetTypeWildcard instance;
  • the special ... ellipsis object, which matches any dataset type.
Returns:
query : DatasetTypeWildcard

An instance of this class (new unless an existing instance was passed in).

Raises:
DatasetTypeExpressionError

Raised if the given expression does not have one of the allowed types.