aiida_phonopy.utils.mapping#

Utilities to deal with various mapping data structures.

Module Contents#

Functions#

get_logging_container()

Return an AttributeDict that can be used to map logging messages to certain log levels.

_case_transform_dict(dictionary, dict_name, func_name, ...)

Transform a dictionary to have the first keys capitalized or decapitalized.

_lowercase_dict(dictionary, dict_name)

Transform a dictionary to have the first keys decapitalized.

_uppercase_dict(dictionary, dict_name)

Transform a dictionary to have the first keys capitalized.

aiida_phonopy.utils.mapping.get_logging_container()[source]#

Return an AttributeDict that can be used to map logging messages to certain log levels.

This datastructure is useful to add log messages in a function that does not have access to the right logger. Once returned, the caller who does have access to the logger can then easily loop over the contents and pipe the messages through the actual logger.

Returns:

AttributeDict

aiida_phonopy.utils.mapping._case_transform_dict(dictionary: dict, dict_name: str, func_name, transform)[source]#

Transform a dictionary to have the first keys capitalized or decapitalized.

aiida_phonopy.utils.mapping._lowercase_dict(dictionary: dict, dict_name: str)[source]#

Transform a dictionary to have the first keys decapitalized.

aiida_phonopy.utils.mapping._uppercase_dict(dictionary: dict, dict_name: str)[source]#

Transform a dictionary to have the first keys capitalized.