Skip to content

Commit 9149aed

Browse files
authored
Fix jhu linter issues (#231)
* Add missing whitespace * Remove trailing newlines * Add spaces after commas * Add space after comma * Fix import order
1 parent bf73c71 commit 9149aed

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

jhu/delphi_jhu/geo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def geo_map(df: pd.DataFrame, geo_res: str, sensor: str):
3737
elif geo_res == "msa":
3838
df = gmpr.county_to_msa(df, fips_col="fips", msa_col="geo_id", date_col="timestamp")
3939
df['geo_id'] = df['geo_id'].astype(int)
40-
print(df[df['population']==0])
40+
print(df[df['population'] == 0])
4141
elif geo_res == 'hrr':
4242
df = gmpr.county_to_hrr(df, fips_col="fips", hrr_col="geo_id", date_col="timestamp")
4343
df['geo_id'] = df['geo_id'].astype(int)
@@ -48,5 +48,3 @@ def geo_map(df: pd.DataFrame, geo_res: str, sensor: str):
4848
df['new_counts'] = df['new_counts']
4949
df['cumulative_counts'] = df['cumulative_counts']
5050
return df
51-
52-

jhu/delphi_jhu/pull.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22

3+
import re
34
from delphi_utils import GeoMapper
45
import pandas as pd
56
import numpy as np
6-
import re
77

88
def detect_date_col(col_name: str):
99
"""determine if column name is a date"""
@@ -72,7 +72,7 @@ def pull_jhu_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.DataFr
7272

7373

7474
gmpr = GeoMapper()
75-
df = gmpr.jhu_uid_to_county(df,jhu_col="UID",date_col='timestamp')
75+
df = gmpr.jhu_uid_to_county(df, jhu_col="UID", date_col='timestamp')
7676

7777
"""
7878
df = df[
@@ -87,7 +87,7 @@ def pull_jhu_data(base_url: str, metric: str, pop_df: pd.DataFrame) -> pd.DataFr
8787
"""
8888
# Merge in population LOWERCASE, consistent across confirmed and deaths
8989
# Set population as NAN for fake fips
90-
pop_df.rename(columns={'FIPS':'fips'},inplace=True)
90+
pop_df.rename(columns={'FIPS':'fips'}, inplace=True)
9191
pop_df['fips'] = pop_df['fips'].astype(int).\
9292
astype(str).str.zfill(5)
9393
df = pd.merge(df, pop_df, on="fips", how='left')

0 commit comments

Comments
 (0)