DatasetTypeRestriction¶
-
class
lsst.daf.butler.registry.wildcards.DatasetTypeRestriction(names: Union[FrozenSet[str], ellipsis])¶ Bases:
objectAn immutable set-like object that represents a restriction on the dataset types to search for within a collection.
The
fromExpressionmethod 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).Parameters: Notes
This class does not inherit from
collections.abc.Set(and does not implement the full set interface) because is not always iterable and sometimes has no length (i.e. whennamesis...).Attributes Summary
anyA special DatasetTypeRestrictioninstance that permits any dataset type.namesThe names of the dataset types included (i.e. Methods Summary
fromExpression(expression)Process a general expression to construct a DatasetTypeRestrictioninstance.union(*args)Merge one or more DatasetTypeRestrictioninstances, returning one that allows any of the dataset types included in any of them.Attributes Documentation
-
any= DatasetTypeRestriction(...)¶ A special
DatasetTypeRestrictioninstance that permits any dataset type.This instance should be preferred instead of constructing a new one with
..., when possible, but it should not be assumed to be the only such instance (i.e. don’t useisinstead of==for comparisons).
-
names¶ The names of the dataset types included (i.e. permitted) by the restriction, or the special value
...to permit all dataset types (frozenset[str] or...).
Methods Documentation
-
classmethod
fromExpression(expression: Any) → lsst.daf.butler.registry.wildcards.DatasetTypeRestriction¶ Process a general expression to construct a
DatasetTypeRestrictioninstance.Parameters: - expression
- May be:
- a
DatasetTypeinstance; - a
strdataset type name; - any non-mapping iterable containing either of the above;
- the special value
; - another
DatasetTypeRestrictioninstance (passed through unchanged).
- a
Returns: - restriction :
DatasetTypeRestriction A
DatasetTypeRestrictioninstance.
-
static
union(*args) → lsst.daf.butler.registry.wildcards.DatasetTypeRestriction¶ Merge one or more
DatasetTypeRestrictioninstances, returning one that allows any of the dataset types included in any of them.Parameters: - args
Positional arguments are
DatasetTypeRestrictioninstances.
-