diff --git a/unimol_tools/unimol_tools/utils/config_handler.py b/unimol_tools/unimol_tools/utils/config_handler.py index 58df06d..94b01e5 100644 --- a/unimol_tools/unimol_tools/utils/config_handler.py +++ b/unimol_tools/unimol_tools/utils/config_handler.py @@ -13,9 +13,11 @@ class YamlHandler: + '''A clss to read and write the yaml file''' def __init__(self, file_path): """ A custom logger class that provides logging functionality to console and file. + :param file_path: (str) The yaml file path of the config. """ if not os.path.exists(file_path): @@ -23,6 +25,7 @@ def __init__(self, file_path): self.file_path = file_path def read_yaml(self, encoding='utf-8'): """ read yaml file and convert to easydict + :param encoding: (str) encoding method uses utf-8 by default :return: Dict (addict), the usage of Dict is the same as dict """ @@ -30,6 +33,7 @@ def read_yaml(self, encoding='utf-8'): return Dict(yaml.load(f.read(), Loader=yaml.FullLoader)) def write_yaml(self, data, out_file_path, encoding='utf-8'): """ write dict or easydict to yaml file(auto write to self.file_path) + :param data: (dict or Dict(addict)) dict containing the contents of the yaml file """ with open(out_file_path, encoding=encoding, mode='w') as f: