Various lint errors. Undefined variables have been used in few scripts. These need to be cleaned up or removed.
[centos@ip-172-26-6-166 epimargin (joss_lint_errors)]$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
./studies/adaptive-policy-evaluation/policy_analysis.py:47:82: F821 undefined name 'add_lag_cols'
metro_state_policy_df = metro_state_policy_df.groupby(['metro-state']).apply(add_lag_cols, ['RR_pred'])
^
./studies/empirical-reporting-delay/delay_curve.py:129:55: F821 undefined name 'slope_labels'
plt.scatter(x = next(i for i in range(len(slopes)) if slope_labels[i] == "TT"), y = slopes["TT"], c='r', label = "national")
^
./studies/empirical-reporting-delay/delay_curve.py:142:13: F821 undefined name 'ts'
confirmed = ts.Hospitalized.copy()
^
./studies/empirical-reporting-delay/delay_curve.py:161:12: F821 undefined name 'ts'
mh_raw = ts.loc["Maharashtra"].Hospitalized
^
./studies/empirical-reporting-delay/delay_curve.py:162:25: F821 undefined name 'ts'
mh_notch = notch_filter(ts.loc["Maharashtra"].Hospitalized)
^
./studies/empirical-reporting-delay/delay_curve.py:163:25: F821 undefined name 'ts'
mh_adj = delay_adjust(ts.loc["Maharashtra"].Hospitalized, state_dist.loc["Maharashtra"])
^
./studies/empirical-reporting-delay/delay_curve.py:184:24: F821 undefined name 'ts'
notched = notch_filter(ts.loc["India"].Hospitalized)
^
./studies/empirical-reporting-delay/delay_curve.py:205:13: F821 undefined name 'ts'
raw = ts.loc[state].Hospitalized
^
./studies/india_districts/max_rt_choro.py:20:13: F821 undefined name 'label_fn'
label = label_fn(row)
^
./studies/india_districts/max_rt_choro.py:21:34: F821 undefined name 'Rt_c'
a1 = ax.annotate(s=f"{label}{Rt_c}", xy=list(row["pt"].coords)[0], ha = "center", fontfamily = note_font["family"], color="white", **label_kwargs)
^
./studies/india_districts/max_rt_choro.py:21:100: F821 undefined name 'note_font'
a1 = ax.annotate(s=f"{label}{Rt_c}", xy=list(row["pt"].coords)[0], ha = "center", fontfamily = note_font["family"], color="white", **label_kwargs)
^
./studies/india_districts/max_rt_choro.py:21:138: F821 undefined name 'label_kwargs'
a1 = ax.annotate(s=f"{label}{Rt_c}", xy=list(row["pt"].coords)[0], ha = "center", fontfamily = note_font["family"], color="white", **label_kwargs)
^
./studies/india_districts/max_rt_choro.py:22:26: F821 undefined name 'Stroke'
a1.set_path_effects([Stroke(linewidth = 2, foreground = "black"), Normal()])
^
./studies/india_districts/max_rt_choro.py:22:71: F821 undefined name 'Normal'
a1.set_path_effects([Stroke(linewidth = 2, foreground = "black"), Normal()])
^
./studies/india_districts/urban_aggregation.py:20:12: F821 undefined name 'data_path'
"v3": [data_path(i) for i in (1, 2)],
^
./studies/india_districts/urban_aggregation.py:21:12: F821 undefined name 'data_path'
"v4": [data_path(i) for i in (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)]
^
./studies/india_districts/urban_aggregation.py:25:5: F821 undefined name 'download_data'
download_data(data, target)
^
./studies/india_districts/urban_aggregation.py:27:6: F821 undefined name 'load_all_data'
df = load_all_data(
^
./studies/india_districts/urban_aggregation.py:40:6: F821 undefined name 'get_time_series'
ts = get_time_series(cases_UA, "detected_district").Hospitalized.unstack().fillna(0).cumsum(axis = 1)
^
./studies/india_districts/urban_aggregation.py:48:18: F821 undefined name 'get_time_series'
UA_ts["Delhi"] = get_time_series(df.query("detected_state == 'Delhi'")).Hospitalized.cumsum()
^
./studies/india_districts/sanity-checks/smoothing_checks.py:31:12: F821 undefined name 'cwd'
root = cwd()
^
./studies/india_districts/sanity-checks/smoothing_checks.py:59:79: F821 undefined name 'anomaly_dates'
plot_T_anomalies(dates, T_pred, T_CI_upper, T_CI_lower, new_cases_ts, anomaly_dates, anomalies, CI)
^
./studies/india_districts/sanity-checks/smoothing_checks.py:78:78: F821 undefined name 'box_filter'
) = analytical_MPVS(ts.Hospitalized, CI = CI, smoothing = lambda ts: box_filter(ts, n, None))
^
./studies/india_districts/sanity-checks/smoothing_checks.py:108:78: F821 undefined name 'box_filter'
) = analytical_MPVS(ts.Hospitalized, CI = CI, smoothing = lambda ts: box_filter(ts, n, s))
^
./studies/indonesia/idn_provinces.py:97:11: F821 undefined name 'Model'
IDN = Model.single_unit(name = province, population = priority_pops[province], I0 = T_pred[-1], RR0 = RR_pred[-1], upper_CI = T_CI_upper[-1], lower_CI = T_CI_lower[-1], mobility = 0, random_seed = 0)\
.run(prediction_period)
^
./studies/periodicity-analysis/periodicity.py:169:10: F821 undefined name 'signal'
b1, a1 = signal.iirnotch(f0, Q, fs)
^
./studies/periodicity-analysis/periodicity.py:170:10: F821 undefined name 'signal'
b2, a2 = signal.iirnotch(2*f0, 2*Q, fs)
^
./studies/periodicity-analysis/periodicity.py:183:11: F821 undefined name 'signal'
freq, h = signal.freqz(b, a, fs=fs)
^
./studies/realtime-epi-figs/delay_curve.py:56:50: F821 undefined name 'label_font'
plt.ylabel("percentage of cases\n", fontdict=label_font)
^
./studies/realtime-epi-figs/delay_curve.py:57:43: F821 undefined name 'label_font'
plt.xlabel("\ndelay (days)", fontdict=label_font)
^
./studies/realtime-epi-figs/delay_curve.py:116:55: F821 undefined name 'slope_labels'
plt.scatter(x = next(i for i in range(len(slopes)) if slope_labels[i] == "TT"), y = slopes["TT"], c='r', label = "national")
^
./studies/realtime-epi-figs/delay_curve.py:120:32: F821 undefined name 'label_font'
plt.xlabel("\nstate", fontdict=label_font)
^
./studies/realtime-epi-figs/delay_curve.py:121:38: F821 undefined name 'label_font'
plt.ylabel("coefficient\n", fontdict=label_font)
^
./studies/realtime-epi-figs/delay_curve.py:161:31: F821 undefined name 'label_font'
plt.xlabel("date\n", fontdict=label_font)
^
./studies/realtime-epi-figs/delay_curve.py:162:39: F821 undefined name 'label_font'
plt.ylabel("\nnumber cases", fontdict=label_font)
^
./studies/realtime-epi-figs/ica.py:22:1: F821 undefined name 'plt'
plt.plot(X_transformed[:, 1], X_transformed[:, 2])
^
./studies/realtime-epi-figs/ica.py:23:1: F821 undefined name 'plt'
plt.show()
^
./studies/realtime-epi-figs/ridge.py:86:6: F821 undefined name 'fig'
ax = fig.add_subplot(111, projection='3d')
^
./studies/vaccine_allocation/archive/agestruct.py:40:76: F821 undefined name 'dT'
self.dT = [(dT0 * prevalence_structure).astype(int)] if isinstance(dT, (int, float)) else dT
^
./studies/vaccine_allocation/archive/agestruct.py:40:107: F821 undefined name 'dT'
self.dT = [(dT0 * prevalence_structure).astype(int)] if isinstance(dT, (int, float)) else dT
^
./studies/vaccine_allocation/archive/agestruct.py:43:83: F821 undefined name 'dT'
self.S = [((population - I0) * age_structure).astype(int)] if isinstance(dT, (int, float)) else population
^
./studies/vaccine_allocation/archive/consumption_regression.py:1:19: F821 undefined name 'pd'
datareg_sep2020 = pd.read_stata(data/"datareg_sep2020.dta")\
.dropna()\
.drop(columns = ["_merge"])
^
./studies/vaccine_allocation/archive/consumption_regression.py:1:33: F821 undefined name 'data'
datareg_sep2020 = pd.read_stata(data/"datareg_sep2020.dta")\
.dropna()\
.drop(columns = ["_merge"])
^
43 F821 undefined name 'add_lag_cols'
43