@@ -27,7 +27,7 @@ class SignalCategory(str, Enum):
27
27
def guess_name (source : str , signal : str , is_weighted : bool ) -> str :
28
28
clean_signal = signal
29
29
if is_weighted and source == "fb-survey" :
30
- clean_signal = signal .replace ("smoothed_w" , "smoothed_weighted_" )
30
+ clean_signal = signal .replace ("smoothed_w" , "smoothed_weighted_" ). replace ( "raw_w" , "raw_weighted_" )
31
31
return " " .join ((s .capitalize () for s in clean_signal .split ("_" ))).replace (" Ili" , " ILI" ).replace (" Cli" , " CLI" ).replace ("Dont" , "Do Not" )
32
32
33
33
@@ -97,6 +97,8 @@ def guess_is_weighted(source: str, signal: str) -> bool:
97
97
# it is smoothed_wanted but the weighted one is smoothed_wwanted
98
98
return False
99
99
return True
100
+ if source == "fb-survey" and signal .startswith ("raw_w" ):
101
+ return True
100
102
if source == "chng" and signal .startswith ("smoothed_adj_" ):
101
103
return True
102
104
return False
@@ -126,7 +128,7 @@ def guess_related_fb_survey_like(entry: "CovidcastMetaEntry", weighted_infix: st
126
128
smoothed_version = entry .signal
127
129
if entry .is_weighted :
128
130
# guess the smoothed unweighted version
129
- smoothed_version = entry .signal .replace ("smoothed_" + weighted_infix , "smoothed_" )
131
+ smoothed_version = entry .signal .replace ("smoothed_" + weighted_infix , "smoothed_" ). replace ( "raw_" + weighted_infix , "smoothed_" )
130
132
elif not entry .is_smoothed :
131
133
smoothed_version = entry .signal .replace ("raw_" , "smoothed_" )
132
134
@@ -139,6 +141,9 @@ def guess_related_fb_survey_like(entry: "CovidcastMetaEntry", weighted_infix: st
139
141
raw_signal = smoothed_version .replace ("smoothed_" , "raw_" )
140
142
related .add (raw_signal )
141
143
144
+ weighted_raw_signal = smoothed_version .replace ("smoothed_" , "raw_" + weighted_infix )
145
+ related .add (weighted_raw_signal )
146
+
142
147
return related
143
148
144
149
0 commit comments