Skip to content

Commit aa16b00

Browse files
committed
Remove hard-coding from get_geo_signal_combos
Uses covidcast/meta to find source-signal pairings. Issue: how to resolve the db_source quidel mapping to multiple sources quidel_covid_ag and quidel_flu?
1 parent 4ac71f7 commit aa16b00

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

_delphi_utils_python/delphi_utils/validator/datafetcher.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,9 @@ def get_geo_signal_combos(data_source):
111111
Cross references based on combinations reported available by COVIDcast metadata.
112112
"""
113113
# 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['db_source']:i['source'] for i in
116+
requests.get("https://api.covidcast.cmu.edu/epidata/covidcast/meta").json()}
122117
meta = covidcast.metadata()
123118
source_meta = meta[meta['data_source'] == data_source]
124119
# Need to convert np.records to tuples so they are hashable and can be used in sets and dicts.

0 commit comments

Comments
 (0)