Constraints¶
-
class
lsst.daf.butler.
Constraints
(config, universe=None)¶ Bases:
object
Determine whether a
DatasetRef
,DatasetType
, orStorageClass
is allowed to be handled.Parameters: - config :
ConstraintsConfig
orstr
Load configuration. If
None
then this is equivalent to having no restrictions.- universe :
DimensionUniverse
, optional The set of all known dimensions. If not
None
, any look up keys involving dimensions will be normalized. Normalization only happens once.
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 to whatever this Constraints
class is associated with.normalizeDimensions
(universe)Normalize consraint lookups that use dimensions. Attributes Documentation
-
matchAllKey
= LookupKey(name='all',)¶ Configuration key associated with matching everything.
Methods Documentation
-
getLookupKeys
()¶ Retrieve the look up keys for all the constraints entries.
Returns:
-
isAcceptable
(entity)¶ Check whether the supplied entity will be acceptable to whatever this
Constraints
class is associated with.Parameters: - entity :
DatasetType
,DatasetRef
, orStorageClass
Instance to use to look in constraints table. The entity itself reports the
LookupKey
that is relevant.
Returns: - entity :
-
normalizeDimensions
(universe)¶ Normalize consraint lookups that use dimensions.
Parameters: - universe :
DimensionUniverse
The set of all known dimensions. If
None
, returns without action.
Raises: - ValueError
Raised if a key exists where a dimension is not part of the
universe
.
Notes
Goes through all constraint lookups, and for keys that include dimensions, rewrites those keys to use a verified set of dimensions.
Returns without action if the keys have already been normalized.
- universe :
- config :