GetDictMetadata

class lsst.pipe.base.GetDictMetadata(*args, **kwargs)

Bases: Protocol

Protocol for objects that can extract a possibly-nested mapping of primitives.

This protocol is satisfied by TaskMetadata, lsst.daf.base.PropertySet, and lsst.daf.base.PropertyList, providing a consistent way to extract a dictionary from these objects that avoids their historical idiosyncrasies.

This is guaranteed to work for mappings inserted by set_dict. It should not be expected to work for values inserted in other ways. If a value was never inserted with the given key at all, an empty `dict` will be returned (this is a concession to implementation constraints in PropertyList.

Methods Summary

get_dict(key)

Methods Documentation

get_dict(key: str) Mapping[str, str | float | int | bool | Mapping[str, str | float | int | bool | NestedMetadataDict]]