Skip to content

Commit 309fb79

Browse files
committed
Fix JHU bug that renamed fips to county in receiving
* change valid geo_res * change GEO_RESOLUTIOSN in run.py * update tests to use "county"
1 parent 8678fba commit 309fb79

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

jhu/delphi_jhu/geo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def geo_map(df: pd.DataFrame, geo_res: str):
2727
Columns: geo_id, timestamp, ...
2828
"""
2929
df = df.copy()
30-
VALID_GEO_RES = ("fips", "state", "msa", "hrr")
30+
VALID_GEO_RES = ("county", "state", "msa", "hrr")
3131
if geo_res not in VALID_GEO_RES:
3232
raise ValueError(f"geo_res must be one of {VALID_GEO_RES}")
3333

3434
gmpr = GeoMapper()
35-
if geo_res == "fips":
35+
if geo_res == "county":
3636
df.rename(columns={'fips': 'geo_id'}, inplace=True)
3737
elif geo_res == "state":
3838
df = gmpr.replace_geocode(df, "fips", "state_id", new_col="geo_id", date_col="timestamp")

jhu/delphi_jhu/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"seven_day_average": (seven_day_moving_average, '7dav_'),
6060
}
6161
GEO_RESOLUTIONS = [
62-
"fips",
62+
"county",
6363
"state",
6464
"msa",
6565
"hrr",

jhu/tests/test_geo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_fips(self):
4545

4646
df = df.append(df_mega)
4747

48-
new_df = geo_map(df, "fips")
48+
new_df = geo_map(df, "county")
4949

5050
exp_incidence = df["new_counts"] / df["population"] * 100000
5151
exp_cprop = df["cumulative_counts"] / df["population"] * 100000

0 commit comments

Comments
 (0)