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

Skip to content

Commit e6419cf

Browse files
committed
PEP8 : comment-related pep8
Fixes 'violations' we don't test for, all white space in comments.
1 parent af17051 commit e6419cf

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

lib/matplotlib/quiver.py

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ def on_dpi_change(fig):
247247
if self_weakref is not None:
248248
self_weakref.labelsep = (self_weakref._labelsep_inches*fig.dpi)
249249
self_weakref._initialized = False # simple brute force update
250-
# works because _init is called
251-
# at the start of draw.
250+
# works because _init is
251+
# called at the start of
252+
# draw.
252253

253254
self._cid = Q.ax.figure.callbacks.connect('dpi_changed',
254255
on_dpi_change)
@@ -258,7 +259,7 @@ def on_dpi_change(fig):
258259
self.fontproperties = kw.pop('fontproperties', dict())
259260
self.kw = kw
260261
_fp = self.fontproperties
261-
#boxprops = dict(facecolor='red')
262+
# boxprops = dict(facecolor='red')
262263
self.text = mtext.Text(
263264
text=label, # bbox=boxprops,
264265
horizontalalignment=self.halign[self.labelpos],
@@ -465,10 +466,11 @@ def on_dpi_change(fig):
465466
self_weakref = weak_self()
466467
if self_weakref is not None:
467468
self_weakref._new_UV = True # vertices depend on width, span
468-
# which in turn depend on dpi
469+
# which in turn depend on dpi
469470
self_weakref._initialized = False # simple brute force update
470-
# works because _init is called
471-
# at the start of draw.
471+
# works because _init is
472+
# called at the start of
473+
# draw.
472474

473475
self._cid = self.ax.figure.callbacks.connect('dpi_changed',
474476
on_dpi_change)
@@ -667,7 +669,7 @@ def _h_arrows(self, length):
667669
length = length.reshape(N, 1)
668670
# This number is chosen based on when pixel values overflow in Agg
669671
# causing rendering errors
670-
#length = np.minimum(length, 2 ** 16)
672+
# length = np.minimum(length, 2 ** 16)
671673
np.clip(length, 0, 2 ** 16, out=length)
672674
# x, y: normal horizontal arrow
673675
x = np.array([0, -self.headaxislength,
@@ -870,9 +872,9 @@ class Barbs(mcollections.PolyCollection):
870872
From there :meth:`_make_barbs` is used to find the vertices of the
871873
polygon to represent the barb based on this information.
872874
'''
873-
#This may be an abuse of polygons here to render what is essentially maybe
874-
#1 triangle and a series of lines. It works fine as far as I can tell
875-
#however.
875+
# This may be an abuse of polygons here to render what is essentially maybe
876+
# 1 triangle and a series of lines. It works fine as far as I can tell
877+
# however.
876878
@docstring.interpd
877879
def __init__(self, ax, *args, **kw):
878880
"""
@@ -892,30 +894,31 @@ def __init__(self, ax, *args, **kw):
892894
self.flip = kw.pop('flip_barb', False)
893895
transform = kw.pop('transform', ax.transData)
894896

895-
#Flagcolor and and barbcolor provide convenience parameters for setting
896-
#the facecolor and edgecolor, respectively, of the barb polygon. We
897-
#also work here to make the flag the same color as the rest of the barb
898-
#by default
897+
# Flagcolor and and barbcolor provide convenience parameters for
898+
# setting the facecolor and edgecolor, respectively, of the barb
899+
# polygon. We also work here to make the flag the same color as the
900+
# rest of the barb by default
901+
899902
if None in (barbcolor, flagcolor):
900903
kw['edgecolors'] = 'face'
901904
if flagcolor:
902905
kw['facecolors'] = flagcolor
903906
elif barbcolor:
904907
kw['facecolors'] = barbcolor
905908
else:
906-
#Set to facecolor passed in or default to black
909+
# Set to facecolor passed in or default to black
907910
kw.setdefault('facecolors', 'k')
908911
else:
909912
kw['edgecolors'] = barbcolor
910913
kw['facecolors'] = flagcolor
911914

912-
#Parse out the data arrays from the various configurations supported
915+
# Parse out the data arrays from the various configurations supported
913916
x, y, u, v, c = _parse_args(*args)
914917
self.x = x
915918
self.y = y
916919
xy = np.hstack((x[:, np.newaxis], y[:, np.newaxis]))
917920

918-
#Make a collection
921+
# Make a collection
919922
barb_size = self._length ** 2 / 4 # Empirically determined
920923
mcollections.PolyCollection.__init__(self, [], (barb_size,),
921924
offsets=xy,
@@ -940,8 +943,8 @@ def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):
940943
a barb is empty (too low to plot any barbs/flags.
941944
'''
942945

943-
#If rounding, round to the nearest multiple of half, the smallest
944-
#increment
946+
# If rounding, round to the nearest multiple of half, the smallest
947+
# increment
945948
if rounding:
946949
mag = half * (mag / half + 0.5).astype(np.int)
947950

@@ -1002,17 +1005,17 @@ def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length,
10021005
properly align with the vector direction.
10031006
'''
10041007

1005-
#These control the spacing and size of barb elements relative to the
1006-
#length of the shaft
1008+
# These control the spacing and size of barb elements relative to the
1009+
# length of the shaft
10071010
spacing = length * sizes.get('spacing', 0.125)
10081011
full_height = length * sizes.get('height', 0.4)
10091012
full_width = length * sizes.get('width', 0.25)
10101013
empty_rad = length * sizes.get('emptybarb', 0.15)
10111014

1012-
#Controls y point where to pivot the barb.
1015+
# Controls y point where to pivot the barb.
10131016
pivot_points = dict(tip=0.0, middle=-length / 2.)
10141017

1015-
#Check for flip
1018+
# Check for flip
10161019
if flip:
10171020
full_height = -full_height
10181021

@@ -1039,11 +1042,11 @@ def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length,
10391042

10401043
barb_list = []
10411044
for index, angle in np.ndenumerate(angles):
1042-
#If the vector magnitude is too weak to draw anything, plot an
1043-
#empty circle instead
1045+
# If the vector magnitude is too weak to draw anything, plot an
1046+
# empty circle instead
10441047
if empty_flag[index]:
1045-
#We can skip the transform since the circle has no preferred
1046-
#orientation
1048+
# We can skip the transform since the circle has no preferred
1049+
# orientation
10471050
barb_list.append(empty_barb)
10481051
continue
10491052

0 commit comments

Comments
 (0)