Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: PEP-8 Cleanup #1346

Merged
merged 1 commit into from
Jan 29, 2014
Merged

STY: PEP-8 Cleanup #1346

merged 1 commit into from
Jan 29, 2014

Conversation

jseabold
Copy link
Member

What to do with one-line style fix commits?

@josef-pkt
Copy link
Member

merge, ignore or extend to larger cleanup.
The last only if we don't have an open PR on the same code.

@@ -341,7 +341,7 @@ def q_stat(x,nobs, type="ljungbox"):
ret = nobs*(nobs+2)*np.cumsum((1./(nobs-np.arange(1,
len(x)+1)))*x**2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like there are a lot more missing spaces in this module

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll give it a once over

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pep8 doesn't complain about this. should it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which pep8, the check script? or the newest version of the PEP?
we follow space around operators except power, the PEP does not anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strike that. It does now.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f65ef33 on jseabold:pep8cleanup into 48c3376 on statsmodels:master.

@jseabold
Copy link
Member Author

A little more comprehensive now. I ignored whitespace between arithmetic operators in indexing. It's a personal preference.

@@ -790,7 +805,8 @@ def grangercausalitytests(x, maxlag, addconst=True, verbose=True):

if x.shape[0] <= 3 * maxlag + int(addconst):
raise ValueError("Insufficient observations. Maximum allowable "
"lag is {0}".format(int((x.shape[0] - int(addconst)) / 3) - 1))
"lag is {0}".format(int((x.shape[0] - int(addconst)) /
3) - 1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intend to the matching opening bracket?
impossible to see where the 3 belongs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I had but flake8 complained. I agree it's better though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nm. Fixed.

@josef-pkt
Copy link
Member

That's what I had but flake8 complained.

for intend in continuation lines that isn't large enough.
I usually try to line up visually (without strict rules), but automatic reformatting, by Kevin's editor for example, messes this up. And I find it hard to read if there is no matching intend.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 495d546 on jseabold:pep8cleanup into 48c3376 on statsmodels:master.

@@ -186,24 +191,24 @@ def adfuller(x, maxlag=None, regression="c", autolag='AIC',
if regresults:
store = True

trenddict = {None:'nc', 0:'c', 1:'ct', 2:'ctt'}
trenddict = {None: 'nc', 0: 'c', 1: 'ct', 2: 'ctt'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that looks good,
the "stranger" thing was the space before the :

jseabold added a commit that referenced this pull request Jan 29, 2014
@jseabold jseabold merged commit 541d746 into statsmodels:master Jan 29, 2014
@jseabold jseabold deleted the pep8cleanup branch January 29, 2014 20:45
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants