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

Skip to content

Commit bb3ea55

Browse files
committed
Merge pull request #1350 from NelleV/pep8_units
PEP8 fixes on units.py
2 parents 8a38947 + 8761c51 commit bb3ea55

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/matplotlib/units.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ def default_units(x, axis):
4343
4444
"""
4545
from __future__ import print_function
46-
import numpy as np
47-
from matplotlib.cbook import iterable, is_numlike, is_string_like
46+
from matplotlib.cbook import iterable, is_numlike
47+
4848

4949
class AxisInfo:
50-
'information to support default axis labeling and tick labeling, and default limits'
50+
"""information to support default axis labeling and tick labeling, and
51+
default limits"""
5152
def __init__(self, majloc=None, minloc=None,
5253
majfmt=None, minfmt=None, label=None,
5354
default_limits=None):
@@ -107,6 +108,7 @@ def is_numlike(x):
107108
else:
108109
return is_numlike(x)
109110

111+
110112
class Registry(dict):
111113
"""
112114
register types with conversion interface
@@ -118,7 +120,8 @@ def __init__(self):
118120
def get_converter(self, x):
119121
'get the converter interface instance for x, or None'
120122

121-
if not len(self): return None # nothing registered
123+
if not len(self):
124+
return None # nothing registered
122125
#DISABLED idx = id(x)
123126
#DISABLED cached = self._cached.get(idx)
124127
#DISABLED if cached is not None: return cached
@@ -131,11 +134,11 @@ def get_converter(self, x):
131134

132135
if converter is None and iterable(x):
133136
for thisx in x:
134-
# Make sure that recursing might actually lead to a solution, if
135-
# we are just going to re-examine another item of the same kind,
136-
# then do not look at it.
137+
# Make sure that recursing might actually lead to a solution,
138+
# if we are just going to re-examine another item of the same
139+
# kind, then do not look at it.
137140
if classx and classx != getattr(thisx, '__class__', None):
138-
converter = self.get_converter( thisx )
141+
converter = self.get_converter(thisx)
139142
return converter
140143

141144
#DISABLED self._cached[idx] = converter

0 commit comments

Comments
 (0)