Skip to content

Commit daa52d2

Browse files
authored
Merge pull request #1445 from cmu-delphi/nowcast-lint
Fix nowcast linting
2 parents e822782 + 3748141 commit daa52d2

File tree

6 files changed

+12
-56
lines changed

6 files changed

+12
-56
lines changed

nowcast/.pylintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ disable=logging-format-interpolation,
1616
[BASIC]
1717

1818
# Allow arbitrarily short-named variables.
19-
variable-rgx=[a-z_][a-z0-9_]*
20-
argument-rgx=[a-z_][a-z0-9_]*
21-
attr-rgx=[a-z_][a-z0-9_]*
19+
variable-rgx=[A-Za-z_][a-z0-9_]*
20+
argument-rgx=[A-Za-z_][a-z0-9_]*
21+
attr-rgx=[A-Za-z_][a-z0-9_]*
2222

2323
[DESIGN]
2424

nowcast/delphi_nowcast/deconvolution/deconvolution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def deconvolve_double_smooth_ntf(
7474
x_k = None
7575
alpha_0 = np.zeros(n - k - 1)
7676
u_0 = np.zeros(n - k - 1)
77-
for t in range(n_iters):
77+
for _ in range(n_iters):
7878
x_k = x_update_1 @ (Cty + rho * D.T @ (alpha_0 + u_0))
7979
Dx = D @ x_k
8080
alpha_k = _soft_thresh(Dx - u_0, lam / rho)

nowcast/delphi_nowcast/deconvolution/ground_truth.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

nowcast/delphi_nowcast/sensorization/ar_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from datetime import datetime, timedelta, date
1+
"""Fit autoregression models."""
2+
3+
from datetime import timedelta, date
24
from typing import Tuple
35

46
import numpy as np

nowcast/delphi_nowcast/sensorization/regression_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from datetime import datetime, timedelta, date
1+
"""Fit linear regression mdels."""
2+
3+
from datetime import timedelta, date
24

35
import numpy as np
46

nowcast/delphi_nowcast/sensorization/sensor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Functions to run sensorization."""
2-
import os
32
from collections import defaultdict
43
from typing import List, DefaultDict
54
from datetime import timedelta, date
@@ -54,7 +53,7 @@ def compute_sensors(as_of_date: date,
5453
(sensor.source, sensor.signal, loc.geo_type, loc.geo_value)
5554
)
5655
if not covariates:
57-
# TODO convert to log statements #689
56+
# TODO convert to log statements #689 # pylint: disable=fixme
5857
print(f"No data: {(sensor.source, sensor.signal, loc.geo_type, loc.geo_value)}")
5958
continue
6059
reg_sensor = compute_regression_sensor(sensor_pred_date, covariates, loc, REG_INTERCEPT)
@@ -95,7 +94,7 @@ def historical_sensors(start_date: date,
9594
output = defaultdict(list)
9695
for location in ground_truths:
9796
for sensor in sensors:
98-
sensor_vals, missing_dates = get_historical_sensor_data(
97+
sensor_vals, _ = get_historical_sensor_data(
9998
sensor, location, start_date, end_date
10099
)
101100
if sensor_vals.data:

0 commit comments

Comments
 (0)