CollectionWildcard¶
- 
class lsst.daf.butler.registry.wildcards.CollectionWildcard(strings: tuple = (), patterns: tuple[re.Pattern, ...] | ellipsis[tuple, ellipsis] = Ellipsis)¶
- Bases: - object- A validated wildcard for collection names - The - from_expressionmethod 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).- Notes - CollectionWildcardis expected to be rarely used outside of- Registry(which uses it to back several of its “query” methods that take general expressions for collections), but it may occasionally be useful outside- Registryas a way to preprocess expressions that contain single-pass iterators into a form that can be used to call those- Registrymethods multiple times.- Attributes Summary - patterns- Regular expression patterns to match against collection names, or the special value - ...indicating all collections.- strings- An an ordered list of explicitly-named collections. - Methods Summary - from_expression(expression, require_ordered)- Process a general expression to construct a - CollectionWildcardinstance.- from_names(names)- Construct from an iterable of explicit collection names. - require_ordered()- Require that this wildcard contains no patterns, and return the ordered tuple of names that it does hold. - Attributes Documentation - 
patterns= Ellipsis¶
- Regular expression patterns to match against collection names, or the special value - ...indicating all collections.- must be accompanied by- strings=().
 - Methods Documentation - 
classmethod from_expression(expression: Any, require_ordered: bool = False) → lsst.daf.butler.registry.wildcards.CollectionWildcard¶
- Process a general expression to construct a - CollectionWildcardinstance.- Parameters: - expression
- May be:
- a strcollection name;
- an re.Patterninstance to match (withre.Pattern.fullmatch) against collection names;
- any iterable containing any of the above;
- another CollectionWildcardinstance (passed through unchanged).
 
- a 
 - Duplicate collection names will be removed (preserving the first appearance of each collection name). 
- require_ordered : bool, optional
- If - True(- Falseis default) require the expression to be ordered, and raise- CollectionExpressionErrorif it is not.
 - Returns: - wildcard : CollectionWildcard
- A - CollectionWildcardinstance.
 - Raises: - CollectionExpressionError
- Raised if the patterns has regular expression, glob patterns, or the - ...wildcard, and- require_ordered=True.
 
 - 
classmethod from_names(names: collections.abc.Iterable[str]) → lsst.daf.butler.registry.wildcards.CollectionWildcard¶
- Construct from an iterable of explicit collection names. - Parameters: - names : Iterable[str]
- Iterable of collection names. 
 - Returns: - wildcard : ~CollectionWildcard`
- A - CollectionWildcardinstance.- require_orderedis guaranteed to succeed and return the given names in order.
 
- names : 
 - 
require_ordered() → tuple¶
- Require that this wildcard contains no patterns, and return the ordered tuple of names that it does hold. - Returns: - Raises: - CollectionExpressionError
- Raised if the patterns has regular expression, glob patterns, or the - ...wildcard.
 
 
-