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

Skip to content

Commit 56976cf

Browse files
authored
Merge pull request #10233 from anntzer/hide-unrendered-docstrings
Move unrendered docstrings to private attributes.
2 parents 12a3b4f + 5733e87 commit 56976cf

File tree

5 files changed

+163
-165
lines changed

5 files changed

+163
-165
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6041,7 +6041,7 @@ def contour(self, *args, **kwargs):
60416041
contours = mcontour.QuadContourSet(self, *args, **kwargs)
60426042
self.autoscale_view()
60436043
return contours
6044-
contour.__doc__ = mcontour.QuadContourSet.contour_doc
6044+
contour.__doc__ = mcontour.QuadContourSet._contour_doc
60456045

60466046
@_preprocess_data()
60476047
def contourf(self, *args, **kwargs):
@@ -6051,7 +6051,7 @@ def contourf(self, *args, **kwargs):
60516051
contours = mcontour.QuadContourSet(self, *args, **kwargs)
60526052
self.autoscale_view()
60536053
return contours
6054-
contourf.__doc__ = mcontour.QuadContourSet.contour_doc
6054+
contourf.__doc__ = mcontour.QuadContourSet._contour_doc
60556055

60566056
def clabel(self, CS, *args, **kwargs):
60576057
return CS.clabel(*args, **kwargs)
@@ -7865,11 +7865,11 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
78657865

78667866
def tricontour(self, *args, **kwargs):
78677867
return mtri.tricontour(self, *args, **kwargs)
7868-
tricontour.__doc__ = mtri.TriContourSet.tricontour_doc
7868+
tricontour.__doc__ = mtri.tricontour.__doc__
78697869

78707870
def tricontourf(self, *args, **kwargs):
78717871
return mtri.tricontourf(self, *args, **kwargs)
7872-
tricontourf.__doc__ = mtri.TriContourSet.tricontour_doc
7872+
tricontourf.__doc__ = mtri.tricontour.__doc__
78737873

78747874
def tripcolor(self, *args, **kwargs):
78757875
return mtri.tripcolor(self, *args, **kwargs)

lib/matplotlib/contour.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ def __init__(self, ax, *args, **kwargs):
779779
particular contour level are grouped together so that
780780
``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
781781
782-
Keyword arguments are as described in
783-
:attr:`matplotlib.contour.QuadContourSet.contour_doc`.
782+
Keyword arguments are as described in the docstring of
783+
`~.Axes.contour`.
784784
"""
785785
self.ax = ax
786786
self.levels = kwargs.pop('levels', None)
@@ -1571,7 +1571,7 @@ def _initialize_x_y(self, z):
15711571
y = y[::-1]
15721572
return np.meshgrid(x, y)
15731573

1574-
contour_doc = """
1574+
_contour_doc = """
15751575
Plot contours.
15761576
15771577
:func:`~matplotlib.pyplot.contour` and

lib/matplotlib/dviread.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class Dvi(object):
195195
"""
196196
# dispatch table
197197
_dtable = [None for _ in xrange(256)]
198-
dispatch = partial(_dispatch, _dtable)
198+
_dispatch = partial(_dispatch, _dtable)
199199

200200
def __init__(self, filename, dpi):
201201
"""
@@ -332,22 +332,22 @@ def _arg(self, nbytes, signed=False):
332332
value = 0x100*value + ord(str[i])
333333
return value
334334

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

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

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

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

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

372-
@dispatch(137, state=_dvistate.inpage, args=('s4', 's4'))
372+
@_dispatch(137, state=_dvistate.inpage, args=('s4', 's4'))
373373
def _put_rule(self, a, b):
374374
self._put_rule_real(a, b)
375375

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

380-
@dispatch(138)
380+
@_dispatch(138)
381381
def _nop(self, _):
382382
pass
383383

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

392-
@dispatch(140, state=_dvistate.inpage)
392+
@_dispatch(140, state=_dvistate.inpage)
393393
def _eop(self, _):
394394
self.state = _dvistate.outer
395395
del self.h, self.v, self.w, self.x, self.y, self.z, self.stack
396396

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

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

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

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

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

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

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

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

437-
@dispatch(min=171, max=234, state=_dvistate.inpage)
437+
@_dispatch(min=171, max=234, state=_dvistate.inpage)
438438
def _fnt_num_immediate(self, k):
439439
self.f = k
440440

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

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

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

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

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

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

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

503-
@dispatch(249)
503+
@_dispatch(249)
504504
def _post_post(self, _):
505505
raise NotImplementedError
506506

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

0 commit comments

Comments
 (0)