From a6a0af8e5a201db7cf098b89b1555b0a18608e8d Mon Sep 17 00:00:00 2001 From: 36000 Date: Thu, 7 Sep 2023 16:44:14 -0700 Subject: [PATCH] [FIX] delete folders in AFQ derivatives when clobbering --- AFQ/utils/path.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AFQ/utils/path.py b/AFQ/utils/path.py index 224a4602c..936b45514 100644 --- a/AFQ/utils/path.py +++ b/AFQ/utils/path.py @@ -62,11 +62,11 @@ def apply_cmd_to_afq_derivs( for filename in os.listdir(derivs_dir): full_path = os.path.join(derivs_dir, filename) - if (full_path in exception_file_names)\ - or (not full_path.startswith(base_fname))\ - or filename.endswith("json"): - continue if os.path.isfile(full_path) or os.path.islink(full_path): + if (full_path in exception_file_names)\ + or (not full_path.startswith(base_fname))\ + or filename.endswith("json"): + continue sidecar_file = f'{drop_extension(full_path)}.json' if op.exists(sidecar_file): sidecar_info = read_json(sidecar_file)