IndexedTupleDict

class lsst.daf.butler.core.utils.IndexedTupleDict

Bases: collections.abc.Mapping, typing.Generic

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

Parameters
indices: `~collections.abc.Mapping`

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. If it is a NamedKeyDict, both names and key instances will be usable as keys in the IndexedTupleDict. 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. The caller is responsible for guaranteeing that this has the same number of elements as indices.

Methods Summary

get(k[,d])

items()

keys()

values()

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