Skip to content

Propagate JHU linting fixes into main #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion _delphi_utils_python/data_proc/geomap/geo_data_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ def create_jhu_uid_fips_crosswalk():
{"jhu_uid": "63072999", "fips": "72000", "weight": 1.0},
]
)
cruise_ships = pd.DataFrame(
[
{"jhu_uid": "84088888", "fips": "88888", "weight": 1.0},
{"jhu_uid": "84099999", "fips": "99999", "weight": 1.0},
]
)

jhu_df = (
pd.read_csv(JHU_FIPS_URL, dtype={"UID": str, "FIPS": str})
Expand All @@ -234,7 +240,7 @@ def create_jhu_uid_fips_crosswalk():
# Drop the JHU UIDs that were hand-modified
dup_ind = jhu_df["jhu_uid"].isin(
pd.concat(
[hand_additions, unassigned_states, out_of_state, puerto_rico_unassigned]
[hand_additions, unassigned_states, out_of_state, puerto_rico_unassigned, cruise_ships]
)["jhu_uid"].values
)
jhu_df.drop(jhu_df.index[dup_ind], inplace=True)
Expand Down
2 changes: 0 additions & 2 deletions _delphi_utils_python/delphi_utils/data/jhu_uid_fips_table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ jhu_uid,fips,weight
63072149,72149,1.0
63072151,72151,1.0
63072153,72153,1.0
84088888,88888,1.0
84099999,99999,1.0
84000001,01000,1.0
84000002,02000,1.0
84000004,04000,1.0
Expand Down
2 changes: 1 addition & 1 deletion jhu/delphi_jhu/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def download_data(base_url: str, metric: str) -> pd.DataFrame:
df = pd.read_csv(base_url.format(metric=metric))
# Keep the UID and the time series columns only
# The regex filters for columns with the date format MM-DD-YY or M-D-YY
df = df.filter(regex="\d{1,2}\/\d{1,2}\/\d{2}|UID").melt(
df = df.filter(regex=r"\d{1,2}\/\d{1,2}\/\d{2}|UID").melt(
id_vars=["UID"], var_name="timestamp", value_name="cumulative_counts"
)
df["timestamp"] = pd.to_datetime(df["timestamp"])
Expand Down
2 changes: 0 additions & 2 deletions jhu/delphi_jhu/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
from datetime import datetime
from itertools import product
from functools import partial
from os.path import join

import numpy as np
import pandas as pd
from delphi_utils import (
read_params,
create_export_csv,
Expand Down