JointDict#

class JointDict(dict_map: dict[int, dict], key_map=None)#

Bases: object

__init__(dict_map: dict[int, dict], key_map=None)#

Initialize with a mapping from prefix (int) to dictionary. Keys in each dictionary must start with that prefix and an underscore. Example: {1: {‘1_a’: …}, 2: {‘2_b’: …}}

Args:

dict_map (dict): Mapping from keys (e.g. IDs, types) to sub-dictionaries. key_map (callable): Function that takes a joint key and returns (subdict_key, key_in_subdict)

Methods

__init__(dict_map[, key_map])

Initialize with a mapping from prefix (int) to dictionary. Keys in each dictionary must start with that prefix and an underscore. Example: {1: {'1_a': ...}, 2: {'2_b': ...}} Args: dict_map (dict): Mapping from keys (e.g. IDs, types) to sub-dictionaries. key_map (callable): Function that takes a joint key and returns (subdict_key, key_in_subdict).

items([from_subkeys])

keys([from_subkeys])

values([from_subkeys])