Skip to content

Commit dcc171d

Browse files
committed
say where gold test data came from
1 parent 3769b66 commit dcc171d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

google_symptoms/tests/test_date_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,20 @@ def test_generate_export_date_missing(self, params_w_no_date, logger, monkeypatc
6666
assert num_export_days == expected_num_export_days
6767

6868
def generate_expected_start_end_dates(self, params_, issue_date):
69+
# Actual dates reported on issue dates June 27-29, 2024, by the old
70+
# version of the google-symptoms indicator
71+
# (https://github.com/cmu-delphi/covidcast-indicators/tree/b338a0962bf3a63f70a83f0b719516f914b098e2).
72+
# The patch module should be able to recreate these dates.
6973
dates_dict = {
7074
"2024-06-27": [ '2024-06-02', '2024-06-03', '2024-06-04', '2024-06-05', '2024-06-06', '2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22'],
7175
"2024-06-28": ['2024-06-03', '2024-06-04', '2024-06-05', '2024-06-06', '2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22', '2024-06-23'],
7276
"2024-06-29": ['2024-06-04', '2024-06-05', '2024-06-06','2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22', '2024-06-23', '2024-06-24'],
7377
}
7478

7579
dates_dict = {
76-
datetime.strptime(key, "%Y-%m-%d"): [datetime.strptime(lvalue, "%Y-%m-%d") for lvalue in value]
77-
for key, value in dates_dict.items()
80+
datetime.strptime(key, "%Y-%m-%d"): [
81+
datetime.strptime(listvalue, "%Y-%m-%d") for listvalue in value
82+
] for key, value in dates_dict.items()
7883
}
7984

8085
dates = dates_dict[issue_date]

google_symptoms/tests/test_patch.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,22 @@ def parse_csv_file(self, file_list: List[str]) -> Tuple[List[datetime]]:
2525
return sorted(smoothed_list), sorted(raw_list)
2626

2727
def generate_expected_dates(self, params_, smoother, issue_date):
28+
# Actual dates reported on issue dates June 27-29, 2024, by the old
29+
# version of the google-symptoms indicator
30+
# (https://github.com/cmu-delphi/covidcast-indicators/tree/b338a0962bf3a63f70a83f0b719516f914b098e2).
31+
# The patch module should be able to recreate these dates.
2832
dates_dict = {
2933
"2024-06-27": [ '2024-06-02', '2024-06-03', '2024-06-04', '2024-06-05', '2024-06-06', '2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22'],
3034
"2024-06-28": ['2024-06-03', '2024-06-04', '2024-06-05', '2024-06-06', '2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22', '2024-06-23'],
3135
"2024-06-29": ['2024-06-04', '2024-06-05', '2024-06-06','2024-06-07', '2024-06-08', '2024-06-09', '2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14', '2024-06-15', '2024-06-16', '2024-06-17', '2024-06-18', '2024-06-19', '2024-06-20', '2024-06-21', '2024-06-22', '2024-06-23', '2024-06-24'],
3236
}
3337

3438
dates_dict = {
35-
datetime.strptime(key, "%Y-%m-%d"): [datetime.strptime(lvalue, "%Y-%m-%d") for lvalue in value]
36-
for key, value in dates_dict.items()
39+
datetime.strptime(key, "%Y-%m-%d"): [
40+
datetime.strptime(listvalue, "%Y-%m-%d") for listvalue in value
41+
] for key, value in dates_dict.items()
3742
}
3843

39-
4044
dates = dates_dict[issue_date]
4145

4246
if smoother == "raw":

0 commit comments

Comments
 (0)