-
Notifications
You must be signed in to change notification settings - Fork 268
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: Fix new pep8 errors from pep8's update #819
Conversation
@@ -627,7 +627,9 @@ def update_ids(self, ids=None, fn=None, prefix=""): | |||
"or fn is provided.") | |||
|
|||
if ids is not None: | |||
fn = lambda _: ids |
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 frowned upon now?
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.
It would seem so.
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.
Yes, pep8 now disallows storing lambdas in variables.
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.
That's unfortunate.
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.
It's ridiculous ...
On (Feb-12-15| 9:32), Evan Bolyen wrote:
@@ -627,7 +627,9 @@ def update_ids(self, ids=None, fn=None, prefix=""):
"or fn is provided.")if ids is not None:
fn = lambda _: ids
It would seem so.
Reply to this email directly or view it on GitHub:
https://github.com/biocore/scikit-bio/pull/819/files#r24599822
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.
😢
However, from the PEP8 example, maybe we can keep those super simple functions in one line
Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier.
Yes:
def f(x): return 2*x
.
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.
That's a really good suggestion!
On (Feb-12-15| 9:43), Jorge Ca�ardo Alastuey wrote:
@@ -627,7 +627,9 @@ def update_ids(self, ids=None, fn=None, prefix=""):
"or fn is provided.")if ids is not None:
fn = lambda _: ids
😢
However, from the PEP8 example, maybe we can keep those super simple functions in one line
Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier.
Yes:
def f(x): return 2*x
.
Reply to this email directly or view it on GitHub:
https://github.com/biocore/scikit-bio/pull/819/files#r24600722
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.
I did not know that was possible. Will update once I get travis back into a working state.
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.
However, from the PEP8 example, maybe we can keep those super simple functions in one line
I'm going to merge this so we can get things passing again. Using one line functions in the future sounds like a good idea but I don't think it's too critical at this point. If someone's available to work on this in a separate PR that'd be great!
@@ -14,9 +14,6 @@ | |||
import warnings | |||
|
|||
import numpy as np | |||
|
|||
from matplotlib import use | |||
use('Agg', warn=False) | |||
import matplotlib.pyplot as plt |
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.
I believe the use command must run before importing pyplot...
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.
Working on a way around this issue now...
I've built the docs locally and can confirm that the images are still rendered correctly. |
STY: Fix new pep8 errors from pep8's update
Thank you guys! 💯 |
fixes #818