Skip to content

Commit fa9143a

Browse files
committed
lint
1 parent ee64984 commit fa9143a

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

_delphi_utils_python/delphi_utils/date_utils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ def date_to_api_string(d: datetime, time_type: str = "day") -> str:
1515
raise ValueError(f"Unknown time_type: {time_type}")
1616

1717

18-
def convert_apitime_column_to_datetimes(df: pd.DataFrame, col: str, date_format: str = "%Y%m%d") -> pd.Series:
18+
def convert_apitime_column_to_datetimes(
19+
df: pd.DataFrame, col: str, date_format: str = "%Y%m%d"
20+
) -> pd.Series:
1921
"""Convert a DataFrame date or epiweek column into datetimes.
2022
2123
Dates are assumed to be in the YYYYMMDD format by default.
@@ -28,7 +30,9 @@ def parse_row(row):
2830
if row["time_type"] == "day":
2931
return pd.to_datetime(row[col], format=date_format)
3032
if row["time_type"] == "week":
31-
return pd.to_datetime(Week(int(row[col][:4]), int(row[col][-2:])).startdate())
33+
return pd.to_datetime(
34+
Week(int(row[col][:4]), int(row[col][-2:])).startdate()
35+
)
3236
return row[col]
3337

3438
return df.apply(parse_row, axis=1)

_delphi_utils_python/delphi_utils/validator/datafetcher.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import threading
66
import warnings
77
from os import listdir
8+
89
# pylint: disable=W0707
910
from os.path import isfile, join
1011

@@ -169,14 +170,17 @@ def fetch_api_reference(data_source, start_date, end_date, geo_type, signal_type
169170
"""
170171
if start_date > end_date:
171172
raise ValueError(
172-
"end_date must be on or after start_date, but " f"start_date = '{start_date}', end_date = '{end_date}'"
173+
"end_date must be on or after start_date, but "
174+
+ f"start_date = '{start_date}', end_date = '{end_date}'"
173175
)
174176
response = Epidata.covidcast(
175177
data_source,
176178
signal_type,
177179
time_type="day",
178180
geo_type=geo_type,
179-
time_values=Epidata.range(start_date.strftime("%Y%m%d"), end_date.strftime("%Y%m%d")),
181+
time_values=Epidata.range(
182+
start_date.strftime("%Y%m%d"), end_date.strftime("%Y%m%d")
183+
),
180184
geo_value="*",
181185
)
182186

0 commit comments

Comments
 (0)