@@ -111,14 +111,9 @@ def get_geo_signal_combos(data_source):
111
111
Cross references based on combinations reported available by COVIDcast metadata.
112
112
"""
113
113
# Maps data_source name with what's in the API, lists used in case of multiple names
114
- # pylint: disable=fixme
115
- # TODO: Extract this mapping from meta response instead of hard-coding
116
- # https://github.com/cmu-delphi/covidcast-indicators/issues/1457
117
- source_signal_mappings = {
118
- 'indicator-combination' : ['indicator-combination-cases-deaths' ],
119
- 'quidel' : ['quidel-covid-ag' ],
120
- 'safegraph' : ['safegraph-weekly' ]
121
- }
114
+
115
+ source_signal_mappings = {i ['source' ]:i ['db_source' ] for i in
116
+ requests .get ("https://api.covidcast.cmu.edu/epidata/covidcast/meta" ).json ()}
122
117
meta = covidcast .metadata ()
123
118
source_meta = meta [meta ['data_source' ] == data_source ]
124
119
# Need to convert np.records to tuples so they are hashable and can be used in sets and dicts.
@@ -130,8 +125,9 @@ def get_geo_signal_combos(data_source):
130
125
# True/False indicate if status is active, "unknown" means we should check
131
126
sig_combo_seen = dict ()
132
127
for combo in geo_signal_combos :
133
- if source_signal_mappings .get (data_source ):
134
- src_list = source_signal_mappings .get (data_source )
128
+ if data_source in source_signal_mappings .values ():
129
+ src_list = [key for (key , value ) in source_signal_mappings .items ()
130
+ if value == data_source ]
135
131
else :
136
132
src_list = [data_source ]
137
133
for src in src_list :
0 commit comments