From 7d710c1e628d515bacf446ffd0db6421b79a1db2 Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Tue, 10 Jun 2025 14:38:29 +0200 Subject: [PATCH] Fix bug while reading yaml file from utils/g5505_utils.py --- utils/exclude_path_keywords.yaml | 3 ++- utils/g5505_utils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/exclude_path_keywords.yaml b/utils/exclude_path_keywords.yaml index f554a31..58f72ec 100644 --- a/utils/exclude_path_keywords.yaml +++ b/utils/exclude_path_keywords.yaml @@ -2,4 +2,5 @@ exclude_paths: containing : - .ipynb_checkpoints - .renku - - .git \ No newline at end of file + - .git +# - params \ No newline at end of file diff --git a/utils/g5505_utils.py b/utils/g5505_utils.py index f721578..32b849b 100644 --- a/utils/g5505_utils.py +++ b/utils/g5505_utils.py @@ -308,17 +308,17 @@ def copy_directory_with_contraints(input_dir_path, output_dir_path, select_dir_keywords = [keyword.replace('/',os.sep) for keyword in select_dir_keywords] try: - with open(os.path.join(dimaPath, 'utils/exclude_path_keywords.yaml'), 'r') as stream: + with open(os.path.join(dimaPath, 'dima/utils/exclude_path_keywords.yaml'), 'r') as stream: exclude_path_dict = yaml.safe_load(stream) if isinstance(exclude_path_dict, dict): - exclude_path_keywords = exclude_path_dict.get('containing', []) + exclude_path_keywords = exclude_path_dict.get('exclude_paths',{}).get('containing', []) if not all(isinstance(keyword, str) for keyword in exclude_path_keywords): exclude_path_keywords = [] else: exclude_path_keywords = [] except (FileNotFoundError, yaml.YAMLError) as e: print(f"Warning. Unable to load YAML file: {e}") - exclude_path_keywords = [] + exclude_path_keywords = [] date = created_at('%Y_%m').replace(":", "-") log_dir='logs/'