Skip to content

Commit 5602c19

Browse files
authored
Merge pull request statsmodels#5988 from jbrockmendel/follow5928
CLN: follow-up to statsmodels#5928
2 parents 10f39a1 + cfa11eb commit 5602c19

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

lint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ if [ "$LINT" == true ]; then
9797
statsmodels/tools/web.py \
9898
statsmodels/tools/tests/test_linalg.py \
9999
statsmodels/tools/decorators.py \
100+
statsmodels/tools/sm_exceptions.py \
101+
statsmodels/tools/validation/ \
100102
statsmodels/tools/tests/test_decorators.py \
101103
statsmodels/tsa/adfvalues.py \
102104
statsmodels/tsa/base/tests/test_datetools.py \
@@ -111,7 +113,6 @@ if [ "$LINT" == true ]; then
111113
statsmodels/tsa/tests/test_stl.py \
112114
statsmodels/__init__.py \
113115
statsmodels/conftest.py \
114-
statsmodels/tools/sm_exceptions.py \
115116
examples/ \
116117
tools/ \
117118
setup.py

statsmodels/tsa/arima_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ def forecast(self, steps=1, exog=None, alpha=.05):
15281528
2d array of the confidence interval for the forecast
15291529
"""
15301530
if exog is not None:
1531-
#TODO: make a convenience function for this. we're using the
1531+
# TODO: make a convenience function for this. we're using the
15321532
# pattern elsewhere in the codebase
15331533
exog = array_like(exog, 'exog', maxdim=2)
15341534
if self.k_exog == 1 and exog.ndim == 1:

statsmodels/tsa/filters/filtertools.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -339,25 +339,17 @@ def miso_lfilter(ar, ma, x, useic=False):
339339
'''
340340
ma = array_like(ma, 'ma')
341341
ar = array_like(ar, 'ar')
342-
# inp = signal.convolve(x, ma, mode='valid')
343-
# inp = signal.convolve(x, ma)[:, (x.shape[1]+1)//2]
344-
# Note: convolve mixes up the variable left-right flip
345-
# I only want the flip in time direction
346-
# this might also be a mistake or problem in other code where I
347-
# switched from correlate to convolve
348-
# correct convolve version, for use with fftconvolve in other cases
349-
# inp2 = signal.convolve(x, ma[:,::-1])[:, (x.shape[1]+1)//2]
350342
inp = signal.correlate(x, ma[::-1, :])[:, (x.shape[1] + 1) // 2]
351343
# for testing 2d equivalence between convolve and correlate
352-
# np.testing.assert_almost_equal(inp2, inp)
344+
# inp2 = signal.convolve(x, ma[:,::-1])[:, (x.shape[1]+1)//2]
345+
# np.testing.assert_almost_equal(inp2, inp)
353346
nobs = x.shape[0]
354347
# cut of extra values at end
355348

356-
# todo initialize also x for correlate
349+
# TODO: initialize also x for correlate
357350
if useic:
358351
return signal.lfilter([1], ar, inp,
359352
zi=signal.lfiltic(np.array([1., 0.]), ar,
360353
useic))[0][:nobs], inp[:nobs]
361354
else:
362355
return signal.lfilter([1], ar, inp)[:nobs], inp[:nobs]
363-
# return signal.lfilter([1], ar, inp), inp

statsmodels/tsa/stattools.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,15 @@ def acf(x, unbiased=False, nlags=40, qstat=False, fft=None, alpha=None,
559559

560560
if fft is None:
561561
import warnings
562-
msg = 'fft=True will become the default in a future version of ' \
563-
'statsmodels. To suppress this warning, explicitly set ' \
564-
'fft=False.'
565-
warnings.warn(msg, FutureWarning)
562+
warnings.warn(
563+
'fft=True will become the default in a future version of '
564+
'statsmodels. To suppress this warning, explicitly set '
565+
'fft=False.',
566+
FutureWarning
567+
)
566568
fft = False
567569
x = array_like(x, 'x')
568-
nobs = len(x) # should this shrink for missing='drop' and NaNs in x?
570+
nobs = len(x) # TODO: should this shrink for missing='drop' and NaNs in x?
569571
avf = acovf(x, unbiased=unbiased, demean=True, fft=fft, missing=missing)
570572
acf = avf[:nlags + 1] / avf[0]
571573
if not (qstat or alpha):
@@ -955,8 +957,6 @@ def periodogram(x):
955957
warnings.warn('periodogram is deprecated and will be removed after 0.11. '
956958
'Use scipy.signal.periodogram instead.', FutureWarning)
957959
x = array_like(x, 'x')
958-
# if kernel == "bartlett":
959-
# w = 1 - np.arange(M+1.)/M #JP removed integer division
960960

961961
pergr = 1. / len(x) * np.abs(np.fft.fft(x)) ** 2
962962
pergr[0] = 0. # what are the implications of this?

0 commit comments

Comments
 (0)