-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
[examples] final pep8 fixes #3774
Conversation
xdata = line.get_xdata() | ||
ydata = line.get_ydata() | ||
maxd = 0.05 | ||
d = np.sqrt((xdata-mouseevent.xdata)**2. + (ydata-mouseevent.ydata)**2.) | ||
d = np.sqrt((xdata - mouseevent.xdata)**2. + (ydata - mouseevent.ydata)**2.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this under 80 chars? if not, perhaps turning those "2." into "2" would help? Or maybe just using np.hypot()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ATM we ignore the E501 (the line length error class) check anyway, as too many lines are longer than 80 chars.
labels=labels, autopct='%.0f%%', | ||
shadow=False, radius=0.5) | ||
labels=labels, autopct='%.0f%%', | ||
shadow=False, radius=0.5) | ||
# Turn off shadow for tiny plot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two comment lines need to go above this function call
overall, this is a good set of changes. |
@@ -14,7 +14,7 @@ | |||
X, Y = meshgrid(x, y) | |||
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) | |||
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) | |||
Z = 10 * (Z2-Z1) # difference of Gaussians | |||
Z = 10*(Z2 - Z1) # difference of Gaussians |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a case where the original was better. If you are going to use spaces around the minus here (which the real PEP 8 does not require), then they are also needed around the asterisk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. The real Pep8 says
If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). Use your own judgment; however, never use more than one space, and always have the same amount of whitespace on both sides of a binary operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the "consider", and the "use your own judgment". Also, notice that this is directed at forms without parentheses, such as a*b + c*d
. There, the spaces visually support the operator precedence.
ok, I think all my comments are addressed. I'll let Travis wrap up and then merge. Fantastic work @Thisch! |
Travis is failing because of the recently added boxplot examples. The whitespace issues in these examples are the cause of the Travis build failure. Is it ok if I merge the master branch into this branch or should i rebase my commits on top of master? |
@efiring I will address your comments about whitespace around operators in a different PR. There are many places now in the examples where expressions like |
Rebase is better. I'll hold off until you are ready. On Sat, Nov 15, 2014 at 10:48 AM, Thomas Hisch notifications@github.com
|
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
This reverts commit 3ef582b. Conflicts: examples/shapes_and_collections/artist_reference.py
@WeatherGod done; travis tests pass except for python 2.6, which is probably not related to this PR |
Indeed, it seems unrelated. Good work. Merging... |
[examples] final pep8 fixes
No description provided.