From 2db803d0e9f97e121b175304745e445ca52b652b Mon Sep 17 00:00:00 2001 From: golmschenk Date: Tue, 21 May 2024 14:05:07 -0400 Subject: [PATCH] Only replace if the file doesn't already exist --- src/ramjet/data_interface/tess_data_interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ramjet/data_interface/tess_data_interface.py b/src/ramjet/data_interface/tess_data_interface.py index 0550556..7cc3e97 100644 --- a/src/ramjet/data_interface/tess_data_interface.py +++ b/src/ramjet/data_interface/tess_data_interface.py @@ -641,8 +641,8 @@ def download_spoc_light_curves_for_tic_ids_chunk( if manifest_row["Status"] == "COMPLETE": original_file_path = Path(manifest_row["Local Path"]) updated_file_path = download_directory.joinpath(original_file_path.name) - updated_file_path.unlink(missing_ok=True) - original_file_path.rename(updated_file_path) + if not updated_file_path.exists(): + original_file_path.rename(updated_file_path) light_curve_paths.append(updated_file_path) else: error_message = (