diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..3c43bbd7 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Always look for new data file versions even if we have a local copy of one. diff --git a/policyengine/simulation.py b/policyengine/simulation.py index f40d5d29..aa5858a9 100644 --- a/policyengine/simulation.py +++ b/policyengine/simulation.py @@ -135,14 +135,13 @@ def _set_data(self): -1 ].split("/", 2) - if not Path(filename).exists(): - file_path = download( - filepath=filename, - huggingface_org=hf_org, - huggingface_repo=hf_repo, - gcs_bucket=bucket, - ) - filename = str(Path(file_path)) + file_path = download( + filepath=filename, + huggingface_org=hf_org, + huggingface_repo=hf_repo, + gcs_bucket=bucket, + ) + filename = str(Path(file_path)) if "cps_2023" in filename: time_period = 2023 else: diff --git a/policyengine/utils/data_download.py b/policyengine/utils/data_download.py index c7722173..5b0f776a 100644 --- a/policyengine/utils/data_download.py +++ b/policyengine/utils/data_download.py @@ -40,10 +40,6 @@ def download( except: logging.info("Failed to download from Hugging Face.") - if Path(filepath).exists(): - logging.info(f"File {filepath} already exists. Skipping download.") - return filepath - if data_file.gcs_bucket is not None: logging.info("Using Google Cloud Storage for download.") download_file_from_gcs(