-
-
Notifications
You must be signed in to change notification settings - Fork 211
[WIP] Fix624 pep8 #625
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
[WIP] Fix624 pep8 #625
Conversation
|
I'd be happy to merge that, and I also start too see why more than 80 characters per line might be a good idea. How about 100 and we see if this goes well? @janvanrijn any objections on solving all PEP8 issues at once? @PGijsbers I think it would be most compelling if you could also change the flake8 checking script so that it checks the whole library at once. |
|
Invoking flake8 on all code instead of just diffs seems easy enough. Considering it's a quick operation anyway even for the whole repo, I don't know/think that it's bad practice (especially since you don't need to sort through diffs). |
Codecov Report
@@ Coverage Diff @@
## develop #625 +/- ##
===========================================
+ Coverage 89.77% 89.96% +0.19%
===========================================
Files 32 32
Lines 3207 3208 +1
===========================================
+ Hits 2879 2886 +7
+ Misses 328 322 -6
Continue to review full report at Codecov.
|
|
Not sure why the previous tests failed - the changed code only had one minor refactor but might have introduced off-by-one errors (I don't see it)? Even so, the actual numbers are also different in pr and push. For the particular test it should be that in both cases the most significantly changed line is not even hit. The first call |
|
This is really cool stuff @PGijsbers , thanks for taking care of this.
I usually do 120, this seems the default for PyCharm. However keep in mind that for consistency with sklearn 80 is not a very bad idea. (Fine with both) |
|
Flake seems to be failing on warnings, do we want this behavior? |
|
Then I propose the following changes w.r.t. line length:
Can either of you two take a look at the failed test? I don't understand how it fails with new code but not old code. As far as I can tell, in neither scenario should |
|
I think that this PR should not fail on warnings to keep it manageable. I think that we should prefer to have operators at the beginning of a line (following math notation). I'm fine with 100 and 120 character setup. And @janvanrijn agrees on your assessment of the error in #626 . |
|
I checked the failed tests and it seems to stem from issue #626 and flake8 checking the whole repo (and me only editing the ./openml directory). Looks good to merge to me. |
|
Thanks Pieter!
It’s great that the line length has been bumped. I often had to do weird
line breaks with chaining functions.
…On Sat, 23 Feb 2019 at 17:37, Matthias Feurer ***@***.***> wrote:
Merged #625 <#625> into
develop.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#625 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABpQV64pWZrxUpz6nkn0ZcUiOWZW4o2Iks5vQW5HgaJpZM4bJoNz>
.
|
edit: marked WIP as I need to ensure unit tests don't fail first.
The
developbranch is not PEP8 compliant (see #624). This fixes that for the core module*, ignoring E402 as per the script.Examples and unit tests are excluded from this PR**, for the following reasons:
In/around code that needed to be changed for PEP8 reasons, I sparingly also refactored and fixed a bug. Most notably:
When adapting the PEP8 check, has there been any discussion on the 80-character limit?
I personally think that a 100 or 120 character limit is typically better.
The 80 character limit limits reasonably verbose variable names, especially at higher indent levels.
Examples in the code that I think would be fine to be on one line:
If developers try to avoid excessively verbose names or chaining functions, I think these are fine exceptions. Modern screens can easily show two 100 or 120 character lines side-by-side. Limiting to 80 characters leads to scenarios that (in my opinion) hurt the legibility more like splitting lines with square brackets as seen in 4.
* There is one exception utils#100 violating the character limit (85>80). This again has to do with that I do not know how documentation will be affected by breaking up the change.
** this is the exception that might lead to visible changes. After I realized my work might impact the final rendering of documentation, I stopped. I could revert this change if desired.