unique_dict

Full name: ase2sprkkr.common.configuration_definitions.unique_dict

ase2sprkkr.common.configuration_definitions.unique_dict(values)[source]

Create a dictionary from the arguments. However, raise an exception, if there is any duplicit key. Moreover, if there is key of type (a,b), it will be transformed to subdictionary.

>>> unique_dict( [ ('x', 'y'), (('a','b'), 1 ), (('a', 'c'), 2) ] )
{'x': 'y', 'a': {'b': 1, 'c': 2}}