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

Skip to content

PEP8 fixes on units.py #1350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions lib/matplotlib/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -107,6 +108,7 @@ def is_numlike(x):
else:
return is_numlike(x)


class Registry(dict):
"""
register types with conversion interface
Expand All @@ -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
Expand All @@ -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
Expand Down