Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
fixed:
- Always look for new data file versions even if we have a local copy of one.
15 changes: 7 additions & 8 deletions policyengine/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions policyengine/utils/data_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading