diff --git a/ansible/templates/changehc-params-prod.json.j2 b/ansible/templates/changehc-params-prod.json.j2 index aa05061f7..033554d6d 100644 --- a/ansible/templates/changehc-params-prod.json.j2 +++ b/ansible/templates/changehc-params-prod.json.j2 @@ -23,7 +23,7 @@ "n_waiting_days": 3, "se": false, "parallel": false, - "geos": ["state", "msa", "hrr", "county", "hhs", "nation"], + "geos": ["state", "msa", "hrr", "chng-fips", "hhs", "nation"], "weekday": [true, false], "types": ["covid","cli","flu"], "wip_signal": "", diff --git a/ansible/templates/sir_complainsalot-params-prod.json.j2 b/ansible/templates/sir_complainsalot-params-prod.json.j2 index d32428b3e..49b6645c5 100644 --- a/ansible/templates/sir_complainsalot-params-prod.json.j2 +++ b/ansible/templates/sir_complainsalot-params-prod.json.j2 @@ -15,7 +15,14 @@ "chng": { "max_age": 6, "maintainers": ["U01AP8GSWG3","U01069KCRS7"], - "retired-signals": ["smoothed_outpatient_covid", "smoothed_adj_outpatient_covid", "smoothed_outpatient_cli", "smoothed_adj_outpatient_cli"] + "retired-signals": [ + ["smoothed_outpatient_covid", "county"], + ["smoothed_adj_outpatient_covid", "county"], + ["smoothed_outpatient_cli", "county"], + ["smoothed_adj_outpatient_cli", "county"], + ["smoothed_outpatient_flu", "county"], + ["smoothed_adj_outpatient_flu", "county"] + ] }, "google-symptoms": { "max_age": 6, diff --git a/changehc/delphi_changehc/update_sensor.py b/changehc/delphi_changehc/update_sensor.py index 11faffa3d..e96ccb5b9 100644 --- a/changehc/delphi_changehc/update_sensor.py +++ b/changehc/delphi_changehc/update_sensor.py @@ -91,7 +91,7 @@ def __init__(self, startdate: first sensor date (YYYY-mm-dd) enddate: last sensor date (YYYY-mm-dd) dropdate: data drop date (YYYY-mm-dd) - geo: geographic resolution, one of ["county", "state", "msa", "hrr", "hhs", "nation"] + geo: geographic resolution, one of ["county", "chng-fips", "state", "msa", "hrr", "hhs", "nation"] parallel: boolean to run the sensor update in parallel weekday: boolean to adjust for weekday effects numtype: type of count data used, one of ["covid", "cli"] @@ -149,19 +149,26 @@ def geo_reindex(self, data): # get right geography geo = self.geo gmpr = GeoMapper() - if geo not in {"county", "state", "msa", "hrr", "nation", "hhs"}: - self.logger.error("{0} is invalid, pick one of 'county', " + if geo not in {"county", "chng-fips", "state", "msa", "hrr", "nation", "hhs"}: + self.logger.error("{0} is invalid, pick one of 'county', 'chng-fips', " "'state', 'msa', 'hrr', 'hss','nation'".format(geo)) return False - if geo == "county": - data_frame = gmpr.fips_to_megacounty(data, + if geo == "county" or geo == "chng-fips": + if geo == "chng-fips": + data_frame = gmpr.replace_geocode(data, "fips", geo, new_col="chng-fips-raw", date_col=Config.DATE_COL) + fips_col = "chng-fips-raw" + else: + data_frame = data + fips_col = "fips" + data_frame = gmpr.fips_to_megacounty(data_frame, Config.MIN_DEN, Config.MAX_BACKFILL_WINDOW, thr_col="den", mega_col=geo, - date_col=Config.DATE_COL) + date_col=Config.DATE_COL, + fips_col=fips_col) # this line should be removed once the fix is implemented for megacounties - data_frame = data_frame[~((data_frame['county'].str.len() > 5) | (data_frame['county'].str.contains('_')))] + data_frame = data_frame[~((data_frame[geo].str.len() > 5) | (data_frame[geo].str.contains('_')))] elif geo == "state": data_frame = gmpr.replace_geocode(data, "fips", "state_id", new_col="state", date_col=Config.DATE_COL) diff --git a/changehc/params.json.template b/changehc/params.json.template index 924692781..50cd9ae07 100644 --- a/changehc/params.json.template +++ b/changehc/params.json.template @@ -24,9 +24,9 @@ "n_waiting_days": 3, "se": false, "parallel": false, - "geos": ["state", "msa", "hrr", "county", "nation", "hhs"], + "geos": ["state", "msa", "hrr", "chng-fips", "nation", "hhs"], "weekday": [true, false], - "types": ["covid","cli"], + "types": ["covid","cli", "flu"], "wip_signal": "", "ftp_conn": { "host": "", diff --git a/sir_complainsalot/params.json.template b/sir_complainsalot/params.json.template index 058069efb..37623ab48 100644 --- a/sir_complainsalot/params.json.template +++ b/sir_complainsalot/params.json.template @@ -14,7 +14,15 @@ }, "chng": { "max_age": 6, - "maintainers": ["U01AP8GSWG3","U01069KCRS7"] + "maintainers": ["U01AP8GSWG3","U01069KCRS7"], + "retired-signals": [ + ["smoothed_outpatient_covid", "county"], + ["smoothed_adj_outpatient_covid", "county"], + ["smoothed_outpatient_cli", "county"], + ["smoothed_adj_outpatient_cli", "county"], + ["smoothed_outpatient_flu", "county"], + ["smoothed_adj_outpatient_flu", "county"] + ] }, "google-symptoms": { "max_age": 6,