8000 PEP8 fixes on scale.py · matplotlib/matplotlib@de2d048 · GitHub
[go: up one dir, main page]

Skip to content

Commit de2d048

Browse files
NelleVdmcdougall
authored andcommitted
PEP8 fixes on scale.py
1 parent 6305a82 commit de2d048

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

lib/matplotlib/scale.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from numpy import ma
55

66
from matplotlib.cbook import dedent
7-
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
7+
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
88
LogFormatterMathtext)
9-
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
9+
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
1010
SymmetricalLogLocator)
1111
from matplotlib.transforms import Transform, IdentityTransform
1212
from matplotlib import docstring
@@ -120,7 +120,7 @@ class LogTransformBase(Transform):
120120
output_dims = 1
121121
is_separable = True
122122
has_inverse = True
123-
123+
124124
def __init__(self, nonpos):
125125
Transform.__init__(self)
126126
if nonpos == 'mask':
@@ -208,7 +208,7 @@ class LogTransform(Transform):
208208
output_dims = 1
209209
is_separable = True
210210
has_inverse = True
211-
211+
212212
def __init__(self, base, nonpos):
213213
Transform.__init__(self)
214214
self.base = base
@@ -231,7 +231,7 @@ class InvertedLogTransform(Transform):
231231
output_dims = 1
232232
is_separable = True
233233
has_inverse = True
234-
234+
235235
def __init__(self, base):
236236
Transform.__init__(self)
237237
self.base = base
@@ -241,7 +241,7 @@ def transform_non_affine(self, a):
241241

242242
def inverted(self):
243243
return LogScale.LogTransform(self.base)
244-
244+
245245
def __init__(self, axis, **kwargs):
246246
"""
247247
*basex*/*basey*:
@@ -325,7 +325,7 @@ class SymmetricalLogTransform(Transform):
325325
output_dims = 1
326326
is_separable = True
327327
has_inverse = True
328-
328+
329329
def __init__(self, base, linthresh, linscale):
330330
Transform.__init__(self)
331331
self.base = base
@@ -336,7 +336,10 @@ def __init__(self, base, linthresh, linscale):
336336

337337
def transform_non_affine(self, a):
338338
sign = np.sign(a)
339-
masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False)
339+
masked = ma.masked_inside(a,
340+
-self.linthresh,
341+
self.linthresh,
342+
copy=False)
340343
log = sign * self.linthresh * (
341344
self._linscale_adj +
342345
ma.log(np.abs(masked) / self.linthresh) / self._log_base)
@@ -354,10 +357,12 @@ class InvertedSymmetricalLogTransform(Transform):
354357
output_dims = 1
355358
is_separable = True
356359
has_inverse = True
357-
360+
358361
def __init__(self, base, linthresh, linscale):
359362
Transform.__init__(self)
360-
symlog = SymmetricalLogScale.SymmetricalLogTransform(base, linthresh, linscale)
363+
symlog = SymmetricalLogScale.SymmetricalLogTransform(base,
364+
linthresh,
365+
linscale)
361366
self.base = base
362367
self.linthresh = linthresh
363368
self.invlinthresh = symlog.transform(linthresh)
@@ -366,7 +371,8 @@ def __init__(self, base, linthresh, linscale):
366371

367372
def transform_non_affine(self, a):
368373
sign = np.sign(a)
369-
masked = ma.masked_inside(a, -self.invlinthresh, self.invlinthresh, copy=False)
374+
masked = ma.masked_inside(a, -self.invlinthresh,
375+
self.invlinthresh, copy=False)
370376
exp = sign * self.linthresh * (
371377
ma.power(self.base, (sign * (masked / self.linthresh))
372378
- self._linscale_adj))
@@ -420,7 +426,9 @@ def __init__(self, axis, **kwargs):
420426
assert linthresh > 0.0
421427
assert linscale >= 1.0
422428

423-
self._transform = self.SymmetricalLogTransform(base, linthresh, linscale)
429+
self._transform = self.SymmetricalLogTransform(base,
430+
linthresh,
431+
linscale)
424432

425433
self.base = base
426434
self.linthresh = linthresh
@@ -434,7 +442,8 @@ def set_default_locators_and_formatters(self, axis):
434442
"""
435443
axis.set_major_locator(SymmetricalLogLocator(self.get_transform()))
436444
axis.set_major_formatter(LogFormatterMathtext(self.base))
437-
axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(), self.subs))
445+
axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(),
446+
self.subs))
438447
axis.set_minor_formatter(NullFormatter())
439448

440449
def get_transform(self):
@@ -445,9 +454,9 @@ def get_transform(self):
445454

446455

447456
_scale_mapping = {
448-
'linear' : LinearScale,
449-
'log' : LogScale,
450-
'symlog' : SymmetricalLogScale
457+
'linear': LinearScale,
458+
'log': LogScale,
459+
'symlog': SymmetricalLogScale
451460
}
452461

453462

@@ -502,6 +511,6 @@ def get_scale_docs():
502511

503512

504513
docstring.interpd.update(
505-
scale = ' | '.join([repr(x) for x in get_scale_names()]),
506-
scale_docs = get_scale_docs().strip(),
514+
scale=' | '.join([repr(x) for x in get_scale_names()]),
515+
scale_docs=get_scale_docs().strip(),
507516
)

0 commit comments

Comments
 (0)
0