vivarium.library.dict_utils module¶
-
vivarium.library.dict_utils.
deep_merge
(dct, merge_dct)[source]¶ Recursive dict merge This mutates dct - the contents of merge_dct are added to dct (which is also returned). If you want to keep dct you could call it like deep_merge(dict(dct), merge_dct)
-
vivarium.library.dict_utils.
deep_merge_check
(dct, merge_dct)[source]¶ Recursive dict merge, which throws exceptions for conflicting values This mutates dct - the contents of merge_dct are added to dct (which is also returned). If you want to keep dct you could call it like deep_merge(dict(dct), merge_dct)
-
vivarium.library.dict_utils.
deep_merge_combine_lists
(dct, merge_dct)[source]¶ Recursive dict merge, combines values that are lists This mutates dct - the contents of merge_dct are added to dct (which is also returned). If you want to keep dct you could call it like deep_merge(dict(dct), merge_dct)
-
vivarium.library.dict_utils.
flatten_port_dicts
(dicts)[source]¶ - Input:
dicts (dict): embedded state dictionaries with the {‘port_id’: {‘state_id’: state_value}}
- Returns
flattened dictionary with {‘state_id_port_id’: value}
- Return type
merge (dict)
-
vivarium.library.dict_utils.
flatten_timeseries
(timeseries)[source]¶ Flatten a timeseries in the style of flatten_port_dicts
-
vivarium.library.dict_utils.
make_path_dict
(embedded_dict)[source]¶ converts embedded dict to a flat dict with path names as keys