diff --git a/lib/matplotlib/units.py b/lib/matplotlib/units.py index b85d84a4aaf6..0bbe697b54f8 100644 --- a/lib/matplotlib/units.py +++ b/lib/matplotlib/units.py @@ -43,11 +43,12 @@ def default_units(x, axis): """ from __future__ import print_function -import numpy as np -from matplotlib.cbook import iterable, is_numlike, is_string_like +from matplotlib.cbook import iterable, is_numlike + class AxisInfo: - 'information to support default axis labeling and tick labeling, and default limits' + """information to support default axis labeling and tick labeling, and + default limits""" def __init__(self, majloc=None, minloc=None, majfmt=None, minfmt=None, label=None, default_limits=None): @@ -107,6 +108,7 @@ def is_numlike(x): else: return is_numlike(x) + class Registry(dict): """ register types with conversion interface @@ -118,7 +120,8 @@ def __init__(self): def get_converter(self, x): 'get the converter interface instance for x, or None' - if not len(self): return None # nothing registered + if not len(self): + return None # nothing registered #DISABLED idx = id(x) #DISABLED cached = self._cached.get(idx) #DISABLED if cached is not None: return cached @@ -131,11 +134,11 @@ def get_converter(self, x): if converter is None and iterable(x): for thisx in x: - # Make sure that recursing might actually lead to a solution, if - # we are just going to re-examine another item of the same kind, - # then do not look at it. + # Make sure that recursing might actually lead to a solution, + # if we are just going to re-examine another item of the same + # kind, then do not look at it. if classx and classx != getattr(thisx, '__class__', None): - converter = self.get_converter( thisx ) + converter = self.get_converter(thisx) return converter #DISABLED self._cached[idx] = converter