nested_set#
- mochada_kit.hdf5_metadata_tools.nested_set(dic, keys, value)#
Turn the “flat” dict which results from using the function get_ds_dictionaries() in h5py.Group.visititems(), iteratively into a nested dict, which is the correct structure for representation in a plantuml json diagram.
- Parameters:
- dic
DICT On the first pass, an empty dict, which on the first and subsequent passes, is populated with entries.
- keys
LIST List of strings which are the result of e.g. “/1/EBSD/Header/Metadata/First”.split(“/”). For each key, if it does not exist in dic, and emtpy dict is added at that key. This continues until the last key has been reached, at which point, the value is assigned.
- value
STR The value of the metadata at this key.
- dic