diff --git a/alea/utils.py b/alea/utils.py index 33cc80f..0f89770 100644 --- a/alea/utils.py +++ b/alea/utils.py @@ -117,16 +117,20 @@ def get_analysis_space(analysis_space: list) -> list: return eval_analysis_space -def _prefix_file_path(config: dict, template_folder_list: list): +def _prefix_file_path( + config: dict, template_folder_list: list, ignore_keys: List[str] = ["name", "histname"] +): """Prefix file path with template_folder_list whenever possible. Args: config (dict): dictionary contains file path template_folder_list (list): list of possible base folders. Ordered by priority. + ignore_keys (list, optional (default=["name", "histname"])): + keys to be ignored when prefixing """ for key in config.keys(): - if isinstance(config[key], str): + if isinstance(config[key], str) and key not in ignore_keys: try: config[key] = get_file_path(config[key], template_folder_list) except RuntimeError: