Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Many docstring cleanups. #17150

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
Apr 15, 2020
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
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def _ensure_handler():

def set_loglevel(level):
"""
Sets the Matplotlib's root logger and root logger handler level, creating
Set Matplotlib's root logger and root logger handler level, creating
the handler if it does not exist yet.

Typically, one should call ``set_loglevel("info")`` or
Expand Down
6 changes: 2 additions & 4 deletions 6 lib/matplotlib/afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _to_bool(s):

def _parse_header(fh):
"""
Reads the font metrics header (up to the char metrics) and returns
Read the font metrics header (up to the char metrics) and returns
a dictionary mapping *key* to *val*. *val* will be converted to the
appropriate python type as necessary; e.g.:

Expand All @@ -99,7 +99,6 @@ def _parse_header(fh):
ItalicAngle, IsFixedPitch, FontBBox, UnderlinePosition,
UnderlineThickness, Version, Notice, EncodingScheme, CapHeight,
XHeight, Ascender, Descender, StartCharMetrics

"""
header_converters = {
b'StartFontMetrics': _to_float,
Expand Down Expand Up @@ -128,8 +127,7 @@ def _parse_header(fh):
b'StartCharMetrics': _to_int,
b'CharacterSet': _to_str,
b'Characters': _to_int,
}

}
d = {}
first_line = True
for line in fh:
Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __init__(self, fps=5, metadata=None, codec=None, bitrate=None):
@abc.abstractmethod
def setup(self, fig, outfile, dpi=None):
"""
Perform setup for writing the movie file.
Setup for writing the movie file.

Parameters
----------
Expand Down Expand Up @@ -425,7 +425,7 @@ def __init__(self, *args, **kwargs):
def setup(self, fig, outfile, dpi=None, frame_prefix=None,
clear_temp=True):
"""
Perform setup for writing the movie file.
Setup for writing the movie file.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5390,7 +5390,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,

If *interpolation* is 'none', then no interpolation is performed
on the Agg, ps, pdf and svg backends. Other backends will fall back
to 'nearest'. Note that most SVG renders perform interpolation at
to 'nearest'. Note that most SVG renderers perform interpolation at
rendering and that the default interpolation method they implement
may differ.

Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ def check_gc(self, gc, fillcolor=None):

@cbook.deprecated("3.3")
def track_characters(self, *args, **kwargs):
"""Keeps track of which characters are required from each font."""
"""Keep track of which characters are required from each font."""
self.file._character_tracker.track(*args, **kwargs)

@cbook.deprecated("3.3")
Expand Down Expand Up @@ -2460,7 +2460,7 @@ def infodict(self):

def savefig(self, figure=None, **kwargs):
"""
Saves a `.Figure` to this file as a new page.
Save a `.Figure` to this file as a new page.

Any other keyword arguments are passed to `~.Figure.savefig`.

Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class RendererPgf(RendererBase):
@cbook._delete_parameter("3.3", "dummy")
def __init__(self, figure, fh, dummy=False):
"""
Creates a new PGF renderer that translates any drawing instruction
Create a new PGF renderer that translates any drawing instruction
into text commands to be interpreted in a latex pgfpicture environment.

Attributes
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def _run_latex(self):

def savefig(self, figure=None, **kwargs):
"""
Saves a `.Figure` to this file as a new page.
Save a `.Figure` to this file as a new page.

Any other keyword arguments are passed to `~.Figure.savefig`.

Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def used_characters(self):

@cbook.deprecated("3.3")
def track_characters(self, *args, **kwargs):
"""Keeps track of which characters are required from each font."""
"""Keep track of which characters are required from each font."""
self._character_tracker.track(*args, **kwargs)

@cbook.deprecated("3.3")
Expand Down
14 changes: 7 additions & 7 deletions 14 lib/matplotlib/backends/backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __flush(self, indent=True):

def start(self, tag, attrib={}, **extra):
"""
Opens a new element. Attributes can be given as keyword
Open a new element. Attributes can be given as keyword
arguments, or as a string/string dictionary. The method returns
an opaque identifier that can be passed to the :meth:`close`
method, to close all open elements up to and including this one.
Expand Down Expand Up @@ -162,7 +162,7 @@ def start(self, tag, attrib={}, **extra):

def comment(self, comment):
"""
Adds a comment to the output stream.
Add a comment to the output stream.

Parameters
----------
Expand All @@ -175,7 +175,7 @@ def comment(self, comment):

def data(self, text):
"""
Adds character data to the output stream.
Add character data to the output stream.

Parameters
----------
Expand All @@ -186,7 +186,7 @@ def data(self, text):

def end(self, tag=None, indent=True):
"""
Closes the current element (opened by the most recent call to
Close the current element (opened by the most recent call to
:meth:`start`).

Parameters
Expand Down Expand Up @@ -214,7 +214,7 @@ def end(self, tag=None, indent=True):

def close(self, id):
"""
Closes open elements, up to (and including) the element identified
Close open elements, up to (and including) the element identified
by the given identifier.

Parameters
Expand All @@ -227,7 +227,7 @@ def close(self, id):

def element(self, tag, text=None, attrib={}, **extra):
"""
Adds an entire element. This is the same as calling :meth:`start`,
Add an entire element. This is the same as calling :meth:`start`,
:meth:`data`, and :meth:`end` in sequence. The *text* argument can be
omitted.
"""
Expand All @@ -237,7 +237,7 @@ def element(self, tag, text=None, attrib={}, **extra):
self.end(indent=False)

def flush(self):
"""Flushes the output stream."""
"""Flush the output stream."""
pass # replaced by the constructor


Expand Down
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def pop_click(self, event, index=-1):

def pop(self, event, index=-1):
"""
Removes a click and the associated event from the list of clicks.
Remove a click and the associated event from the list of clicks.

Defaults to the last click.
"""
Expand Down
5 changes: 1 addition & 4 deletions 5 lib/matplotlib/cbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,10 +1282,7 @@ def _to_unmasked_float_array(x):


def _check_1d(x):
"""
Converts a sequence of less than 1 dimension, to an array of 1
dimension; leaves everything else untouched.
"""
"""Convert scalars to 1d arrays; pass-through arrays as is."""
if not hasattr(x, 'shape') or len(x.shape) < 1:
return np.atleast_1d(x)
else:
Expand Down
12 changes: 7 additions & 5 deletions 12 lib/matplotlib/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,10 @@ def get_paths(self):
def legend_elements(self, prop="colors", num="auto",
fmt=None, func=lambda x: x, **kwargs):
"""
Creates legend handles and labels for a PathCollection. This is useful
for obtaining a legend for a `~.Axes.scatter` plot. E.g.::
Create legend handles and labels for a PathCollection.

This is useful for obtaining a legend for a `~.Axes.scatter` plot;
e.g.::

scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3])
plt.legend(*scatter.legend_elements())
Expand Down Expand Up @@ -1849,7 +1851,7 @@ def set_paths(self):
@staticmethod
def convert_mesh_to_paths(tri):
"""
Converts a given mesh into a sequence of `~.Path` objects.
Convert a given mesh into a sequence of `~.Path` objects.

This function is primarily of use to implementers of backends that do
not directly support meshes.
Expand Down Expand Up @@ -1942,7 +1944,7 @@ def get_datalim(self, transData):
@staticmethod
def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):
"""
Converts a given mesh into a sequence of `~.Path` objects.
Convert a given mesh into a sequence of `~.Path` objects.

This function is primarily of use to implementers of backends that do
not directly support quadmeshes.
Expand All @@ -1963,7 +1965,7 @@ def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):

def convert_mesh_to_triangles(self, meshWidth, meshHeight, coordinates):
"""
Converts a given mesh into a sequence of triangles, each point
Convert a given mesh into a sequence of triangles, each point
with its own color. This is useful for experiments using
`~.RendererBase.draw_gouraud_triangle`.
"""
Expand Down
10 changes: 5 additions & 5 deletions 10 lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ def _inv_transform(self, a):
return a

def _transform_vmin_vmax(self):
"""Calculates vmin and vmax in the transformed system."""
"""Calculate vmin and vmax in the transformed system."""
vmin, vmax = self.vmin, self.vmax
arr = np.array([vmax, vmin]).astype(float)
self._upper, self._lower = self._transform(arr)
Expand Down Expand Up @@ -1687,7 +1687,7 @@ def direction(self):

def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.):
"""
Calculates the illumination intensity for a surface using the defined
Calculate the illumination intensity for a surface using the defined
azimuth and elevation for the light source.

This computes the normal vectors for the surface, and then passes them
Expand Down Expand Up @@ -1741,7 +1741,7 @@ def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.):

def shade_normals(self, normals, fraction=1.):
"""
Calculates the illumination intensity for the normal vectors of a
Calculate the illumination intensity for the normal vectors of a
surface using the defined azimuth and elevation for the light source.

Imagine an artificial sun placed at infinity in some azimuth and
Expand Down Expand Up @@ -2008,8 +2008,8 @@ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,

def blend_soft_light(self, rgb, intensity):
"""
Combines an rgb image with an intensity map using "soft light"
blending. Uses the "pegtop" formula.
Combine an rgb image with an intensity map using "soft light" blending,
using the "pegtop" formula.

Parameters
----------
Expand Down
8 changes: 2 additions & 6 deletions 8 lib/matplotlib/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,7 @@ def set_tzinfo(self, tz):
self.tz = tz

def datalim_to_dt(self):
"""
Convert axis data interval to datetime objects.
"""
"""Convert axis data interval to datetime objects."""
dmin, dmax = self.axis.get_data_interval()
if dmin > dmax:
dmin, dmax = dmax, dmin
Expand All @@ -1006,9 +1004,7 @@ def datalim_to_dt(self):
return num2date(dmin, self.tz), num2date(dmax, self.tz)

def viewlim_to_dt(self):
"""
Converts the view interval to datetime objects.
"""
"""Convert the view interval to datetime objects."""
vmin, vmax = self.axis.get_view_interval()
if vmin > vmax:
vmin, vmax = vmax, vmin
Expand Down
6 changes: 3 additions & 3 deletions 6 lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,9 @@ def _parse(self, file):
@cbook.deprecated("3.3")
class Encoding:
r"""
Parses a \*.enc file referenced from a psfonts.map style file.
The format this class understands is a very limited subset of
PostScript.
Parse a \*.enc file referenced from a psfonts.map style file.

The format this class understands is a very limited subset of PostScript.

Usage (subject to change)::

Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def win32FontDirectory():

def _win32RegistryFonts(reg_domain, base_dir):
r"""
Searches for fonts in the Windows registry.
Search for fonts in the Windows registry.

Parameters
----------
Expand Down Expand Up @@ -498,7 +498,7 @@ def afmFontProperty(fontpath, font):
@cbook.deprecated("3.2", alternative="FontManager.addfont")
def createFontList(fontfiles, fontext='ttf'):
"""
A function to create a font lookup list. The default is to create
Create a font lookup list. The default is to create
a list of TrueType fonts. An AFM font list can optionally be
created.
"""
Expand Down
4 changes: 2 additions & 2 deletions 4 lib/matplotlib/legend_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ def create_artists(self, legend, orig_handle,

def _copy_collection_props(self, legend_handle, orig_handle):
"""
Method to copy properties from a LineCollection (orig_handle) to a
Line2D (legend_handle).
Copy properties from the `.LineCollection` *orig_handle* to the
`.Line2D` *legend_handle*.
"""
legend_handle.set_color(orig_handle.get_color()[0])
legend_handle.set_linestyle(orig_handle.get_linestyle()[0])
Expand Down
7 changes: 2 additions & 5 deletions 7 lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -2464,15 +2464,12 @@ def _shrink(self, path, shrinkA, shrinkB):
def __call__(self, posA, posB,
shrinkA=2., shrinkB=2., patchA=None, patchB=None):
"""
Calls the *connect* method to create a path between *posA*
and *posB*. The path is clipped and shrunken.
Call the *connect* method to create a path between *posA* and
*posB*; then clip and shrink the path.
"""

path = self.connect(posA, posB)

clipped_path = self._clip(path, patchA, patchB)
shrunk_path = self._shrink(clipped_path, shrinkA, shrinkB)

return shrunk_path

@_register_style(_style_list)
Expand Down
11 changes: 6 additions & 5 deletions 11 lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,10 @@ def iter_segments(self, transform=None, remove_nans=True, clip=None,
snap=False, stroke_width=1.0, simplify=None,
curves=True, sketch=None):
"""
Iterates over all of the curve segments in the path. Each iteration
returns a 2-tuple ``(vertices, code)``, where ``vertices`` is a
sequence of 1-3 coordinate pairs, and ``code`` is a `Path` code.
Iterate over all curve segments in the path.

Each iteration returns a pair ``(vertices, code)``, where ``vertices``
is a sequence of 1-3 coordinate pairs, and ``code`` is a `Path` code.

Additionally, this method can provide a number of standard cleanups and
conversions to the path.
Expand All @@ -379,7 +380,7 @@ def iter_segments(self, transform=None, remove_nans=True, clip=None,
defining a rectangle in which to clip the path.
snap : None or bool, optional
If True, snap all nodes to pixels; if False, don't snap them.
If None, perform snapping if the path contains only segments
If None, snap if the path contains only segments
parallel to the x or y axes, and no more than 1024 of them.
stroke_width : float, optional
The width of the stroke being drawn (used for path snapping).
Expand Down Expand Up @@ -522,7 +523,7 @@ def contains_path(self, path, transform=None):
Return whether this (closed) path completely contains the given path.

If *transform* is not ``None``, the path will be transformed before
performing the test.
checking for containment.
"""
if transform is not None:
transform = transform.frozen()
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.