tomoscan.utils.drac.mapper.flatten_vol_metadata#
- tomoscan.utils.drac.mapper.flatten_vol_metadata(metadata, parent_key='', sep='/')#
Flatten a nested dictionary (expected to come from nabu volume metadata) and converting arrays to lists and numpy types to serializable types. The resulting dictionary is JSON-serializable.
- Parameters
metadata (
dict
) – The dictionary to flatten.parent_key (
str
) – The base key string used for recursive calls.sep – The separator used between parent and child keys.
- Return type
dict
- Returns
The flattened and type-converted dictionary.