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

Skip to content

Move unrendered docstrings to private attributes. #10233

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
Jan 15, 2018
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6032,7 +6032,7 @@ def contour(self, *args, **kwargs):
contours = mcontour.QuadContourSet(self, *args, **kwargs)
self.autoscale_view()
return contours
contour.__doc__ = mcontour.QuadContourSet.contour_doc
contour.__doc__ = mcontour.QuadContourSet._contour_doc

@_preprocess_data()
def contourf(self, *args, **kwargs):
Expand All @@ -6042,7 +6042,7 @@ def contourf(self, *args, **kwargs):
contours = mcontour.QuadContourSet(self, *args, **kwargs)
self.autoscale_view()
return contours
contourf.__doc__ = mcontour.QuadContourSet.contour_doc
contourf.__doc__ = mcontour.QuadContourSet._contour_doc

def clabel(self, CS, *args, **kwargs):
return CS.clabel(*args, **kwargs)
Expand Down Expand Up @@ -7856,11 +7856,11 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,

def tricontour(self, *args, **kwargs):
return mtri.tricontour(self, *args, **kwargs)
tricontour.__doc__ = mtri.TriContourSet.tricontour_doc
tricontour.__doc__ = mtri.tricontour.__doc__

def tricontourf(self, *args, **kwargs):
return mtri.tricontourf(self, *args, **kwargs)
tricontourf.__doc__ = mtri.TriContourSet.tricontour_doc
tricontourf.__doc__ = mtri.tricontour.__doc__

def tripcolor(self, *args, **kwargs):
return mtri.tripcolor(self, *args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ def __init__(self, ax, *args, **kwargs):
particular contour level are grouped together so that
``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.

Keyword arguments are as described in
:attr:`matplotlib.contour.QuadContourSet.contour_doc`.
Keyword arguments are as described in the docstring of
`~.Axes.contour`.
"""
self.ax = ax
self.levels = kwargs.pop('levels', None)
Expand Down Expand Up @@ -1571,7 +1571,7 @@ def _initialize_x_y(self, z):
y = y[::-1]
return np.meshgrid(x, y)

contour_doc = """
_contour_doc = """
Plot contours.

:func:`~matplotlib.pyplot.contour` and
Expand Down
50 changes: 25 additions & 25 deletions lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Dvi(object):
"""
# dispatch table
_dtable = [None for _ in xrange(256)]
dispatch = partial(_dispatch, _dtable)
_dispatch = partial(_dispatch, _dtable)

def __init__(self, filename, dpi):
"""
Expand Down Expand Up @@ -332,22 +332,22 @@ def _arg(self, nbytes, signed=False):
value = 0x100*value + ord(str[i])
return value

@dispatch(min=0, max=127, state=_dvistate.inpage)
@_dispatch(min=0, max=127, state=_dvistate.inpage)
def _set_char_immediate(self, char):
self._put_char_real(char)
self.h += self.fonts[self.f]._width_of(char)

@dispatch(min=128, max=131, state=_dvistate.inpage, args=('olen1',))
@_dispatch(min=128, max=131, state=_dvistate.inpage, args=('olen1',))
def _set_char(self, char):
self._put_char_real(char)
self.h += self.fonts[self.f]._width_of(char)

@dispatch(132, state=_dvistate.inpage, args=('s4', 's4'))
@_dispatch(132, state=_dvistate.inpage, args=('s4', 's4'))
def _set_rule(self, a, b):
self._put_rule_real(a, b)
self.h += b

@dispatch(min=133, max=136, state=_dvistate.inpage, args=('olen1',))
@_dispatch(min=133, max=136, state=_dvistate.inpage, args=('olen1',))
def _put_char(self, char):
self._put_char_real(char)

Expand All @@ -369,80 +369,80 @@ def _put_char_real(self, char):
_mul2012(a, scale), _mul2012(b, scale))
for x, y, a, b in font._vf[char].boxes])

@dispatch(137, state=_dvistate.inpage, args=('s4', 's4'))
@_dispatch(137, state=_dvistate.inpage, args=('s4', 's4'))
def _put_rule(self, a, b):
self._put_rule_real(a, b)

def _put_rule_real(self, a, b):
if a > 0 and b > 0:
self.boxes.append(Box(self.h, self.v, a, b))

@dispatch(138)
@_dispatch(138)
def _nop(self, _):
pass

@dispatch(139, state=_dvistate.outer, args=('s4',)*11)
@_dispatch(139, state=_dvistate.outer, args=('s4',)*11)
def _bop(self, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, p):
self.state = _dvistate.inpage
self.h, self.v, self.w, self.x, self.y, self.z = 0, 0, 0, 0, 0, 0
self.stack = []
self.text = [] # list of Text objects
self.boxes = [] # list of Box objects

@dispatch(140, state=_dvistate.inpage)
@_dispatch(140, state=_dvistate.inpage)
def _eop(self, _):
self.state = _dvistate.outer
del self.h, self.v, self.w, self.x, self.y, self.z, self.stack

@dispatch(141, state=_dvistate.inpage)
@_dispatch(141, state=_dvistate.inpage)
def _push(self, _):
self.stack.append((self.h, self.v, self.w, self.x, self.y, self.z))

@dispatch(142, state=_dvistate.inpage)
@_dispatch(142, state=_dvistate.inpage)
def _pop(self, _):
self.h, self.v, self.w, self.x, self.y, self.z = self.stack.pop()

@dispatch(min=143, max=146, state=_dvistate.inpage, args=('slen1',))
@_dispatch(min=143, max=146, state=_dvistate.inpage, args=('slen1',))
def _right(self, b):
self.h += b

@dispatch(min=147, max=151, state=_dvistate.inpage, args=('slen',))
@_dispatch(min=147, max=151, state=_dvistate.inpage, args=('slen',))
def _right_w(self, new_w):
if new_w is not None:
self.w = new_w
self.h += self.w

@dispatch(min=152, max=156, state=_dvistate.inpage, args=('slen',))
@_dispatch(min=152, max=156, state=_dvistate.inpage, args=('slen',))
def _right_x(self, new_x):
if new_x is not None:
self.x = new_x
self.h += self.x

@dispatch(min=157, max=160, state=_dvistate.inpage, args=('slen1',))
@_dispatch(min=157, max=160, state=_dvistate.inpage, args=('slen1',))
def _down(self, a):
self.v += a

@dispatch(min=161, max=165, state=_dvistate.inpage, args=('slen',))
@_dispatch(min=161, max=165, state=_dvistate.inpage, args=('slen',))
def _down_y(self, new_y):
if new_y is not None:
self.y = new_y
self.v += self.y

@dispatch(min=166, max=170, state=_dvistate.inpage, args=('slen',))
@_dispatch(min=166, max=170, state=_dvistate.inpage, args=('slen',))
def _down_z(self, new_z):
if new_z is not None:
self.z = new_z
self.v += self.z

@dispatch(min=171, max=234, state=_dvistate.inpage)
@_dispatch(min=171, max=234, state=_dvistate.inpage)
def _fnt_num_immediate(self, k):
self.f = k

@dispatch(min=235, max=238, state=_dvistate.inpage, args=('olen1',))
@_dispatch(min=235, max=238, state=_dvistate.inpage, args=('olen1',))
def _fnt_num(self, new_f):
self.f = new_f

@dispatch(min=239, max=242, args=('ulen1',))
@_dispatch(min=239, max=242, args=('ulen1',))
def _xxx(self, datalen):
special = self.file.read(datalen)
if six.PY3:
Expand All @@ -455,7 +455,7 @@ def chr_(x):
''.join([chr_(ch) if 32 <= ord(ch) < 127 else '<%02x>' % ord(ch)
for ch in special]))

@dispatch(min=243, max=246, args=('olen1', 'u4', 'u4', 'u4', 'u1', 'u1'))
@_dispatch(min=243, max=246, args=('olen1', 'u4', 'u4', 'u4', 'u1', 'u1'))
def _fnt_def(self, k, c, s, d, a, l):
self._fnt_def_real(k, c, s, d, a, l)

Expand All @@ -476,7 +476,7 @@ def _fnt_def_real(self, k, c, s, d, a, l):

self.fonts[k] = DviFont(scale=s, tfm=tfm, texname=n, vf=vf)

@dispatch(247, state=_dvistate.pre, args=('u1', 'u4', 'u4', 'u4', 'u1'))
@_dispatch(247, state=_dvistate.pre, args=('u1', 'u4', 'u4', 'u4', 'u1'))
def _pre(self, i, num, den, mag, k):
comment = self.file.read(k)
if i != 2:
Expand All @@ -494,17 +494,17 @@ def _pre(self, i, num, den, mag, k):
# I think we can assume this is constant
self.state = _dvistate.outer

@dispatch(248, state=_dvistate.outer)
@_dispatch(248, state=_dvistate.outer)
def _post(self, _):
self.state = _dvistate.post_post
# TODO: actually read the postamble and finale?
# currently post_post just triggers closing the file

@dispatch(249)
@_dispatch(249)
def _post_post(self, _):
raise NotImplementedError

@dispatch(min=250, max=255)
@_dispatch(min=250, max=255)
def _malformed(self, offset):
raise ValueError("unknown command: byte %d", 250 + offset)

Expand Down
Loading