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

Skip to content

Commit 62e7b17

Browse files
committed
DOC: Fix types of return values.
The numpydoc standard says there should not be a name if there's only one return value. Additionally, split up some return types that are tuples, because they really should get separate entries for each value.
1 parent 19dd0eb commit 62e7b17

40 files changed

+176
-158
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@ def _add_data_doc(docstring, replace_names):
13091309
13101310
Returns
13111311
-------
1312+
str
13121313
The augmented docstring.
13131314
"""
13141315
if (docstring is None

lib/matplotlib/afm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def _parse_composites(fh):
286286
287287
Returns
288288
-------
289-
composites : dict
289+
dict
290290
A dict mapping composite character names to a parts list. The parts
291291
list is a list of `.CompositePart` entries describing the parts of
292292
the composite.

lib/matplotlib/animation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def is_available(self, name):
140140
141141
Returns
142142
-------
143-
available : bool
143+
bool
144144
"""
145145
try:
146146
cls = self._registered[name]
@@ -1281,7 +1281,7 @@ def to_html5_video(self, embed_limit=None):
12811281
12821282
Returns
12831283
-------
1284-
video_tag : str
1284+
str
12851285
An HTML5 video tag with the animation embedded as base64 encoded
12861286
h264 video.
12871287
If the *embed_limit* is exceeded, this returns the string

lib/matplotlib/artist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def get_tightbbox(self, renderer):
274274
275275
Returns
276276
-------
277-
bbox : `.Bbox`
277+
`.Bbox`
278278
The enclosing bounding box (in figure pixel coordinates).
279279
"""
280280
bbox = self.get_window_extent(renderer)
@@ -305,7 +305,7 @@ def func(artist: Artist) -> Any
305305
306306
Returns
307307
-------
308-
oid : int
308+
int
309309
The observer id associated with the callback. This id can be
310310
used for removing the callback with `.remove_callback` later.
311311
@@ -629,7 +629,7 @@ def get_sketch_params(self):
629629
630630
Returns
631631
-------
632-
sketch_params : tuple or None
632+
tuple or None
633633
634634
A 3-tuple with the following elements:
635635
@@ -1109,7 +1109,7 @@ def findobj(self, match=None, include_self=True):
11091109
11101110
Returns
11111111
-------
1112-
artists : list of `.Artist`
1112+
list of `.Artist`
11131113
11141114
"""
11151115
if match is None: # always return True
@@ -1599,7 +1599,7 @@ def kwdoc(artist):
15991599
16001600
Returns
16011601
-------
1602-
string
1602+
str
16031603
The settable properties of *artist*, as plain text if
16041604
:rc:`docstring.hardcopy` is False and as a rst table (intended for
16051605
use in Sphinx) if it is True.

lib/matplotlib/axes/_axes.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_title(self, loc="center"):
104104
105105
Returns
106106
-------
107-
title : str
107+
str
108108
The title text string.
109109
110110
"""
@@ -145,7 +145,7 @@ def set_title(self, label, fontdict=None, loc=None, pad=None, **kwargs):
145145
146146
Returns
147147
-------
148-
text : `.Text`
148+
`.Text`
149149
The matplotlib text instance representing the title
150150
151151
Other Parameters
@@ -379,7 +379,7 @@ def legend(self, *args, **kwargs):
379379
380380
Returns
381381
-------
382-
legend : `~matplotlib.legend.Legend`
382+
`~matplotlib.legend.Legend`
383383
384384
Other Parameters
385385
----------------
@@ -708,7 +708,7 @@ def text(self, x, y, s, fontdict=None, **kwargs):
708708
709709
Returns
710710
-------
711-
text : `.Text`
711+
`.Text`
712712
The created `.Text` instance.
713713
714714
Other Parameters
@@ -784,7 +784,7 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
784784
785785
Returns
786786
-------
787-
line : `~matplotlib.lines.Line2D`
787+
`~matplotlib.lines.Line2D`
788788
789789
Other Parameters
790790
----------------
@@ -853,7 +853,7 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
853853
854854
Returns
855855
-------
856-
line : `~matplotlib.lines.Line2D`
856+
`~matplotlib.lines.Line2D`
857857
858858
Other Parameters
859859
----------------
@@ -984,7 +984,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
984984
985985
Returns
986986
-------
987-
rectangle : `~matplotlib.patches.Polygon`
987+
`~matplotlib.patches.Polygon`
988988
Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).
989989
990990
Other Parameters
@@ -1036,7 +1036,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
10361036
10371037
Returns
10381038
-------
1039-
rectangle : `~matplotlib.patches.Polygon`
1039+
`~matplotlib.patches.Polygon`
10401040
Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
10411041
10421042
Other Parameters
@@ -1097,7 +1097,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
10971097
10981098
Returns
10991099
-------
1100-
lines : `~matplotlib.collections.LineCollection`
1100+
`~matplotlib.collections.LineCollection`
11011101
11021102
Other Parameters
11031103
----------------
@@ -1175,7 +1175,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
11751175
11761176
Returns
11771177
-------
1178-
lines : `~matplotlib.collections.LineCollection`
1178+
`~matplotlib.collections.LineCollection`
11791179
11801180
Other Parameters
11811181
----------------
@@ -1311,7 +1311,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
13111311
13121312
Returns
13131313
-------
1314-
list : list of `.EventCollection`
1314+
list of `.EventCollection`
13151315
The `.EventCollection` that were added.
13161316
13171317
Notes
@@ -1574,8 +1574,8 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
15741574
15751575
Returns
15761576
-------
1577-
lines
1578-
A list of `.Line2D` objects representing the plotted data.
1577+
list of `.Line2D`
1578+
A list of lines representing the plotted data.
15791579
15801580
Other Parameters
15811581
----------------
@@ -2257,7 +2257,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
22572257
22582258
Returns
22592259
-------
2260-
container : `.BarContainer`
2260+
`.BarContainer`
22612261
Container with all the bars and optionally errorbars.
22622262
22632263
Other Parameters
@@ -2530,7 +2530,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
25302530
25312531
Returns
25322532
-------
2533-
container : `.BarContainer`
2533+
`.BarContainer`
25342534
Container with all the bars and optionally errorbars.
25352535
25362536
Other Parameters
@@ -2625,7 +2625,7 @@ def broken_barh(self, xranges, yrange, **kwargs):
26252625
26262626
Returns
26272627
-------
2628-
collection : `~.collections.BrokenBarHCollection`
2628+
`~.collections.BrokenBarHCollection`
26292629
26302630
Other Parameters
26312631
----------------
@@ -2744,7 +2744,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
27442744
27452745
Returns
27462746
-------
2747-
container : `.StemContainer`
2747+
`.StemContainer`
27482748
The container may be treated like a tuple
27492749
(*markerline*, *stemlines*, *baseline*)
27502750
@@ -3164,7 +3164,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
31643164
31653165
Returns
31663166
-------
3167-
container : `.ErrorbarContainer`
3167+
`.ErrorbarContainer`
31683168
The container contains:
31693169
31703170
- plotline: `.Line2D` instance of x, y plot markers and/or line.
@@ -3603,7 +3603,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
36033603
36043604
Returns
36053605
-------
3606-
result : dict
3606+
dict
36073607
A dictionary mapping each component of the boxplot to a list
36083608
of the `.Line2D` instances created. That dictionary has the
36093609
following keys (assuming vertical boxplots):
@@ -3879,7 +3879,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True,
38793879
38803880
Returns
38813881
-------
3882-
result : dict
3882+
dict
38833883
A dictionary mapping each component of the boxplot to a list
38843884
of the `.Line2D` instances created. That dictionary has the
38853885
following keys (assuming vertical boxplots):
@@ -4364,7 +4364,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43644364
43654365
Returns
43664366
-------
4367-
paths : `~matplotlib.collections.PathCollection`
4367+
`~matplotlib.collections.PathCollection`
43684368
43694369
Other Parameters
43704370
----------------
@@ -4552,7 +4552,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
45524552
45534553
Returns
45544554
-------
4555-
polycollection : `~matplotlib.collections.PolyCollection`
4555+
`~matplotlib.collections.PolyCollection`
45564556
A `.PolyCollection` defining the hexagonal bins.
45574557
45584558
- `.PolyCollection.get_offset` contains a Mx2 array containing
@@ -4929,7 +4929,7 @@ def arrow(self, x, y, dx, dy, **kwargs):
49294929
49304930
Returns
49314931
-------
4932-
arrow : `.FancyArrow`
4932+
`.FancyArrow`
49334933
The created `.FancyArrow` object.
49344934
49354935
Notes
@@ -5432,7 +5432,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54325432
54335433
Returns
54345434
-------
5435-
image : `~matplotlib.image.AxesImage`
5435+
`~matplotlib.image.AxesImage`
54365436
54375437
Other Parameters
54385438
----------------
@@ -5698,7 +5698,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
56985698
56995699
Returns
57005700
-------
5701-
collection : `matplotlib.collections.Collection`
5701+
`matplotlib.collections.Collection`
57025702
57035703
Other Parameters
57045704
----------------
@@ -5951,7 +5951,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
59515951
59525952
Returns
59535953
-------
5954-
mesh : `matplotlib.collections.QuadMesh`
5954+
`matplotlib.collections.QuadMesh`
59555955
59565956
Other Parameters
59575957
----------------
@@ -6164,7 +6164,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
61646164
61656165
Returns
61666166
-------
6167-
image : `.AxesImage` or `.PcolorImage` or `.QuadMesh`
6167+
`.AxesImage` or `.PcolorImage` or `.QuadMesh`
61686168
The return type depends on the type of grid:
61696169
61706170
- `.AxesImage` for a regular rectangular grid.
@@ -7554,7 +7554,7 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
75547554
75557555
Returns
75567556
-------
7557-
ret : `~matplotlib.image.AxesImage` or `.Line2D`
7557+
`~matplotlib.image.AxesImage` or `.Line2D`
75587558
The return type depends on the plotting style (see above).
75597559
75607560
Other Parameters
@@ -7648,7 +7648,7 @@ def matshow(self, Z, **kwargs):
76487648
76497649
Returns
76507650
-------
7651-
image : `~matplotlib.image.AxesImage`
7651+
`~matplotlib.image.AxesImage`
76527652
76537653
Other Parameters
76547654
----------------
@@ -7742,7 +7742,7 @@ def violinplot(self, dataset, positions=None, vert=True, widths=0.5,
77427742
77437743
Returns
77447744
-------
7745-
result : dict
7745+
dict
77467746
A dictionary mapping each component of the violinplot to a
77477747
list of the corresponding collection instances created. The
77487748
dictionary has the following keys:
@@ -7842,7 +7842,7 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
78427842
78437843
Returns
78447844
-------
7845-
result : dict
7845+
dict
78467846
A dictionary mapping each component of the violinplot to a
78477847
list of the corresponding collection instances created. The
78487848
dictionary has the following keys:

0 commit comments

Comments
 (0)