Constraints

class lsst.daf.butler.Constraints(config: Optional[Union[ConstraintsConfig, str]], *, universe: DimensionUniverse)

Bases: object

Determine whether an entity is allowed to be handled.

Supported entities are DatasetRef, DatasetType, or StorageClass.

Parameters:
configConstraintsConfig or str

Load configuration. If None then this is equivalent to having no restrictions.

universeDimensionUniverse

The set of all known dimensions, used to normalize any lookup keys involving dimensions.

Attributes Summary

matchAllKey

Configuration key associated with matching everything.

Methods Summary

getLookupKeys()

Retrieve the look up keys for all the constraints entries.

isAcceptable(entity)

Check whether the supplied entity will be acceptable.

Attributes Documentation

matchAllKey = LookupKey(name='all',)

Configuration key associated with matching everything.

Methods Documentation

getLookupKeys() Set[LookupKey]

Retrieve the look up keys for all the constraints entries.

Returns:
keysset of LookupKey

The keys available for determining constraints. Does not include the special “all” lookup key.

isAcceptable(entity: Union[DatasetRef, DatasetType, StorageClass]) bool

Check whether the supplied entity will be acceptable.

Parameters:
entityDatasetType, DatasetRef, or StorageClass

Instance to use to look in constraints table. The entity itself reports the LookupKey that is relevant.

Returns:
allowedbool

True if the entity is allowed.