Skip to content

Commit 51620ea

Browse files
nmdefriesaysim319
andauthored
Define new conjunctivitis signal in google-symptoms (#2112)
* define new conjunctivitis signal * add s07 to params * update test data * change behavior to only log missing set * lint and clean test --------- Co-authored-by: Amaris Sim <[email protected]>
1 parent d407d6c commit 51620ea

File tree

10 files changed

+27790
-27778
lines changed

10 files changed

+27790
-27778
lines changed

ansible/templates/google_symptoms-params-prod.json.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"s04_smoothed_search",
5353
"s05_smoothed_search",
5454
"s06_smoothed_search",
55+
"s07_smoothed_search",
5556
"scontrol_smoothed_search"
5657
]
5758
}

google_symptoms/delphi_google_symptoms/constants.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111
"s02": ["Nasal congestion", "Post nasal drip", "Rhinorrhea", "Sinusitis",
1212
"Rhinitis", "Common cold"],
1313
"s03": ["Fever", "Hyperthermia", "Chills", "Shivering", "Low grade fever"],
14-
#"s04": ["Fatigue", "Weakness", "Muscle weakness", "Myalgia", "Pain"],
1514
"s04": ["Shortness of breath", "Wheeze", "Croup", "Pneumonia", "Asthma",
1615
"Crackles", "Acute bronchitis", "Bronchitis"],
1716
"s05": ["Anosmia", "Dysgeusia", "Ageusia"],
18-
#"s07": ["Nausea", "Vomiting", "Diarrhea", "Indigestion", "Abdominal pain"],
1917
"s06": ["Laryngitis", "Sore throat", "Throat irritation"],
20-
#"s09": ["Headache", "Migraine", "Cluster headache", "Dizziness", "Lightheadedness"],
21-
#"s10": ["Night sweats","Perspiration", "hyperhidrosis"],
18+
"s07": ["Conjunctivitis", "Red eye", "Epiphora", "Eye pain", "Rheum"],
2219
"scontrol": ["Type 2 diabetes", "Urinary tract infection", "Hair loss",
2320
"Candidiasis", "Weight gain"]
2421
}

google_symptoms/delphi_google_symptoms/date_utils.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from delphi_utils.validator.utils import lag_converter
99
from pandas import to_datetime
1010

11-
from .constants import COMBINED_METRIC, FULL_BKFILL_START_DATE, PAD_DAYS, SMOOTHERS
11+
from .constants import COMBINED_METRIC, PAD_DAYS, SMOOTHERS
1212

1313

1414
def generate_patch_dates(params: Dict) -> Dict[date, Dict[str, Union[date, int]]]:
@@ -85,22 +85,20 @@ def generate_num_export_days(params: Dict, logger) -> [int]:
8585

8686
if sensor_names.difference(set(gs_metadata.signal)):
8787
# If any signal not in metadata yet, we need to backfill its full history.
88-
logger.warning("Signals missing in the epidata; backfilling full history")
89-
num_export_days = (export_end_date - FULL_BKFILL_START_DATE).days + 1
90-
else:
91-
latest_date_diff = (datetime.today() - to_datetime(min(gs_metadata.max_time))).days + 1
88+
logger.warning("Signals missing in the epidata; need to patch full history")
89+
latest_date_diff = (datetime.today() - to_datetime(min(gs_metadata.max_time))).days + 1
9290

93-
expected_date_diff = params["validation"]["common"].get("span_length", 14)
91+
expected_date_diff = params["validation"]["common"].get("span_length", 14)
9492

95-
# there's an expected lag of 4 days behind if running from today
96-
if export_end_date.date() == datetime.today().date():
97-
global_max_expected_lag = get_max_lag(params)
98-
expected_date_diff += global_max_expected_lag
93+
# there's an expected lag of 4 days behind if running from today
94+
if export_end_date.date() == datetime.today().date():
95+
global_max_expected_lag = get_max_lag(params)
96+
expected_date_diff += global_max_expected_lag
9997

100-
if latest_date_diff > expected_date_diff:
101-
logger.info("Lag is more than expected", expected_lag=expected_date_diff, lag=latest_date_diff)
98+
if latest_date_diff > expected_date_diff:
99+
logger.info("Lag is more than expected", expected_lag=expected_date_diff, lag=latest_date_diff)
102100

103-
num_export_days = expected_date_diff
101+
num_export_days = expected_date_diff
104102

105103
return num_export_days
106104

google_symptoms/params.json.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"s04_smoothed_search",
4242
"s05_smoothed_search",
4343
"s06_smoothed_search",
44+
"s07_smoothed_search",
4445
"scontrol_smoothed_search"
4546
]
4647
}

google_symptoms/tests/test_data/covid_metadata.csv

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,18 @@ google-symptoms,s06_smoothed_search,day,hrr,2020-02-20,2024-07-13,304,0.0,2.4442
19551955
google-symptoms,s06_smoothed_search,day,msa,2020-02-20,2024-07-13,379,0.0,2.942381,0.6269093,0.2474402,2024-07-17 13:15:36,20240717,4,732
19561956
google-symptoms,s06_smoothed_search,day,nation,2020-02-20,2024-07-13,1,0.4007222,1.5691818,0.8043518,0.2252896,2024-07-17 13:15:36,20240717,4,732
19571957
google-symptoms,s06_smoothed_search,day,state,2020-02-20,2024-07-13,51,0.1852381,2.0328571,0.7772562,0.2522011,2024-07-17 13:15:36,20240717,4,732
1958+
google-symptoms,s07_raw_search,day,county,2020-02-14,2024-07-13,869,0.0733333,3.8166667,0.7171405,0.2509621,2024-07-17 13:15:32,20240717,4,738
1959+
google-symptoms,s07_raw_search,day,hhs,2020-02-14,2024-07-13,10,0.3065122,1.9331217,0.7831431,0.2417782,2024-07-17 13:15:33,20240717,4,738
1960+
google-symptoms,s07_raw_search,day,hrr,2020-02-14,2024-07-13,304,8.36e-05,2.6907692,0.5563906,0.2612786,2024-07-17 13:15:34,20240717,4,738
1961+
google-symptoms,s07_raw_search,day,msa,2020-02-14,2024-07-13,379,0.0698392,3.6766667,0.6513573,0.2451345,2024-07-17 13:15:36,20240717,4,738
1962+
google-symptoms,s07_raw_search,day,nation,2020-02-14,2024-07-13,1,0.3923812,1.7562711,0.8039715,0.2280758,2024-07-17 13:15:36,20240717,4,738
1963+
google-symptoms,s07_raw_search,day,state,2020-02-14,2024-07-13,51,0.1533333,2.2033333,0.7768827,0.2577945,2024-07-17 13:15:36,20240717,4,738
1964+
google-symptoms,s07_smoothed_search,day,county,2020-02-20,2024-07-13,869,0.0,2.942381,0.6715739,0.2519801,2024-07-17 13:15:32,20240717,4,732
1965+
google-symptoms,s07_smoothed_search,day,hhs,2020-02-20,2024-07-13,10,0.3288689,1.804973,0.783512,0.2387222,2024-07-17 13:15:33,20240717,4,732
1966+
google-symptoms,s07_smoothed_search,day,hrr,2020-02-20,2024-07-13,304,0.0,2.4442007,0.5435988,0.263496,2024-07-17 13:15:34,20240717,4,732
1967+
google-symptoms,s07_smoothed_search,day,msa,2020-02-20,2024-07-13,379,0.0,2.942381,0.6269093,0.2474402,2024-07-17 13:15:36,20240717,4,732
1968+
google-symptoms,s07_smoothed_search,day,nation,2020-02-20,2024-07-13,1,0.4007222,1.5691818,0.8043518,0.2252896,2024-07-17 13:15:36,20240717,4,732
1969+
google-symptoms,s07_smoothed_search,day,state,2020-02-20,2024-07-13,51,0.1852381,2.0328571,0.7772562,0.2522011,2024-07-17 13:15:36,20240717,4,732
19581970
google-symptoms,scontrol_raw_search,day,county,2020-02-14,2024-07-13,1438,0.25,14.124,3.3171389,1.0021697,2024-07-17 13:15:32,20240717,4,738
19591971
google-symptoms,scontrol_raw_search,day,hhs,2020-02-14,2024-07-13,10,2.097142,10.5574026,3.561163,0.4858404,2024-07-17 13:15:33,20240717,4,738
19601972
google-symptoms,scontrol_raw_search,day,hrr,2020-02-14,2024-07-13,306,0.0535164,12.348618,3.1551263,0.8088133,2024-07-17 13:15:34,20240717,4,738

0 commit comments

Comments
 (0)