Some small cleanups based on Quantified code #6154

Merged
merged 7 commits into from Mar 26, 2016

Conversation

Projects
None yet
4 participants
Owner

jenshnielsen commented Mar 14, 2016

I was testing out Quantified code on Matplotlib here

I'm not sure we want to enable that in general but I found a few issues worth fixing here:

mdboom added the needs_review label Mar 14, 2016

Owner

tacaswell commented Mar 14, 2016

Consider documenting your function(s)Learn to fix
4121 issues in 398 files.

Skimming through seems like the other things it finds have reasonable signal-to-noise.

Owner

jenshnielsen commented Mar 14, 2016

My main problem with enabling it on PR's is that it seems to detect new issues in a PR in parts of the code that has't been touched so I am worried about false failures

Owner

tacaswell commented Mar 21, 2016

This needs a rebase

tacaswell added this to the 2.1 (next point release) milestone Mar 21, 2016

jenshnielsen added some commits Mar 8, 2016

@jenshnielsen jenshnielsen Remove unused code 562b18e
@jenshnielsen jenshnielsen Remove duplicated imports 2d3de46
@jenshnielsen jenshnielsen Remove duplicated dict keys
Fortunatly they are all the same in different representations
ffe02ba
@jenshnielsen jenshnielsen Remove duplicated rcsetup entries d36412f
@jenshnielsen jenshnielsen Make debug statement make sense
Original code could never run
09aba5b

@QuLogic QuLogic commented on an outdated diff Mar 21, 2016

examples/lines_bars_and_markers/barh_demo.py
import numpy as np
-import matplotlib.pyplot as plt
+plt.rcdefaults()
@QuLogic

QuLogic Mar 21, 2016

Member

If you're going to move this down here, it should have two blank lines above and one blank line after.

@QuLogic QuLogic commented on an outdated diff Mar 21, 2016

examples/shapes_and_collections/artist_reference.py
import matplotlib.path as mpath
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
+plt.rcdefaults()
@QuLogic

QuLogic Mar 21, 2016

Member

Same here, but two lines after since it's before a function.

@QuLogic QuLogic and 2 others commented on an outdated diff Mar 21, 2016

lib/matplotlib/tests/test_simplification.py
@@ -9,7 +9,6 @@
import matplotlib.pyplot as plt
from pylab import *
@QuLogic

QuLogic Mar 21, 2016

Member

Eugh, really, this import exists in the test code?

@tacaswell

tacaswell Mar 21, 2016

Owner

They are removed in the pytest branch as they throw the test finder for a loop (as we would start running parts of the numpy test suite).

@jenshnielsen

jenshnielsen Mar 21, 2016

Owner

Apparently so. I decided to get rid of this too here.

jenshnielsen added some commits Mar 21, 2016

@jenshnielsen jenshnielsen Comments by QuLogic
8ff0cc2
@jenshnielsen jenshnielsen Remove use of pylab from tests
3cb7787

@tacaswell tacaswell merged commit 4e725b8 into matplotlib:master Mar 26, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Mar 26, 2016

jenshnielsen deleted the jenshnielsen:quantifiedcodecleanup branch Mar 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment