PEP8 fixes on contour.py #1395

Merged
merged 1 commit into from Nov 9, 2012

3 participants

@NelleV

PEP8 fixes on module contour.

Thanks,
N.

@dmcdougall dmcdougall commented on an outdated diff Nov 7, 2012
lib/matplotlib/contour.py
else:
return [mpath.Path(seg) for seg in segs]
def changed(self):
- tcolors = [ (tuple(rgba),) for rgba in
- self.to_rgba(self.cvalues, alpha=self.alpha)]
+ tcolors = [(tuple(rgba),) for rgba
+ in self.to_rgba(self.cvalues, alpha=self.alpha)]
@dmcdougall
Matplotlib Developers member

Perhaps move the for rgba part of the list comprehension into this line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dmcdougall dmcdougall commented on the diff Nov 7, 2012
lib/matplotlib/contour.py
@@ -1341,8 +1365,9 @@ def _get_allsegs_and_allkinds(self):
lowers, uppers = self._get_lowers_and_uppers()
allkinds = []
for level, level_upper in zip(lowers, uppers):
- nlist = self.Cntr.trace(level, level_upper, nchunk = self.nchunk)
- nseg = len(nlist)//2
+ nlist = self.Cntr.trace(level, level_upper,
+ nchunk=self.nchunk)
+ nseg = len(nlist) // 2
@dmcdougall
Matplotlib Developers member

What does // do?

@WeatherGod
Matplotlib Developers member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@NelleV

Done,

Cheers,
N

@efiring efiring commented on an outdated diff Nov 8, 2012
lib/matplotlib/contour.py
artists.append(patch)
lower = str_format(lower)
upper = str_format(upper)
if i == 0 and self.extend in ('min', 'both'):
- labels.append(r'$%s \leq %s$' % (variable_name, lower, ))
- elif i == n_levels-1 and self.extend in ('max', 'both'):
- labels.append(r'$%s > %s$' % (variable_name, upper, ))
+ labels.append(r'$%s \leq %s$' % (variable_name,
+ lower, ))
+ elif i == n_levels - 1 and self.extend in ('max', 'both'):
+ labels.append(r'$%s > %s$' % (variable_name,
+ upper, ))
@efiring
Matplotlib Developers member
efiring added a note Nov 8, 2012

Looks like the trailing commas are just a distraction; you might as well go ahead and remove them.

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

I've removed the unnecessary commas

@dmcdougall
Matplotlib Developers member

Thanks. Does anyone else have any feedback for @NelleV?

@efiring efiring merged commit 2044223 into matplotlib:master Nov 9, 2012

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment