maybe_get_items

function of dascore.utils.misc source

maybe_get_items(
    obj ,
    attr_map: collections.abc.Mapping[str, str] ,
    unpack_names: None | set[None, set[str]] = None,
)

Maybe get items from a mapping (if they exist).

Parameters

Parameter Description
obj Any map like object.
attr_map A mapping of {current_name: output_name}
unpack_names A set of names which should be unpacked (ie collapse 0d arrays).