DimensionKeyDict¶
- 
class lsst.daf.butler.DimensionKeyDict(other=None, *, universe=None, keys=None, factory=None, where=None)¶
- Bases: - collections.abc.Mapping- An immutable mapping that uses - DimensionElementinstances as keys.- Parameters: - other : Mapping
- Another mapping from which to copy keys and values. Keys that are string names will be converted into - DimensionElementinstances.
- universe : DimensionGraph, optional
- All known dimensions; must be provided if - keysis not a- DimensionGraphor- DimensionSetand- otheris not itself a- DimensionKeyDict.
- keys : iterable of DimensionElement, optional
- The exact keys that should be present in the constructed dictionary. If not provided, defaults to the keys in - other. If provided, keys in- otherthat are not in- keyswill be ignored, and keys missing from- otherwill associated with values constructed by calling- factory.
- factory : callable, optional
- A no-argument callable that should be used to construct values for keys not provided. 
- where : callable, optional
- A predicate taking a single - DimensionElementargument that indicates (by returning- True) whether a value for that element should be copied from- otheror (by returning- False) constructed by calling- factory. Passing- None(default) uses a callable that always returns- True.
 - Notes - As with most other operations involving dimension objects, string names can be used lieu of - DimensionElementinstances in lookup (- get,- __getitem__,- __contains__).- Because - DimensionKeyDictinstances are themselves immutable (in that new keys and values cannot be added, and the value associated with a key cannot be modified), they are frequently used to hold mutable values, such as- setor- dictobjects, giving them a specific and limited kind of overall mutability (sometimes referred to as “interior” mutability). This is particularly useful in the dimension system, where in many contexts the set of relevant dimensions cannot change but the information associated with them can.- Attributes Summary - universe- All known dimensions, including those not represented by this dict ( - DimensionGraph).- Methods Summary - get(k[,d])- items()- keys()- updateValues(other)- Update nested dictionaries or sets from those in another nested mapping. - values()- Attributes Documentation - 
universe¶
- All known dimensions, including those not represented by this dict ( - DimensionGraph).
 - Methods Documentation - 
get(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
 - 
items() → a set-like object providing a view on D's items¶
 - 
keys() → a set-like object providing a view on D's keys¶
 - 
updateValues(other)¶
- Update nested dictionaries or sets from those in another nested mapping. - Parameters: - other : Mapping
- Mapping containing values that should be used to update the corresponding values in - self. May have either- DimensionElementor- strnames (or both) as keys.
 - Returns: - missing : set
- Any keys present in - otherthat were not present in- self.
 - Notes - This method assumes the values of - selfare objects with an- updatemethod (such as- dictor- set), and that the values of- otherare appropriate arguments to those- updatemethods (i.e. typically also- dictor- set).
- other : 
 - 
values() → an object providing a view on D's values¶
 
- other :