Skip to content

Remove some extra spaces in docstrings/comments. #11592

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
Jul 7, 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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def experiment_res(x, y):

min_circle_ratio = .01 # Minimum circle ratio - border triangles with circle
# ratio below this will be masked if they touch a
# border. Suggested value 0.01 ; Use -1 to keep
# border. Suggested value 0.01; use -1 to keep
# all triangles.

# Random points
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/svg_filter_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

# filter definition for a gaussian blur
filter_def = """
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<filter id='dropshadow' height='1.2' width='1.2'>
<feGaussianBlur result='blur' stdDeviation='3'/>
</filter>
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/svg_filter_pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
# that, Inkscape's exporting also may not support it.

filter_def = """
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<filter id='dropshadow' height='1.2' width='1.2'>
<feGaussianBlur result='blur' stdDeviation='2'/>
</filter>
Expand Down
2 changes: 1 addition & 1 deletion examples/specialty_plots/leftventricle_bulleye.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def bullseye_plot(ax, data, segBold=None, cmap=None, norm=None):
for i in range(r.shape[0]):
ax.plot(theta, np.repeat(r[i], theta.shape), '-k', lw=linewidth)

# Create the bounds for the segments 1-12
# Create the bounds for the segments 1-12
for i in range(6):
theta_i = np.deg2rad(i * 60)
ax.plot([theta_i, theta_i], [r[1], 1], '-k', lw=linewidth)
Expand Down
2 changes: 1 addition & 1 deletion examples/specialty_plots/radar_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def unit_poly_verts(theta):

def example_data():
# The following data is from the Denver Aerosol Sources and Health study.
# See doi:10.1016/j.atmosenv.2008.12.017
# See doi:10.1016/j.atmosenv.2008.12.017
#
# The data are pollution source profile estimates for five modeled
# pollution sources (e.g., cars, wood-burning, etc) that emit 7-9 chemical
Expand Down
11 changes: 5 additions & 6 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
>>> plot(y, 'r+') # ditto, but with red plusses

You can use `.Line2D` properties as keyword arguments for more
control on the appearance. Line properties and *fmt* can be mixed.
control on the appearance. Line properties and *fmt* can be mixed.
The following two calls yield identical results:

>>> plot(x, y, 'go--', linewidth=2, markersize=12)
Expand Down Expand Up @@ -3155,16 +3155,15 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,

labels : sequence, optional
Labels for each dataset. Length must be compatible with
dimensions of ``x``.
dimensions of ``x``.

manage_xticks : bool, optional (True)
If the function should adjust the xlim and xtick locations.

autorange : bool, optional (False)
When `True` and the data are distributed such that the 25th and
When `True` and the data are distributed such that the 25th and
75th percentiles are equal, ``whis`` is set to ``'range'`` such
that the whisker ends are at the minimum and maximum of the
data.
that the whisker ends are at the minimum and maximum of the data.

meanline : bool, optional (False)
If `True` (and ``showmeans`` is `True`), will try to render
Expand Down Expand Up @@ -5728,7 +5727,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
It's designed to provide the fastest pcolor-type plotting with the
Agg backend. To achieve this, it uses different algorithms internally
depending on the complexity of the input grid (regular rectangular,
non-regular rectangular or arbitrary quadrilateral).
non-regular rectangular or arbitrary quadrilateral).

.. warning::

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2596,7 +2596,7 @@ class NavigationToolbar2(object):
# )
toolitems = (
('Home', 'Reset original view', 'home', 'home'),
('Back', 'Back to previous view', 'back', 'back'),
('Back', 'Back to previous view', 'back', 'back'),
('Forward', 'Forward to next view', 'forward', 'forward'),
(None, None, None, None),
('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, name, sender, tool, data=None):


class ToolTriggerEvent(ToolEvent):
"""Event to inform that a tool has been triggered"""
"""Event to inform that a tool has been triggered"""
def __init__(self, name, sender, tool, canvasevent=None, data=None):
ToolEvent.__init__(self, name, sender, tool, data)
self.canvasevent = canvasevent
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ def get_bbox_header(lbrt, rotated=False):

l, b, r, t = lbrt
if rotated:
rotate = "%.2f %.2f translate\n90 rotate" % (l+r, 0)
rotate = "%.2f %.2f translate\n90 rotate" % (l+r, 0)
else:
rotate = ""
bbox_info = '%%%%BoundingBox: %d %d %d %d' % (l, b, np.ceil(r), np.ceil(t))
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StrCategoryConverter(units.ConversionInterface):
@staticmethod
def convert(value, unit, axis):
"""Converts strings in value to floats using
mapping information store in the unit object
mapping information store in the unit object.

Parameters
----------
Expand Down
7 changes: 3 additions & 4 deletions lib/matplotlib/cbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,10 +1177,9 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
dimensions of `X`.

autorange : bool, optional (False)
When `True` and the data are distributed such that the 25th and
75th percentiles are equal, ``whis`` is set to ``'range'`` such
that the whisker ends are at the minimum and maximum of the
data.
When `True` and the data are distributed such that the 25th and 75th
percentiles are equal, ``whis`` is set to ``'range'`` such that the
whisker ends are at the minimum and maximum of the data.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/cbook/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def warn_deprecated(
since, message='', name='', alternative='', pending=False,
obj_type='attribute', addendum='', *, removal=''):
"""
Used to display deprecation in a standard way.
Used to display deprecation in a standard way.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
Import record array from CSV file with type inspection

:func:`rec_append_fields`
Adds field(s)/array(s) to record array
Adds field(s)/array(s) to record array

:func:`rec_drop_fields`
Drop fields from record array
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/offsetbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def draw(self, renderer):

class AuxTransformBox(OffsetBox):
"""
Offset Box with the aux_transform . Its children will be
Offset Box with the aux_transform. Its children will be
transformed with the aux_transform first then will be
offseted. The absolute coordinate of the aux_transform is meaning
as it will be automatically adjust so that the left-lower corner
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ def get_y(self):
return self._y

def get_width(self):
"Return the width of the rectangle"
"Return the width of the rectangle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a final period ? As you seem to have added it to other docstrings (at least one) 😈.

return self._width

def get_height(self):
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/tests/test_triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,14 +562,14 @@ def poisson_sparse_matrix(n, m):
def test_triinterpcubic_geom_weights():
# Tests to check computation of weights for _DOF_estimator_geom:
# The weight sum per triangle can be 1. (in case all angles < 90 degrees)
# or (2*w_i) where w_i = 1-alpha_i/np.pi is the weight of apex i ; alpha_i
# or (2*w_i) where w_i = 1-alpha_i/np.pi is the weight of apex i; alpha_i
# is the apex angle > 90 degrees.
(ax, ay) = (0., 1.687)
x = np.array([ax, 0.5*ax, 0., 1.])
y = np.array([ay, -ay, 0., 0.])
z = np.zeros(4, dtype=np.float64)
triangles = [[0, 2, 3], [1, 3, 2]]
sum_w = np.zeros([4, 2]) # 4 possibilities ; 2 triangles
sum_w = np.zeros([4, 2]) # 4 possibilities; 2 triangles
for theta in np.linspace(0., 2*np.pi, 14): # rotating the figure...
x_rot = np.cos(theta)*x + np.sin(theta)*y
y_rot = -np.sin(theta)*x + np.cos(theta)*y
Expand All @@ -594,7 +594,7 @@ def test_triinterp_colinear():
#
# Note that the LinearTriInterpolator and the CubicTriInterpolator with
# kind='min_E' or 'geom' still pass a linear patch test.
# We also test interpolation inside a flat triangle, by forcing
# We also test interpolation inside a flat triangle, by forcing
# *tri_index* in a call to :meth:`_interpolate_multikeys`.

# If +ve, triangulation is OK, if -ve triangulation invalid,
Expand All @@ -604,7 +604,7 @@ def test_triinterp_colinear():
x0 = np.array([1.5, 0, 1, 2, 3, 1.5, 1.5])
y0 = np.array([-1, 0, 0, 0, 0, delta, 1])

# We test different affine transformations of the initial figure ; to
# We test different affine transformations of the initial figure; to
# avoid issues related to round-off errors we only use integer
# coefficients (otherwise the Triangulation might become invalid even with
# delta == 0).
Expand Down
23 changes: 11 additions & 12 deletions lib/matplotlib/tri/triinterpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ def __init__(self, triangulation, z, trifinder=None):
Returns
-------
z : np.ma.array
Masked array of the same shape as *x* and *y* ; values
corresponding to (*x*, *y*) points outside of the triangulation
are masked out.
Masked array of the same shape as *x* and *y*; values corresponding
to (*x*, *y*) points outside of the triangulation are masked out.

"""

Expand All @@ -95,7 +94,7 @@ def __init__(self, triangulation, z, trifinder=None):
Returns
-------
dzdx, dzdy : np.ma.array
2 masked arrays of the same shape as *x* and *y* ; values
2 masked arrays of the same shape as *x* and *y*; values
corresponding to (x,y) points outside of the triangulation
are masked out.
The first returned array contains the values of
Expand Down Expand Up @@ -466,7 +465,7 @@ def _compute_dof(self, kind, dz=None):
Choice of the _DOF_estimator subclass to perform the gradient
estimation.
dz: tuple of array_likes (dzdx, dzdy), optional
Used only if *kind=user ; in this case passed to the
Used only if *kind*=user; in this case passed to the
:class:`_DOF_estimator_user`.

Returns
Expand All @@ -486,7 +485,7 @@ def _compute_dof(self, kind, dz=None):
elif kind == 'min_E':
TE = _DOF_estimator_min_E(self)
else:
raise ValueError("CubicTriInterpolator *kind* proposed: {0} ; "
raise ValueError("CubicTriInterpolator *kind* proposed: {0}; "
"should be one of: "
"'user', 'geom', 'min_E'".format(kind))
return TE.compute_dof_from_df()
Expand Down Expand Up @@ -919,7 +918,7 @@ def get_Hrot_from_J(self, J, return_area=False):
to global coordinates.
if *return_area* is True, returns also the triangle area (0.5*det(J))
"""
# Here we try to deal with the simplest colinear cases ; a null
# Here we try to deal with the simplest colinear cases; a null
# energy and area is imposed.
J_inv = _safe_inv22_vectorized(J)
Ji00 = J_inv[:, 0, 0]
Expand Down Expand Up @@ -1138,7 +1137,7 @@ def compute_geom_weights(self):
# In the below formula we could take modulo 2. but
# modulo 1. is safer regarding round-off errors (flat triangles).
angle = np.abs(np.mod((alpha2-alpha1) / np.pi, 1.))
# Weight proportional to angle up np.pi/2 ; null weight for
# Weight proportional to angle up np.pi/2; null weight for
# degenerated cases 0. and np.pi (Note that `angle` is normalized
Copy link
Contributor

@afvincent afvincent Jul 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being there "degenerated cases 0 and np.pi (note that angle is normalized"?

# by np.pi)
weights[:, ipt] = 0.5 - np.abs(angle-0.5)
Expand Down Expand Up @@ -1201,9 +1200,9 @@ def compute_dz(self):
J, eccs, triangles, Uc)

# Building sparse matrix and solving minimization problem
# We could use scipy.sparse direct solver ; however to avoid this
# We could use scipy.sparse direct solver; however to avoid this
# external dependency an implementation of a simple PCG solver with
# a simplendiagonal Jocabi preconditioner is implemented.
# a simple diagonal Jacobi preconditioner is implemented.
tol = 1.e-10
n_dof = Ff.shape[0]
Kff_coo = _Sparse_Matrix_coo(Kff_vals, Kff_rows, Kff_cols,
Expand Down Expand Up @@ -1435,7 +1434,7 @@ def _safe_inv22_vectorized(M):
prod1 = M[:, 0, 0]*M[:, 1, 1]
delta = prod1 - M[:, 0, 1]*M[:, 1, 0]

# We set delta_inv to 0. in case of a rank deficient matrix ; a
# We set delta_inv to 0. in case of a rank deficient matrix; a
# rank-deficient input matrix *M* will lead to a null matrix in output
rank2 = (np.abs(delta) > 1e-8*np.abs(prod1))
if np.all(rank2):
Expand All @@ -1455,7 +1454,7 @@ def _safe_inv22_vectorized(M):

def _pseudo_inv22sym_vectorized(M):
"""
Inversion of arrays of (2,2) SYMMETRIC matrices ; returns the
Inversion of arrays of (2,2) SYMMETRIC matrices; returns the
(Moore-Penrose) pseudo-inverse for rank-deficient matrices.

In case M is of rank 1, we have M = trace(M) x P where P is the orthogonal
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/tri/trirefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
# Each edge belongs to 1 triangle (if border edge) or is shared by 2
# masked_triangles (interior edge).
# We first build 2 * ntri arrays of edge starting nodes (edge_elems,
# edge_apexes) ; we then extract only the masters to avoid overlaps.
# edge_apexes); we then extract only the masters to avoid overlaps.
# The so-called 'master' is the triangle with biggest index
# The 'slave' is the triangle with lower index
# (can be -1 if border edge)
Expand All @@ -257,7 +257,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
refi_x[npts:] = x_add
refi_y[npts:] = y_add

# Building the new masked_triangles ; each old masked_triangles hosts
# Building the new masked_triangles; each old masked_triangles hosts
# 4 new masked_triangles
# there are 6 pts to identify per 'old' triangle, 3 new_pt_corner and
# 3 new_pt_midside
Expand All @@ -267,7 +267,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
# of elem ielem ?
# If ielem is the apex master: simple count, given the way refi_x was
# built.
# If ielem is the apex slave: yet we do not know ; but we will soon
# If ielem is the apex slave: yet we do not know; but we will soon
# using the neighbors table.
new_pt_midside = np.empty([ntri, 3], dtype=np.int32)
cum_sum = npts
Expand Down
9 changes: 4 additions & 5 deletions lib/matplotlib/tri/tritools.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,13 @@ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
triangulation from its border-located flat triangles
(according to their :meth:`circle_ratios`).
This mask is meant to be subsequently applied to the triangulation
using :func:`matplotlib.tri.Triangulation.set_mask` .
using :func:`matplotlib.tri.Triangulation.set_mask`.
*new_mask* is an extension of the initial triangulation mask
in the sense that an initially masked triangle will remain masked.

The *new_mask* array is computed recursively ; at each step flat
triangles are removed only if they share a side with the current
mesh border. Thus no new holes in the triangulated domain will be
created.
The *new_mask* array is computed recursively; at each step flat
triangles are removed only if they share a side with the current mesh
border. Thus no new holes in the triangulated domain will be created.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/axes_grid1/axes_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_size(self, renderer):


class Fixed(_Base):
"Simple fixed size with absolute part = *fixed_size* and relative part = 0"
"Simple fixed size with absolute part = *fixed_size* and relative part = 0"
def __init__(self, fixed_size):
self.fixed_size = fixed_size

Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
Parameters
----------
za
The location or locations to place the patches in the collection along
The location or locations to place the patches in the collection along
the *zdir* axis. Default: 0.
zdir
The axis in which to place the patches. Default: "z".
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
Convenience method for controlling tick locators.

See :meth:`matplotlib.axes.Axes.locator_params` for full
documentation Note that this is for Axes3D objects,
documentation. Note that this is for Axes3D objects,
therefore, setting *axis* to 'both' will result in the
parameters being set for all three axes. Also, *axis*
can also take a value of 'z' to apply parameters to the
Expand Down
2 changes: 1 addition & 1 deletion tutorials/introductory/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# ===============
#
# :mod:`matplotlib.pyplot` is a collection of command style functions
# that make matplotlib work like MATLAB.
# that make matplotlib work like MATLAB.
# Each ``pyplot`` function makes
# some change to a figure: e.g., creates a figure, creates a plotting area
# in a figure, plots some lines in a plotting area, decorates the plot
Expand Down
11 changes: 5 additions & 6 deletions tutorials/introductory/sample_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Line Plot
=========

Here's how to create a line plot with text labels using
Here's how to create a line plot with text labels using
:func:`~matplotlib.pyplot.plot`.

.. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001.png
Expand Down Expand Up @@ -147,11 +147,10 @@
Ellipses
========

In support of the
`Phoenix <http://www.jpl.nasa.gov/news/phoenix/main.php>`_ mission to
Mars (which used Matplotlib to display ground tracking of spacecraft),
Michael Droettboom built on work by Charlie Moad to provide an extremely
accurate 8-spline approximation to elliptical arcs (see
In support of the `Phoenix <http://www.jpl.nasa.gov/news/phoenix/main.php>`_
mission to Mars (which used Matplotlib to display ground tracking of
spacecraft), Michael Droettboom built on work by Charlie Moad to provide
an extremely accurate 8-spline approximation to elliptical arcs (see
:class:`~matplotlib.patches.Arc`), which are insensitive to zoom level.

.. figure:: ../../gallery/shapes_and_collections/images/sphx_glr_ellipse_demo_001.png
Expand Down
Loading