Skip to content

Commit ae0e3c3

Browse files
committed
let jhu pass pydocstyle
1 parent 63338b6 commit ae0e3c3

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

jhu/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ install: venv
1313

1414
lint:
1515
. env/bin/activate; \
16-
pylint $(dir)
16+
pylint $(dir); \
17+
pydocstyle $(dir)
1718

1819
test:
1920
. env/bin/activate ;\

jhu/delphi_jhu/geo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
def geo_map(df: pd.DataFrame, geo_res: str):
1010
"""
11-
Maps a DataFrame df, which contains data at the county resolution, and
12-
aggregate it to the geographic resolution geo_res.
11+
Map a DataFrame df the county resolution, and aggregate it to the geographic resolution geo_res.
1312
1413
Parameters
1514
----------

jhu/delphi_jhu/pull.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
def download_data(base_url: str, metric: str) -> pd.DataFrame:
1010
"""
11+
Download and format JHU data.
12+
1113
Downloads the data from the JHU repo, extracts the UID and the date columns, and
1214
enforces the date datatype on the the time column.
1315
"""
@@ -24,6 +26,8 @@ def download_data(base_url: str, metric: str) -> pd.DataFrame:
2426

2527
def create_diffs_column(df: pd.DataFrame) -> pd.DataFrame:
2628
"""
29+
Compute pairwise differences of cumulative values to get incidence.
30+
2731
Using the cumulative_counts column from the dataframe, partitions the dataframe
2832
into separate time-series based on fips, and then computes pairwise differences
2933
of the cumulative values to get the incidence values. Boundary cases are handled
@@ -41,9 +45,7 @@ def create_diffs_column(df: pd.DataFrame) -> pd.DataFrame:
4145

4246

4347
def sanity_check_data(df: pd.DataFrame) -> pd.DataFrame:
44-
"""
45-
Perform a final set of sanity checks on the data.
46-
"""
48+
"""Perform a final set of sanity checks on the data."""
4749
days_by_fips = df.groupby("fips").count()["cumulative_counts"].unique()
4850
unique_days = df["timestamp"].unique()
4951

@@ -62,7 +64,7 @@ def sanity_check_data(df: pd.DataFrame) -> pd.DataFrame:
6264

6365

6466
def pull_jhu_data(base_url: str, metric: str, gmpr: GeoMapper) -> pd.DataFrame:
65-
"""Pulls the latest Johns Hopkins CSSE data, and conforms it into a dataset
67+
"""Pull the latest Johns Hopkins CSSE data, and conforms it into a dataset.
6668
6769
The output dataset has:
6870

0 commit comments

Comments
 (0)