Skip to content

Commit 7248fb4

Browse files
committed
Improve linting
1 parent c8fe35f commit 7248fb4

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

changehc/delphi_changehc/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"""
77

88
from datetime import datetime, timedelta
9-
import numpy as np
109

1110

1211
class Config:

changehc/delphi_changehc/download_ftp_files.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# standard
55
import datetime
66
import functools
7-
import sys
87
from os import path
98

109
# third party
@@ -68,7 +67,7 @@ def download(out_path, ftp_conn):
6867

6968
sftp.chdir('/dailycounts/Covid_Outpatients_By_County')
7069
get_files_from_dir(sftp, out_path)
71-
70+
7271
finally:
7372
if client:
7473
client.close()

changehc/delphi_changehc/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def run_module():
3434
# the filenames are expected to be in the format:
3535
# Denominator: "YYYYMMDD_All_Outpatients_By_County.dat.gz"
3636
# Numerator: "YYYYMMDD_Covid_Outpatients_By_County.dat.gz"
37-
37+
3838
if params["drop_date"] is None:
3939
dropdate_denom = datetime.strptime(
4040
Path(params["input_denom_file"]).name.split("_")[0], "%Y%m%d"

changehc/delphi_changehc/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def fit(y_data, first_sensor_date, geo_id, num_col="num", den_col="den"):
129129

130130
# checks - due to the smoother, the first value will be NA
131131
assert (
132-
np.sum(np.isnan(smoothed_total_rates[1:]) == True) == 0
132+
np.sum(np.isnan(smoothed_total_rates[1:])) == 0
133133
), "NAs in rate calculation"
134134
assert (
135135
np.sum(smoothed_total_rates[1:] <= 0) == 0

changehc/delphi_changehc/update_sensor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66
# standard packages
77
import logging
8-
from datetime import timedelta
98
from multiprocessing import Pool, cpu_count
109
import covidcast
1110
from delphi_utils import GeoMapper, S3ArchiveDiffer, read_params
@@ -18,7 +17,7 @@
1817
from .load_data import load_combined_data
1918
from .sensor import CHCSensor
2019
from .weekday import Weekday
21-
from .constants import SIGNALS, SMOOTHED, SMOOTHED_ADJ, HRR, NA, FIPS
20+
from .constants import SIGNALS, SMOOTHED, SMOOTHED_ADJ, NA
2221

2322

2423
def write_to_csv(output_dict, write_se, out_name, output_path="."):
@@ -123,6 +122,8 @@ def public_signal(signal_):
123122

124123

125124
class CHCSensorUpdator:
125+
"""Contains methods to update sensor and write results to csv
126+
"""
126127

127128
def __init__(self,
128129
startdate,
@@ -181,10 +182,10 @@ def geo_reindex(self, data):
181182
# get right geography
182183
geo = self.geo
183184
gmpr = GeoMapper()
184-
if geo not in {"county", "state", "msa", "hrr"}:
185+
if geo not in {"county", "state", "msa", "hrr"}:
185186
logging.error(f"{geo} is invalid, pick one of 'county', 'state', 'msa', 'hrr'")
186187
return False
187-
elif geo == "county":
188+
if geo == "county":
188189
data_frame = gmpr.fips_to_megacounty(data,Config.MIN_DEN,Config.MAX_BACKFILL_WINDOW,thr_col="den",mega_col=geo)
189190
elif geo == "state":
190191
data_frame = gmpr.replace_geocode(data, "fips", "state_id", new_col="state")
@@ -305,4 +306,3 @@ def update_sensor(self,
305306
for exported_file in fails:
306307
print(f"Failed to archive '{exported_file}'")
307308
'''
308-
return

0 commit comments

Comments
 (0)