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

Some small cleanups based on Quantified code #6154

Merged
merged 7 commits into from Mar 26, 2016
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/pyplots/whats_new_98_4_legend.py
@@ -1,6 +1,5 @@
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt


ax = plt.subplot(111)
Expand All @@ -13,6 +12,3 @@


plt.show()



3 changes: 1 addition & 2 deletions examples/lines_bars_and_markers/barh_demo.py
Expand Up @@ -2,9 +2,8 @@
Simple demo of a horizontal bar chart.
"""
import matplotlib.pyplot as plt
plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
plt.rcdefaults()
Copy link
Member

Choose a reason for hiding this comment

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

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



# Example data
Expand Down
4 changes: 1 addition & 3 deletions examples/shapes_and_collections/artist_reference.py
Expand Up @@ -9,14 +9,12 @@
BSD License
"""
import matplotlib.pyplot as plt
plt.rcdefaults()

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.path as mpath
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
plt.rcdefaults()
Copy link
Member

Choose a reason for hiding this comment

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

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



def label(xy, text):
Expand Down
3 changes: 0 additions & 3 deletions lib/matplotlib/_mathtext_data.py
Expand Up @@ -348,7 +348,6 @@
r'\Rightarrow' : ('psyr', 222),
r'\Downarrow' : ('psyr', 223),
r'\Diamond' : ('psyr', 224),
r'\langle' : ('psyr', 225),
r'\Sigma' : ('psyr', 229),
r'\sum' : ('psyr', 229),
r'\forall' : ('psyr', 34),
Expand Down Expand Up @@ -2111,7 +2110,6 @@
'pitchfork' : 8916,
'blacktriangleleft' : 9664,
'nprec' : 8832,
'vdots' : 8942,
'curvearrowright' : 8631,
'barwedge' : 8892,
'multimap' : 8888,
Expand All @@ -2138,7 +2136,6 @@
'Im' : 8465,
'curvearrowleft' : 8630,
'wedgeq' : 8793,
'fallingdotseq' : 8786,
'curlyeqprec' : 8926,
'questeq' : 8799,
'less' : 60,
Expand Down
8 changes: 0 additions & 8 deletions lib/matplotlib/artist.py
Expand Up @@ -1363,14 +1363,6 @@ def pprint_setters_rest(self, prop=None, leadingspace=2):
lines.append(table_formatstr)
lines.append('')
return lines
########

for prop, path in attrs:
accepts = self.get_valid_values(prop)
name = self.aliased_name_rest(prop, path)

lines.append('%s%s: %s' % (pad, name, accepts))
return lines

def properties(self):
"""
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_gtkagg.py
Expand Up @@ -51,8 +51,9 @@ def new_figure_manager_given_figure(num, figure):
Create a new figure manager instance for the given figure.
"""
canvas = FigureCanvasGTKAgg(figure)
return FigureManagerGTKAgg(canvas, num)
figuremanager = FigureManagerGTKAgg(canvas, num)
if DEBUG: print('backend_gtkagg.new_figure_manager done')
return figuremanager


class FigureCanvasGTKAgg(FigureCanvasGTK, FigureCanvasAgg):
Expand Down
8 changes: 3 additions & 5 deletions lib/matplotlib/rcsetup.py
Expand Up @@ -1065,12 +1065,10 @@ def validate_animation_writer_path(p):
# the number of points in the legend line for scatter
'legend.scatterpoints': [3, validate_int],
'legend.fontsize': ['large', validate_fontsize],
# the relative size of legend markers vs. original
'legend.markerscale': [1.0, validate_float],
'legend.shadow': [False, validate_bool],
# whether or not to draw a frame around legend

# whether or not to draw a frame around legend
'legend.frameon': [True, validate_bool],
# alpha value of the legend frame
# alpha value of the legend frame
'legend.framealpha': [None, validate_float_or_None],

## the following dimensions are in fraction of the font size
Expand Down
4 changes: 0 additions & 4 deletions lib/matplotlib/testing/jpl_units/__init__.py
Expand Up @@ -40,10 +40,6 @@
from .Epoch import Epoch
from .UnitDbl import UnitDbl

from .Duration import Duration
from .Epoch import Epoch
from .UnitDbl import UnitDbl

from .StrConverter import StrConverter
from .EpochConverter import EpochConverter
from .UnitDblConverter import UnitDblConverter
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Expand Up @@ -25,7 +25,6 @@
import matplotlib.pyplot as plt
import matplotlib.markers as mmarkers
from numpy.testing import assert_allclose, assert_array_equal
import warnings
from matplotlib.cbook import IgnoredKeywordWarning

import sys
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/tests/test_simplification.py
Expand Up @@ -9,7 +9,6 @@
import matplotlib.pyplot as plt

from pylab import *
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

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

import numpy as np
from matplotlib import patches, path, transforms

from nose.tools import raises
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axisartist/__init__.py
Expand Up @@ -4,7 +4,7 @@
from matplotlib.externals import six

from .axislines import Axes, Subplot, AxesZero, SubplotZero, GridHelperRectlinear, \
AxisArtistHelperRectlinear, AxisArtistHelper, GridHelperBase, AxisArtist
AxisArtistHelperRectlinear, AxisArtistHelper, GridHelperBase
from .axis_artist import AxisArtist, GridlinesCollection

from .grid_helper_curvelinear import GridHelperCurveLinear
Expand Down