Skip to content

Commit 81a79c5

Browse files
committed
fix docs
1 parent 0a7865e commit 81a79c5

File tree

6 files changed

+11
-22
lines changed

6 files changed

+11
-22
lines changed

claims_hosp/delphi_claims_hosp/config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212

1313
class Config:
14-
"""
15-
Static configuration variables.
16-
"""
14+
"""Static configuration variables."""
1715

1816
signal_name = "smoothed_covid19_from_claims"
1917
signal_weekday_name = "smoothed_adj_covid19_from_claims"
@@ -59,9 +57,7 @@ class Config:
5957

6058

6159
class GeoConstants:
62-
"""
63-
Constant geographical variables.
64-
"""
60+
"""Constant geographical variables."""
6561

6662
# number of counties in usa, including megacounties
6763
NUM_COUNTIES = 3141 + 52

claims_hosp/delphi_claims_hosp/indicator.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919

2020

2121
class ClaimsHospIndicator:
22-
"""
23-
Class to fit a hospitalizations indicator using CLI counts from claims-based data.
24-
"""
22+
"""Class to fit a hospitalizations indicator using CLI counts from claims-based data."""
2523

2624
@staticmethod
2725
def gauss_smooth(num, den):
28-
"""smooth using the left_gauss_linear
26+
"""Smooth using the left_gauss_linear.
2927
3028
Args:
3129
num: array of numerator counts
@@ -48,8 +46,9 @@ def backwards_pad(
4846
k=Config.MAX_BACKWARDS_PAD_LENGTH,
4947
min_visits_to_fill=Config.MIN_CUM_VISITS):
5048
"""
51-
Adjust for small denominators by using a
52-
variable length smoother, which starts from the RHS and moves
49+
Adjust for small denominators by using a variable length smoother.
50+
51+
This smoother starts from the RHS and moves
5352
leftwards (backwards through time). We cumulatively sum the total
5453
visits (denominator), until we have observed some minimum number of
5554
counts, then calculate the sum over that bin. We restrict the

claims_hosp/delphi_claims_hosp/run.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919

2020

2121
def run_module():
22-
"""
23-
Read from params.json and generate the updated claims-based hospitalization
24-
indicator values.
25-
"""
26-
22+
"""Read from params.json and generate updated claims-based hospitalization indicator values."""
2723
params = read_params()
2824
logging.basicConfig(level=logging.DEBUG)
2925

claims_hosp/delphi_claims_hosp/smooth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
This file contains a left gauss filter used to smooth a 1-d signal.
3+
34
Code is courtesy of Addison Hu (minor adjustments by Maria).
45
56
Author: Maria Jahja
@@ -24,7 +25,6 @@ def left_gauss_linear(arr, bandwidth=Config.SMOOTHER_BANDWIDTH):
2425
Returns: a smoothed 1D signal.
2526
2627
"""
27-
2828
n_rows = len(arr)
2929
out_arr = np.zeros_like(arr)
3030
X = np.vstack([np.ones(n_rows), np.arange(n_rows)]).T

claims_hosp/delphi_claims_hosp/update_indicator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ClaimsHospIndicatorUpdater:
3131
def __init__(self, startdate, enddate, dropdate, geo, parallel, weekday,
3232
write_se, signal_name):
3333
"""
34-
Updater for the claims-based hospitalization indicator.
34+
Initialize updater for the claims-based hospitalization indicator.
3535
3636
Args:
3737
startdate: first indicator date (YYYY-mm-dd)

claims_hosp/delphi_claims_hosp/weekday.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Weekday:
1717

1818
@staticmethod
1919
def get_params(data):
20-
"""Correct a signal estimated as numerator/denominator for weekday effects.
20+
r"""Correct a signal estimated as numerator/denominator for weekday effects.
2121
2222
The ordinary estimate would be numerator_t/denominator_t for each time point
2323
t. Instead, model
@@ -54,7 +54,6 @@ def get_params(data):
5454
Return a matrix of parameters: the entire vector of betas, for each time
5555
series column in the data.
5656
"""
57-
5857
tmp = data.reset_index()
5958
denoms = tmp.groupby(Config.DATE_COL).sum()["den"]
6059
nums = tmp.groupby(Config.DATE_COL).sum()["num"]
@@ -112,7 +111,6 @@ def calc_adjustment(params, sub_data):
112111
-- this has the same effect.
113112
114113
"""
115-
116114
tmp = sub_data.reset_index()
117115

118116
wd_correction = np.zeros((len(tmp["num"])))

0 commit comments

Comments
 (0)