Skip to content

Commit 28f13cd

Browse files
authored
Merge pull request #406 from cmu-delphi/deploy-jhu
Propagate JHU linting fixes into main
2 parents 2884745 + ab3ebf2 commit 28f13cd

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

_delphi_utils_python/data_proc/geomap/geo_data_proc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ def create_jhu_uid_fips_crosswalk():
217217
{"jhu_uid": "63072999", "fips": "72000", "weight": 1.0},
218218
]
219219
)
220+
cruise_ships = pd.DataFrame(
221+
[
222+
{"jhu_uid": "84088888", "fips": "88888", "weight": 1.0},
223+
{"jhu_uid": "84099999", "fips": "99999", "weight": 1.0},
224+
]
225+
)
220226

221227
jhu_df = (
222228
pd.read_csv(JHU_FIPS_URL, dtype={"UID": str, "FIPS": str})
@@ -234,7 +240,7 @@ def create_jhu_uid_fips_crosswalk():
234240
# Drop the JHU UIDs that were hand-modified
235241
dup_ind = jhu_df["jhu_uid"].isin(
236242
pd.concat(
237-
[hand_additions, unassigned_states, out_of_state, puerto_rico_unassigned]
243+
[hand_additions, unassigned_states, out_of_state, puerto_rico_unassigned, cruise_ships]
238244
)["jhu_uid"].values
239245
)
240246
jhu_df.drop(jhu_df.index[dup_ind], inplace=True)

_delphi_utils_python/delphi_utils/data/jhu_uid_fips_table.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ jhu_uid,fips,weight
8282
63072149,72149,1.0
8383
63072151,72151,1.0
8484
63072153,72153,1.0
85-
84088888,88888,1.0
86-
84099999,99999,1.0
8785
84000001,01000,1.0
8886
84000002,02000,1.0
8987
84000004,04000,1.0

jhu/delphi_jhu/pull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def download_data(base_url: str, metric: str) -> pd.DataFrame:
1414
df = pd.read_csv(base_url.format(metric=metric))
1515
# Keep the UID and the time series columns only
1616
# The regex filters for columns with the date format MM-DD-YY or M-D-YY
17-
df = df.filter(regex="\d{1,2}\/\d{1,2}\/\d{2}|UID").melt(
17+
df = df.filter(regex=r"\d{1,2}\/\d{1,2}\/\d{2}|UID").melt(
1818
id_vars=["UID"], var_name="timestamp", value_name="cumulative_counts"
1919
)
2020
df["timestamp"] = pd.to_datetime(df["timestamp"])

jhu/delphi_jhu/run.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
from datetime import datetime
88
from itertools import product
99
from functools import partial
10-
from os.path import join
1110

1211
import numpy as np
13-
import pandas as pd
1412
from delphi_utils import (
1513
read_params,
1614
create_export_csv,

0 commit comments

Comments
 (0)