From f6bbab52aa583f45d1775e1f9a51af452cc51526 Mon Sep 17 00:00:00 2001 From: jeanlassere <126190564+jeanlassere@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:11:34 -1000 Subject: [PATCH] Update externalConfig.py --- afc/externalConfig.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/afc/externalConfig.py b/afc/externalConfig.py index e63d178..36d2189 100644 --- a/afc/externalConfig.py +++ b/afc/externalConfig.py @@ -23,7 +23,18 @@ root = os.getcwd() def read_json_config(config_path, json_conly=False): - """Utility function to parse a json configuration file.""" + """Utility function to parse a json configuration file. + + Args: + config_path (str): path to the json configuration file + json_conly (bool): boolean determining whether to return only the json configuration data or use it to update the AFC parameters. + + Returns: + if json_conly == TRUE: + dic: dictionary containing the json file data + else: + dic: dictionary containing AFC parameters updated using to the json configuration + """ # Import and read the new configuration from the json file with open(config_path, encoding='utf8') as f: @@ -36,7 +47,14 @@ def read_json_config(config_path, json_conly=False): DEFAULT_DICT = read_json_config(DEFAULT_JSON_PATH, json_conly=True) def config_from_dict(config): - """Utility function to make configuration from a dictionary.""" + """Utility function to make configuration from a dictionary. + + Arg: + config (dic): dictionary containing the json file data + + Returns: + dic: dictionary containing AFC parameters updated using to the json configuration + """ for k in read_json_config(DEFAULT_JSON_PATH, json_conly=True): if k not in config: