nnmt.input_output.quantities_to_val_unit¶
-
nnmt.input_output.
quantities_to_val_unit
(dict_of_quantities)[source]¶ Recursively convert a dict of quantities to a dict of val-unit pairs.
Split up value and unit of each quantiy and save them in a dictionary of the structure:
{'<parameter1>:{'val':<value>, 'unit':<unit>}, ...}
Lists of quantities are handled seperately. Anything else but quantities, is stored just the way it is given.
Parameters: - dict_of_quantitiesdict
Dictionary containing only quantities (pint package) of the following format:
{'<quantity_key1>':<quantity1>, ...}
Returns: - dict
Converted dictionary