Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix pep8 error classes e20[12] and e22[12] in examples #3635

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

Merged
merged 3 commits into from
Oct 17, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix E221 pep8 errors
  • Loading branch information
twmr committed Oct 11, 2014
commit 19eeb22eca4938a9fe5f1c5726ef8ed3613d5411
2 changes: 1 addition & 1 deletion examples/color/color_cycle_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
yy = np.transpose([np.sin(x + phi) for phi in offsets])

plt.rc('lines', linewidth=4)
fig, (ax0, ax1) = plt.subplots(nrows=2)
fig, (ax0, ax1) = plt.subplots(nrows=2)

plt.rc('axes', color_cycle=['r', 'g', 'b', 'y'])
ax0.plot(yy)
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/contour_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

plt.figure()
filled01 = [ [[0,0],[3,0],[3,3],[0,3],[1,1],[1,2],[2,2],[2,1]] ]
kinds01 = [ [1,2,2,2,1,2,2,2] ]
kinds01 = [ [1,2,2,2,1,2,2,2] ]
cs = ContourSet(plt.gca(), [0,1], [filled01], [kinds01], filled=True)
cbar = plt.colorbar(cs)

Expand Down
30 changes: 15 additions & 15 deletions examples/misc/rc_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def file_exists(ob, name, val):
fh = file(val, 'r')
return val

linestyles = ('-', '--', '-.', ':', 'steps', 'None')
linestyles = ('-', '--', '-.', ':', 'steps', 'None')
TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4)
linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's',
'+', 'x', 'd', 'D', '|', '_', 'h', 'H',
Expand All @@ -116,23 +116,23 @@ def file_exists(ob, name, val):


class LineRC(traits.HasTraits):
linewidth = traits.Float(0.5)
linestyle = traits.Trait(*linestyles)
color = Color
marker = traits.Trait(*linemarkers)
linewidth = traits.Float(0.5)
linestyle = traits.Trait(*linestyles)
color = Color
marker = traits.Trait(*linemarkers)
markerfacecolor = Color
markeredgecolor = Color
markeredgewidth = traits.Float(0.5)
markersize = traits.Float(6)
antialiased = flexible_true_trait
data_clipping = flexible_false_trait
markersize = traits.Float(6)
antialiased = flexible_true_trait
data_clipping = flexible_false_trait


class PatchRC(traits.HasTraits):
linewidth = traits.Float(1.0)
linewidth = traits.Float(1.0)
facecolor = Color
edgecolor = Color
antialiased = flexible_true_trait
antialiased = flexible_true_trait

timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more
backends = ('GTKAgg', 'Cairo', 'GDK', 'GTK', 'Agg',
Expand All @@ -142,11 +142,11 @@ class PatchRC(traits.HasTraits):

class RC(traits.HasTraits):
backend = traits.Trait(*backends)
interactive = flexible_false_trait
toolbar = traits.Trait('toolbar2', 'classic', None)
timezone = traits.Trait(*timezones)
lines = traits.Trait(LineRC())
patch = traits.Trait(PatchRC())
interactive = flexible_false_trait
toolbar = traits.Trait('toolbar2', 'classic', None)
timezone = traits.Trait(*timezones)
lines = traits.Trait(LineRC())
patch = traits.Trait(PatchRC())

rc = RC()
rc.lines.color = 'r'
Expand Down
6 changes: 3 additions & 3 deletions examples/pylab_examples/bar_stacked.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@


N = 5
menMeans = (20, 35, 30, 35, 27)
menMeans = (20, 35, 30, 35, 27)
womenMeans = (25, 32, 34, 20, 25)
menStd = (2, 3, 4, 1, 2)
womenStd = (3, 5, 2, 3, 3)
menStd = (2, 3, 4, 1, 2)
womenStd = (3, 5, 2, 3, 3)
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars: can also be len(x) sequence

Expand Down
4 changes: 2 additions & 2 deletions examples/pylab_examples/finance_work2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ def moving_average_convergence(x, nslow=26, nfast=12):


fig = plt.figure(facecolor='white')
axescolor = '#f6f6f6' # the axes background color
axescolor = '#f6f6f6' # the axes background color

ax1 = fig.add_axes(rect1, axisbg=axescolor) #left, bottom, width, height
ax2 = fig.add_axes(rect2, axisbg=axescolor, sharex=ax1)
ax2t = ax2.twinx()
ax3 = fig.add_axes(rect3, axisbg=axescolor, sharex=ax1)
ax3 = fig.add_axes(rect3, axisbg=axescolor, sharex=ax1)


### plot the relative strength indicator
Expand Down
6 changes: 3 additions & 3 deletions examples/pylab_examples/fonts_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

### Show style options

style = ['normal', 'italic', 'oblique']
style = ['normal', 'italic', 'oblique']

t = text(-0.4, 0.9, 'style', fontproperties=font1,
**alignment)
Expand Down Expand Up @@ -75,8 +75,8 @@

### Show size options

size = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']
size = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']

t = text( 0.8, 0.9, 'size', fontproperties=font1,
**alignment)
Expand Down
6 changes: 3 additions & 3 deletions examples/pylab_examples/fonts_demo_kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

### Show style options

style = ['normal', 'italic', 'oblique']
style = ['normal', 'italic', 'oblique']

t = text(-0.4, 0.9, 'style', **alignment)

Expand Down Expand Up @@ -56,8 +56,8 @@

### Show size options

size = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']
size = ['xx-small', 'x-small', 'small', 'medium', 'large',
'x-large', 'xx-large']

t = text( 0.8, 0.9, 'size', **alignment)

Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/image_slices_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, ax, X):

self.X = X
rows,cols,self.slices = X.shape
self.ind = self.slices/2
self.ind = self.slices/2

self.im = ax.imshow(self.X[:,:,self.ind])
self.update()
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/line_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# If linestyle is omitted, 'solid' is used
# See matplotlib.collections.LineCollection for more information
line_segments = LineCollection(segs,
linewidths = (0.5,1,1.5,2),
linewidths = (0.5,1,1.5,2),
colors = [colorConverter.to_rgba(i) \
for i in ('b','g','r','c','m','y','k')],
linestyle = 'solid')
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/line_collection2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# If linestyle is omitted, 'solid' is used
# See matplotlib.collections.LineCollection for more information
line_segments = LineCollection([list(zip(x,y)) for y in ys], # Make a sequence of x,y pairs
linewidths = (0.5,1,1.5,2),
linewidths = (0.5,1,1.5,2),
linestyles = 'solid')
line_segments.set_array(x)
ax.add_collection(line_segments)
Expand Down
4 changes: 2 additions & 2 deletions examples/pylab_examples/major_minor_demo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
import numpy as np
from matplotlib.ticker import MultipleLocator, FormatStrFormatter

majorLocator = MultipleLocator(20)
majorLocator = MultipleLocator(20)
majorFormatter = FormatStrFormatter('%d')
minorLocator = MultipleLocator(5)
minorLocator = MultipleLocator(5)


t = np.arange(0.0, 100.0, 0.1)
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/major_minor_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# minorLocator = AutoMinorLocator(2)
# would lead to a single minor tick between major ticks.

minorLocator = AutoMinorLocator()
minorLocator = AutoMinorLocator()


t = np.arange(0.0, 100.0, 0.01)
Expand Down
4 changes: 2 additions & 2 deletions examples/pylab_examples/multiline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
text(2, 7,'this is\nyet another test',
rotation=45,
horizontalalignment = 'center',
verticalalignment = 'top',
multialignment = 'center')
verticalalignment = 'top',
multialignment = 'center')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is still superfluous white space around the assignment operators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll create a PR which fixes E251 (unexpected spaces around keyword / parameter equals) errors in the coming days.


grid(True)

Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/scatter_hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
x = np.random.randn(1000)
y = np.random.randn(1000)

nullfmt = NullFormatter() # no labels
nullfmt = NullFormatter() # no labels

# definitions for the axes
left, width = 0.1, 0.65
Expand Down
2 changes: 1 addition & 1 deletion examples/user_interfaces/interactive2.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def write(self,text):

end = self.buffer.get_end_iter()

if not self.view == None:
if not self.view == None:
self.view.scroll_to_mark(self.mark, 0, True, 1, 1)

self.buffer.insert_with_tags(end,text,self.style)
Expand Down
10 changes: 5 additions & 5 deletions examples/user_interfaces/mpl_with_glade.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

def simple_msg(msg, parent=None, title=None):
dialog = gtk.MessageDialog(
parent = None,
type = gtk.MESSAGE_INFO,
buttons = gtk.BUTTONS_OK,
parent = None,
type = gtk.MESSAGE_INFO,
buttons = gtk.BUTTONS_OK,
message_format = msg)
if parent is not None:
dialog.set_transient_for(parent)
Expand Down Expand Up @@ -58,8 +58,8 @@ def __init__(self):
self.canvas.show()
self.canvas.set_size_request(600, 400)
self.canvas.set_events(
gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.KEY_PRESS_MASK |
gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.KEY_PRESS_MASK |
gtk.gdk.KEY_RELEASE_MASK
)
self.canvas.set_flags(gtk.HAS_FOCUS|gtk.CAN_FOCUS)
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/slider_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

axcolor = 'lightgoldenrodyellow'
axfreq = plt.axes([0.25, 0.1, 0.65, 0.03], axisbg=axcolor)
axamp = plt.axes([0.25, 0.15, 0.65, 0.03], axisbg=axcolor)
axamp = plt.axes([0.25, 0.15, 0.65, 0.03], axisbg=axcolor)

sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=f0)
samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=a0)
Expand Down