Skip to content

Commit 5aa9db3

Browse files
authored
Merge pull request #1181 from cmu-delphi/remove-jhu-archivediffer
Remove ArchiveDiffer from JHU run()
2 parents a045a64 + 99449b6 commit 5aa9db3

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

jhu/delphi_jhu/run.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import numpy as np
1313
from delphi_utils import (
1414
create_export_csv,
15-
S3ArchiveDiffer,
1615
Smoother,
1716
GeoMapper,
1817
get_structured_logger,
@@ -89,18 +88,6 @@ def run_module(params: Dict[str, Any]):
8988
__name__, filename=params["common"].get("log_filename"),
9089
log_exceptions=params["common"].get("log_exceptions", True))
9190

92-
if "archive" in params:
93-
arch_diff = S3ArchiveDiffer(
94-
params["archive"]["cache_dir"],
95-
export_dir,
96-
params["archive"]["bucket_name"],
97-
"jhu",
98-
params["archive"]["aws_credentials"],
99-
)
100-
arch_diff.update_cache()
101-
else:
102-
arch_diff = None
103-
10491
gmpr = GeoMapper()
10592
dfs = {metric: pull_jhu_data(base_url, metric, gmpr) for metric in METRICS}
10693
for metric, geo_res, sensor, smoother in product(
@@ -144,25 +131,6 @@ def run_module(params: Dict[str, Any]):
144131
oldest_final_export_date = min(
145132
oldest_final_export_date, max(exported_csv_dates))
146133

147-
if arch_diff is not None:
148-
# Diff exports, and make incremental versions
149-
_, common_diffs, new_files = arch_diff.diff_exports()
150-
151-
# Archive changed and new files only
152-
to_archive = [f for f, diff in common_diffs.items() if diff is not None]
153-
to_archive += new_files
154-
_, fails = arch_diff.archive_exports(to_archive)
155-
156-
# Filter existing exports to exclude those that failed to archive
157-
succ_common_diffs = {
158-
f: diff for f, diff in common_diffs.items() if f not in fails
159-
}
160-
arch_diff.filter_exports(succ_common_diffs)
161-
162-
# Report failures: someone should probably look at them
163-
for exported_file in fails:
164-
print(f"Failed to archive '{exported_file}'")
165-
166134
elapsed_time_in_seconds = round(time.time() - start_time, 2)
167135
max_lag_in_days = None
168136
formatted_oldest_final_export_date = None

0 commit comments

Comments
 (0)