DatasetTypeWildcard

class lsst.daf.butler.registry.wildcards.DatasetTypeWildcard(values: ~collections.abc.Mapping[str, ~lsst.daf.butler._dataset_type.DatasetType | None] = <factory>, patterns: tuple[re.Pattern, ...] | 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: tuple[re.Pattern, ...] | ellipsis = 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) DatasetTypeWildcard

Construct an instance by analyzing the given expression.

Parameters:
expressionAny

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:
queryDatasetTypeWildcard

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.