Skip to content

Commit 1e3a76f

Browse files
authored
Merge pull request statsmodels#4926 from bashtage/flake8-e306
CLN: Enforce E306, blank lines in nested funcs
2 parents 3ad0365 + 54cad11 commit 1e3a76f

File tree

9 files changed

+20
-1
lines changed

9 files changed

+20
-1
lines changed

setup.cfg

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,15 @@ select=
3535
# F402: import 'assert_equal' from line 7 shadowed by loop variable
3636
W601,
3737
# W601: .has_key() is deprecated, use 'in'
38-
W391
38+
W391,
3939
# W391: blank line at end of file
40+
41+
42+
43+
44+
45+
46+
47+
E306
48+
# E306: expected 1 blank line before a nested definition, found 0
49+

statsmodels/imputation/tests/test_mice.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def test_phreg(self):
167167

168168
# Save the dataset size at each iteration.
169169
hist = []
170+
170171
def cb(imp):
171172
hist.append(imp.data.shape)
172173

statsmodels/iolib/tests/test_table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def test_SimpleTable_4(self):
106106
test1header = ('header1', 'header2')
107107
tbl = SimpleTable(table1data, test1header, test1stubs,txt_fmt=txt_fmt1,
108108
ltx_fmt=ltx_fmt1, html_fmt=html_fmt1)
109+
109110
def test_txt_fmt1(self):
110111
# Limited test of custom txt_fmt
111112
desired = """

statsmodels/sandbox/distributions/estimators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ def fitbinned(distfn, freq, binedges, start, fixed=None):
265265
raise NotImplementedError
266266
nobs = np.sum(freq)
267267
lnnobsfact = special.gammaln(nobs+1)
268+
268269
def nloglike(params):
269270
'''negative loglikelihood function of binned data
270271
@@ -315,6 +316,7 @@ def fitbinnedgmm(distfn, freq, binedges, start, fixed=None, weightsoptimal=True)
315316
weights = np.ones(len(freq))
316317
freqnormed = freq/float(nobs)
317318
# skip turning weights into matrix diag(freq/float(nobs))
319+
318320
def gmmobjective(params):
319321
'''negative loglikelihood function of binned data
320322

statsmodels/sandbox/regression/anova_nistcertified.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def anova_oneway(y, x, seq=0):
6565
R2 = (ssbn/(sswn+ssbn)) #R-squared
6666
resstd = np.sqrt(msw) #residual standard deviation
6767
#print(f, prob
68+
6869
def _fix2scalar(z): # return number
6970
if np.shape(z) == (1, 1): return z[0,0]
7071
else: return z

statsmodels/sandbox/stats/multicomp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,7 @@ def homogeneous_subsets(vals, dcrit):
16621662
subsetsli = []
16631663
if np.size(dcrit) == 1:
16641664
dcrit = dcrit*np.ones((nvals, nvals)) #example numbers for experimenting
1665+
16651666
def subsets(vals, indices_):
16661667
'''recursive function for constructing homogeneous subset
16671668

statsmodels/sandbox/tests/test_formula.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def test_termcolumns(self):
126126
t1 = formula.Term("A")
127127
t2 = formula.Term("B")
128128
f = t1 + t2 + t1 * t2
129+
129130
def other(val):
130131
return np.array([3.2*val,4.342*val**2, 5.234*val**3])
131132
q = formula.Quantitative(['other%d' % i for i in range(1,4)], termname='other', func=t1, transform=other)

statsmodels/stats/descriptivestats.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def string_like():
159159
except (TypeError, ValueError):
160160
return False
161161
return True
162+
162163
def number_like():
163164
try:
164165
self.dataset[col][0] + 1.0

statsmodels/stats/power.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def solve_power(self, **kwds):
232232

233233

234234
self._counter = 0
235+
235236
def func(x):
236237
kwds[key] = x
237238
fval = self._power_identity(**kwds)

0 commit comments

Comments
 (0)