IndexedTupleDict

class lsst.daf.butler.IndexedTupleDict(indices: lsst.daf.butler.core.named.NamedKeyDict[~K, int][K, int], values: Tuple[V, ...])

Bases: lsst.daf.butler.NamedKeyMapping

An immutable mapping that combines a tuple of values with a (possibly shared) mapping from key to tuple index.

Parameters:
indices: `NamedKeyDict`

Mapping from key to integer index in the values tuple. This mapping is used as-is, not copied or converted to a true dict, which means that the caller must guarantee that it will not be modified by other (shared) owners in the future. The caller is also responsible for guaranteeing that the indices in the mapping are all valid for the given tuple.

values: `tuple`

Tuple of values for the dictionary. This may have a length greater than the length of indices; these values are not considered part of the mapping.

Attributes Summary

names The set of names associated with the keys, in the same order (AbstractSet [ str ]).

Methods Summary

byName() Return a Mapping with names as keys and the same values as self.
get(k[,d])
items()
keys()
values()

Attributes Documentation

names

The set of names associated with the keys, in the same order (AbstractSet [ str ]).

Methods Documentation

byName() → Dict[str, V]

Return a Mapping with names as keys and the same values as self.

Returns:
dictionary : dict

A dictionary with the same values (and iteration order) as self, with str names as keys. This is always a new object, not a view.

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
values() → an object providing a view on D's values