enerzyme.utils.config_handler.YamlHandler#

class enerzyme.utils.config_handler.YamlHandler(file_path)[source]#

Bases: object

handle yaml file

__init__(file_path)[source]#

YamlHandler init

Parameters:

file_path (String) – yaml file path of config

read_yaml(encoding: str = 'utf-8') Dict[source]#

read yaml file and convert to easydict

Parameters:

encoding (String) – encoding method uses utf-8 by default

Returns:

The usage of Dict is the same as dict

Return type:

Dict(addict)

write_yaml(data, out_file_path=None, encoding='utf-8')[source]#

write dict or easydict to yaml file(auto write to self.file_path)

Parameters:

data (‘dict’ or ‘Dict(addict)’) – dict containing the contents of the yaml file