Skip to content

Commit f7ebbe2

Browse files
committed
STY: Correct flake8 issues
1 parent fb2bbc1 commit f7ebbe2

28 files changed

+77
-75
lines changed

INSTALL.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ numpy >= 1.18
1010
www.numpy.org
1111

1212
scipy >= 1.4
13-
13+
1414
www.scipy.org
1515

1616
pandas >= 1.0
@@ -85,7 +85,7 @@ On Ubuntu you can get dependencies through:
8585
python -m pip install cython pandas
8686

8787
Alternatively, you can install from the NeuroDebian repository:
88-
88+
8989
http://neuro.debian.net
9090

9191

statsmodels/datasets/star98/r_glm.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ m1 <- glm(cbind(PR50M,MATHTOT-PR50M) ~ LOWINC + PERASIAN + PERBLACK + PERHISP +
2121
#as.numeric(m1$coef)
2222
#as.numeric(sqrt(diag(vcov(m1))))
2323
results <- summary.glm(m1)
24-
24+
2525
#star.logit.fit3 <- glm(cbind(PR50M,MATHTOT-PR50M) ~ LOWINC + PERASIAN + PERBLACK + PERHISP +
2626
# PERMINTE + AVYRSEXP + AVSAL + PERSPEN + PTRATIO + PCTAF + PCTCHRT + PCTYRRND +
2727
# PERMINTE.AVYRSEXP + PERMINTE.AVSAL + AVYRSEXP.AVSAL + PERSPEN.PTRATIO + PERSPEN.PCTAF +

statsmodels/tsa/ar_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class AutoReg(tsa_model.TimeSeriesModel):
164164
-----
165165
See the notebook `Autoregressions
166166
<../examples/notebooks/generated/autoregressions.html>`__ for an overview.
167-
167+
168168
Examples
169169
--------
170170
>>> import statsmodels.api as sm

statsmodels/tsa/filters/bk_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def bkfilter(x, low=6, high=32, K=12):
5555
5656
See the notebook `Time Series Filters
5757
<../examples/notebooks/generated/tsa_filters.html>`__ for an overview.
58-
58+
5959
References
6060
----------
6161
Baxter, M. and R. G. King. "Measuring Business Cycles: Approximate

statsmodels/tsa/filters/cf_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def cffilter(x, low=6, high=32, drift=True):
5555
-----
5656
See the notebook `Time Series Filters
5757
<../examples/notebooks/generated/tsa_filters.html>`__ for an overview.
58-
58+
5959
Examples
6060
--------
6161
>>> import statsmodels.api as sm

statsmodels/tsa/filters/hp_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def hpfilter(x, lamb=1600):
5858
5959
See the notebook `Time Series Filters
6060
<../examples/notebooks/generated/tsa_filters.html>`__ for an overview.
61-
61+
6262
References
6363
----------
6464
Hodrick, R.J, and E. C. Prescott. 1980. "Postwar U.S. Business Cycles: An

statsmodels/tsa/forecasting/stl.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ class STLForecast:
118118
both in- and out-of-sample predictions.
119119
120120
See the notebook `Seasonal Decomposition
121-
<../examples/notebooks/generated/stl_decomposition.html>`__ for an overview.
122-
121+
<../examples/notebooks/generated/stl_decomposition.html>`__ for an
122+
overview.
123+
123124
Examples
124125
--------
125126
>>> import numpy as np

statsmodels/tsa/holtwinters/_exponential_smoothers.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ cdef object holt_win_init(double[::1] x, HoltWintersArgs hw_args):
238238
cdef Py_ssize_t i, n, idx = 0
239239
cdef double[::1] p, s
240240
cdef long[::1] xi
241-
241+
242242
p = hw_args._p
243243
xi = hw_args._xi
244244
n = p.shape[0]

statsmodels/tsa/holtwinters/model.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class ExponentialSmoothing(TimeSeriesModel):
197197
See the notebook `Exponential Smoothing
198198
<../examples/notebooks/generated/exponential_smoothing.html>`__
199199
for an overview.
200-
200+
201201
References
202202
----------
203203
.. [1] Hyndman, Rob J., and George Athanasopoulos. Forecasting: principles
@@ -1532,7 +1532,7 @@ class SimpleExpSmoothing(ExponentialSmoothing):
15321532
See the notebook `Exponential Smoothing
15331533
<../examples/notebooks/generated/exponential_smoothing.html>`__
15341534
for an overview.
1535-
1535+
15361536
References
15371537
----------
15381538
.. [1] Hyndman, Rob J., and George Athanasopoulos. Forecasting: principles
@@ -1686,7 +1686,7 @@ class Holt(ExponentialSmoothing):
16861686
See the notebook `Exponential Smoothing
16871687
<../examples/notebooks/generated/exponential_smoothing.html>`__
16881688
for an overview.
1689-
1689+
16901690
References
16911691
----------
16921692
.. [1] Hyndman, Rob J., and George Athanasopoulos. Forecasting: principles

statsmodels/tsa/innovations/_arma_innovations.pyx.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cdef {{prefix}}toeplitz(int n, int offset0, int offset1,
5151
{{cython_type}} [:, :] out_matrix):
5252
"""
5353
toeplitz(int n, int o0, int o1, {{cython_type}} [:] in_column, {{cython_type}} [:, :] out_matrix
54-
54+
5555
Construct a Toeplitz block in a matrix in place
5656

5757
Parameters
@@ -93,7 +93,7 @@ cpdef {{prefix}}arma_transformed_acovf_fast({{cython_type}} [:] ar,
9393
{{cython_type}} [:] arma_acovf):
9494
"""
9595
arma_transformed_acovf_fast({{cython_type}} [:] ar, {{cython_type}} [:] ma, {{cython_type}} [:] arma_acovf)
96-
96+
9797
Quickly construct the autocovariance matrix for a transformed process.
9898

9999
Using the autocovariance function for an ARMA process, constructs the
@@ -201,7 +201,7 @@ cpdef {{prefix}}arma_innovations_algo_fast(int nobs,
201201
{{cython_type}} [:] acovf2):
202202
"""
203203
arma_innovations_algo_fast(int nobs, {{cython_type}} [:] ar_params, {{cython_type}} [:] ma_params, {{cython_type}} [:, :] acovf, {{cython_type}} [:] acovf2)
204-
204+
205205
Quickly apply innovations algorithm for an ARMA process.
206206

207207
Parameters
@@ -304,7 +304,7 @@ cpdef {{prefix}}arma_innovations_filter({{cython_type}} [:] endog,
304304
{{cython_type}} [:, :] theta):
305305
"""
306306
arma_innovations_filter({{cython_type}} [:] endog, {{cython_type}} [:] ar_params, {{cython_type}} [:] ma_params, {{cython_type}} [:, :] theta):
307-
307+
308308
Innovations filter for an ARMA process.
309309

310310
Parameters
@@ -375,7 +375,7 @@ cpdef {{prefix}}arma_innovations({{cython_type}} [:] endog,
375375
{{cython_type}} sigma2):
376376
"""
377377
arma_innovations({{cython_type}} [:] endog, {{cython_type}} [:] ar_params, {{cython_type}} [:] ma_params):
378-
378+
379379
Compute innovations and variances based on an ARMA process.
380380

381381
Parameters

statsmodels/tsa/regime_switching/markov_autoregression.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class MarkovAutoregression(markov_regression.MarkovRegression):
8888
See the notebook `Markov switching autoregression
8989
<../examples/notebooks/generated/markov_autoregression.html>`__
9090
for an overview.
91-
91+
9292
References
9393
----------
9494
Kim, Chang-Jin, and Charles R. Nelson. 1999.

statsmodels/tsa/regime_switching/markov_regression.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ class MarkovRegression(markov_switching.MarkovSwitching):
7272
ones.
7373
7474
See the notebook `Markov switching dynamic regression
75-
<../examples/notebooks/generated/markov_regression.html>`__ for an overview.
76-
75+
<../examples/notebooks/generated/markov_regression.html>`__ for an
76+
overview.
77+
7778
References
7879
----------
7980
Kim, Chang-Jin, and Charles R. Nelson. 1999.

statsmodels/tsa/statespace/_filters/_conventional.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ cdef int {{prefix}}updating_conventional({{prefix}}KalmanFilter kfilter, {{prefi
256256
{{cython_type}} alpha = 1.0
257257
{{cython_type}} beta = 0.0
258258
{{cython_type}} gamma = -1.0
259-
259+
260260
# #### Filtered state for time t
261261
# $a_{t|t} = a_t + P_t Z_t' F_t^{-1} v_t$
262262
# $a_{t|t} = 1.0 * \\#_1 \\#_2 + 1.0 a_t$

statsmodels/tsa/statespace/_filters/_univariate.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ cdef void {{prefix}}companion_predicted_state_cov({{prefix}}KalmanFilter kfilter
565565
{{cython_type}} tmp
566566

567567
# $P_{t+1} = T_t P_{t,n} T_t' + Q_t^*$
568-
568+
569569
# `tmp0` array used here, dimension $(p \times m)$
570570
# $\\#_0 = \phi_t P_{t|t} $
571571

statsmodels/tsa/statespace/_kalman_filter.pxd

+4-4
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ cdef class sKalmanFilter(object):
196196
# ### Define some constants
197197
cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
198198
cdef readonly int ldwork
199-
199+
200200
cdef allocate_arrays(self)
201201
cdef void set_dimensions(self)
202202
cpdef set_filter_method(self, int filter_method, int force_reset=*)
@@ -350,7 +350,7 @@ cdef class dKalmanFilter(object):
350350
# ### Define some constants
351351
cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
352352
cdef readonly int ldwork
353-
353+
354354
cdef allocate_arrays(self)
355355
cdef void set_dimensions(self)
356356
cpdef set_filter_method(self, int filter_method, int force_reset=*)
@@ -505,7 +505,7 @@ cdef class cKalmanFilter(object):
505505
# ### Define some constants
506506
cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
507507
cdef readonly int ldwork
508-
508+
509509
cdef allocate_arrays(self)
510510
cdef void set_dimensions(self)
511511
cpdef set_filter_method(self, int filter_method, int force_reset=*)
@@ -660,7 +660,7 @@ cdef class zKalmanFilter(object):
660660
# ### Define some constants
661661
cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
662662
cdef readonly int ldwork
663-
663+
664664
cdef allocate_arrays(self)
665665
cdef void set_dimensions(self)
666666
cpdef set_filter_method(self, int filter_method, int force_reset=*)

statsmodels/tsa/statespace/_kalman_filter.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ cdef class {{prefix}}KalmanFilter(object):
366366
# ### Define some constants
367367
# cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_endogstates
368368
# cdef readonly ldwork
369-
369+
370370
def __init__(self,
371371
{{prefix}}Statespace model,
372372
int filter_method=FILTER_CONVENTIONAL,

statsmodels/tsa/statespace/_kalman_smoother.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ cdef class zKalmanSmoother(object):
468468
)
469469

470470
# cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
471-
471+
472472
cdef allocate_arrays(self)
473473
cdef int check_filter_method_changed(self)
474474
cdef int reset_filter_method(self, int force_reset=*)

statsmodels/tsa/statespace/_kalman_smoother.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ cdef class {{prefix}}KalmanSmoother(object):
237237

238238
# ### Define some constants
239239
# cdef readonly int k_endog, k_states, k_posdef, k_endog2, k_states2, k_posdef2, k_endogstates, k_statesposdef
240-
240+
241241
def __init__(self,
242242
{{prefix}}Statespace model,
243243
{{prefix}}KalmanFilter kfilter,

statsmodels/tsa/statespace/_representation.pxd

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cimport numpy as np
1313
cdef class sStatespace(object):
1414
# Statespace dimensions
1515
cdef readonly int nobs, k_endog, k_states, k_posdef
16-
16+
1717
# Statespace representation matrices
1818
cdef readonly np.float32_t [::1,:] obs, obs_intercept, state_intercept
1919
cdef readonly np.float32_t [:] initial_state
@@ -90,7 +90,7 @@ cdef class sStatespace(object):
9090
cdef class dStatespace(object):
9191
# Statespace dimensions
9292
cdef readonly int nobs, k_endog, k_states, k_posdef
93-
93+
9494
# Statespace representation matrices
9595
cdef readonly np.float64_t [::1,:] obs, obs_intercept, state_intercept
9696
cdef readonly np.float64_t [:] initial_state
@@ -167,7 +167,7 @@ cdef class dStatespace(object):
167167
cdef class cStatespace(object):
168168
# Statespace dimensions
169169
cdef readonly int nobs, k_endog, k_states, k_posdef
170-
170+
171171
# Statespace representation matrices
172172
cdef readonly np.complex64_t [::1,:] obs, obs_intercept, state_intercept
173173
cdef readonly np.complex64_t [:] initial_state
@@ -244,7 +244,7 @@ cdef class cStatespace(object):
244244
cdef class zStatespace(object):
245245
# Statespace dimensions
246246
cdef readonly int nobs, k_endog, k_states, k_posdef
247-
247+
248248
# Statespace representation matrices
249249
cdef readonly np.complex128_t [::1,:] obs, obs_intercept, state_intercept
250250
cdef readonly np.complex128_t [:] initial_state

statsmodels/tsa/statespace/_representation.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ cdef class {{prefix}}Statespace(object):
8181
# `k_posdef` $\equiv r$ is the dimension of the state shocks
8282
# *Old notation: T, n, k, g*
8383
# cdef readonly int nobs, k_endog, k_states, k_posdef
84-
84+
8585
# `obs` $\equiv y_t$ is the **observation vector** $(p \times T)$
8686
# `design` $\equiv Z_t$ is the **design vector** $(p \times m \times T)$
8787
# `obs_intercept` $\equiv d_t$ is the **observation intercept** $(p \times T)$

statsmodels/tsa/statespace/_smoothers/_alternative.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ cdef int {{prefix}}smoothed_disturbances_alternative({{prefix}}KalmanSmoother sm
240240
&alpha, smoother._tmp0, &kfilter.k_states,
241241
&smoother.scaled_smoothed_estimator[0, smoother.t+1], &inc,
242242
&beta, smoother._smoothed_state_disturbance, &inc)
243-
243+
244244
if smoother.smoother_output & SMOOTHER_DISTURBANCE_COV:
245245
# $\\#_00 = K_t H_t$
246246
# $(m \times p) = (m \times p) (p \times p)$

statsmodels/tsa/statespace/_smoothers/_conventional.pyx.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ cdef int {{prefix}}smoothed_disturbances_missing_conventional({{prefix}}KalmanSm
195195
# TODO this is not explicitly addressed in Durbin and Koopman Chapter 4
196196
# or in Koopman (1993) - need to find a source for if this is correct
197197
# Note: this is what the MATLAB ssm toolbox does, also
198-
198+
199199
# Smoothed measurement disturbances have unconditional expected
200200
# value of 0, so no need to do anything
201201

statsmodels/tsa/statespace/tests/results/frbny_nowcast/Nowcasting/functions/dfm.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@
10851085

10861086
end
10871087

1088-
1088+
10891089
function [y,C,R,L] = MissData(y,C,R)
10901090
% Syntax:
10911091
% Description:

statsmodels/tsa/statespace/tests/results/frbny_nowcast/Nowcasting/functions/summarize.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ function summarize(X,Time,Spec,vintage)
2020
fprintf([repmat('-',1,130) '\n']);
2121

2222
for i = 1:N
23-
23+
2424
% time indexes for which there are observed values for series i
2525
t_obs = ~isnan(X(:,i));
26-
26+
2727
data_series = Spec.SeriesName{i};
2828
if length(data_series) > 30
2929
data_series = [data_series(1:27) '...'];
@@ -81,7 +81,7 @@ function summarize(X,Time,Spec,vintage)
8181
data_series,num_obs,units_transformed,frequency,mean_series,stdv_series,min_series,max_series);
8282
fprintf('%30s | %17s %12s %10s %8s %8s %8s %8s \n',...
8383
series_id,date_range,'','','','',min_date,max_date);
84-
84+
8585
end
8686

8787
fprintf('\n\n\n');

0 commit comments

Comments
 (0)