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

Skip to content

Commit 258ad31

Browse files
authored
Merge pull request #11592 from anntzer/spacesindocstrings
Remove some extra spaces in docstrings/comments.
2 parents 5dc51e0 + 3186b63 commit 258ad31

27 files changed

+59
-64
lines changed

examples/images_contours_and_fields/tricontour_smooth_delaunay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def experiment_res(x, y):
6161

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

6767
# Random points

examples/misc/svg_filter_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
# filter definition for a gaussian blur
6363
filter_def = """
64-
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
64+
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
6565
<filter id='dropshadow' height='1.2' width='1.2'>
6666
<feGaussianBlur result='blur' stdDeviation='3'/>
6767
</filter>

examples/misc/svg_filter_pie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# that, Inkscape's exporting also may not support it.
5959

6060
filter_def = """
61-
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
61+
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
6262
<filter id='dropshadow' height='1.2' width='1.2'>
6363
<feGaussianBlur result='blur' stdDeviation='2'/>
6464
</filter>

examples/specialty_plots/leftventricle_bulleye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def bullseye_plot(ax, data, segBold=None, cmap=None, norm=None):
6161
for i in range(r.shape[0]):
6262
ax.plot(theta, np.repeat(r[i], theta.shape), '-k', lw=linewidth)
6363

64-
# Create the bounds for the segments 1-12
64+
# Create the bounds for the segments 1-12
6565
for i in range(6):
6666
theta_i = np.deg2rad(i * 60)
6767
ax.plot([theta_i, theta_i], [r[1], 1], '-k', lw=linewidth)

examples/specialty_plots/radar_chart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def unit_poly_verts(theta):
121121

122122
def example_data():
123123
# The following data is from the Denver Aerosol Sources and Health study.
124-
# See doi:10.1016/j.atmosenv.2008.12.017
124+
# See doi:10.1016/j.atmosenv.2008.12.017
125125
#
126126
# The data are pollution source profile estimates for five modeled
127127
# pollution sources (e.g., cars, wood-burning, etc) that emit 7-9 chemical

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
11361136
>>> plot(y, 'r+') # ditto, but with red plusses
11371137
11381138
You can use `.Line2D` properties as keyword arguments for more
1139-
control on the appearance. Line properties and *fmt* can be mixed.
1139+
control on the appearance. Line properties and *fmt* can be mixed.
11401140
The following two calls yield identical results:
11411141
11421142
>>> plot(x, y, 'go--', linewidth=2, markersize=12)
@@ -3155,16 +3155,15 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
31553155
31563156
labels : sequence, optional
31573157
Labels for each dataset. Length must be compatible with
3158-
dimensions of ``x``.
3158+
dimensions of ``x``.
31593159
31603160
manage_xticks : bool, optional (True)
31613161
If the function should adjust the xlim and xtick locations.
31623162
31633163
autorange : bool, optional (False)
3164-
When `True` and the data are distributed such that the 25th and
3164+
When `True` and the data are distributed such that the 25th and
31653165
75th percentiles are equal, ``whis`` is set to ``'range'`` such
3166-
that the whisker ends are at the minimum and maximum of the
3167-
data.
3166+
that the whisker ends are at the minimum and maximum of the data.
31683167
31693168
meanline : bool, optional (False)
31703169
If `True` (and ``showmeans`` is `True`), will try to render
@@ -5728,7 +5727,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
57285727
It's designed to provide the fastest pcolor-type plotting with the
57295728
Agg backend. To achieve this, it uses different algorithms internally
57305729
depending on the complexity of the input grid (regular rectangular,
5731-
non-regular rectangular or arbitrary quadrilateral).
5730+
non-regular rectangular or arbitrary quadrilateral).
57325731
57335732
.. warning::
57345733

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,7 @@ class NavigationToolbar2(object):
25962596
# )
25972597
toolitems = (
25982598
('Home', 'Reset original view', 'home', 'home'),
2599-
('Back', 'Back to previous view', 'back', 'back'),
2599+
('Back', 'Back to previous view', 'back', 'back'),
26002600
('Forward', 'Forward to next view', 'forward', 'forward'),
26012601
(None, None, None, None),
26022602
('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),

lib/matplotlib/backend_managers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, name, sender, tool, data=None):
2222

2323

2424
class ToolTriggerEvent(ToolEvent):
25-
"""Event to inform that a tool has been triggered"""
25+
"""Event to inform that a tool has been triggered"""
2626
def __init__(self, name, sender, tool, canvasevent=None, data=None):
2727
ToolEvent.__init__(self, name, sender, tool, data)
2828
self.canvasevent = canvasevent

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ def get_bbox_header(lbrt, rotated=False):
15641564

15651565
l, b, r, t = lbrt
15661566
if rotated:
1567-
rotate = "%.2f %.2f translate\n90 rotate" % (l+r, 0)
1567+
rotate = "%.2f %.2f translate\n90 rotate" % (l+r, 0)
15681568
else:
15691569
rotate = ""
15701570
bbox_info = '%%%%BoundingBox: %d %d %d %d' % (l, b, np.ceil(r), np.ceil(t))

lib/matplotlib/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class StrCategoryConverter(units.ConversionInterface):
2424
@staticmethod
2525
def convert(value, unit, axis):
2626
"""Converts strings in value to floats using
27-
mapping information store in the unit object
27+
mapping information store in the unit object.
2828
2929
Parameters
3030
----------

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,10 +1177,9 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
11771177
dimensions of `X`.
11781178
11791179
autorange : bool, optional (False)
1180-
When `True` and the data are distributed such that the 25th and
1181-
75th percentiles are equal, ``whis`` is set to ``'range'`` such
1182-
that the whisker ends are at the minimum and maximum of the
1183-
data.
1180+
When `True` and the data are distributed such that the 25th and 75th
1181+
percentiles are equal, ``whis`` is set to ``'range'`` such that the
1182+
whisker ends are at the minimum and maximum of the data.
11841183
11851184
Returns
11861185
-------

lib/matplotlib/cbook/deprecation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def warn_deprecated(
5555
since, message='', name='', alternative='', pending=False,
5656
obj_type='attribute', addendum='', *, removal=''):
5757
"""
58-
Used to display deprecation in a standard way.
58+
Used to display deprecation in a standard way.
5959
6060
Parameters
6161
----------

lib/matplotlib/mlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
Import record array from CSV file with type inspection
118118
119119
:func:`rec_append_fields`
120-
Adds field(s)/array(s) to record array
120+
Adds field(s)/array(s) to record array
121121
122122
:func:`rec_drop_fields`
123123
Drop fields from record array

lib/matplotlib/offsetbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def draw(self, renderer):
842842

843843
class AuxTransformBox(OffsetBox):
844844
"""
845-
Offset Box with the aux_transform . Its children will be
845+
Offset Box with the aux_transform. Its children will be
846846
transformed with the aux_transform first then will be
847847
offseted. The absolute coordinate of the aux_transform is meaning
848848
as it will be automatically adjust so that the left-lower corner

lib/matplotlib/patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ def get_y(self):
25622562
return self._y
25632563

25642564
def get_width(self):
2565-
"Return the width of the rectangle"
2565+
"Return the width of the rectangle"
25662566
return self._width
25672567

25682568
def get_height(self):

lib/matplotlib/tests/test_triangulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,14 @@ def poisson_sparse_matrix(n, m):
562562
def test_triinterpcubic_geom_weights():
563563
# Tests to check computation of weights for _DOF_estimator_geom:
564564
# The weight sum per triangle can be 1. (in case all angles < 90 degrees)
565-
# or (2*w_i) where w_i = 1-alpha_i/np.pi is the weight of apex i ; alpha_i
565+
# or (2*w_i) where w_i = 1-alpha_i/np.pi is the weight of apex i; alpha_i
566566
# is the apex angle > 90 degrees.
567567
(ax, ay) = (0., 1.687)
568568
x = np.array([ax, 0.5*ax, 0., 1.])
569569
y = np.array([ay, -ay, 0., 0.])
570570
z = np.zeros(4, dtype=np.float64)
571571
triangles = [[0, 2, 3], [1, 3, 2]]
572-
sum_w = np.zeros([4, 2]) # 4 possibilities ; 2 triangles
572+
sum_w = np.zeros([4, 2]) # 4 possibilities; 2 triangles
573573
for theta in np.linspace(0., 2*np.pi, 14): # rotating the figure...
574574
x_rot = np.cos(theta)*x + np.sin(theta)*y
575575
y_rot = -np.sin(theta)*x + np.cos(theta)*y
@@ -594,7 +594,7 @@ def test_triinterp_colinear():
594594
#
595595
# Note that the LinearTriInterpolator and the CubicTriInterpolator with
596596
# kind='min_E' or 'geom' still pass a linear patch test.
597-
# We also test interpolation inside a flat triangle, by forcing
597+
# We also test interpolation inside a flat triangle, by forcing
598598
# *tri_index* in a call to :meth:`_interpolate_multikeys`.
599599

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

607-
# We test different affine transformations of the initial figure ; to
607+
# We test different affine transformations of the initial figure; to
608608
# avoid issues related to round-off errors we only use integer
609609
# coefficients (otherwise the Triangulation might become invalid even with
610610
# delta == 0).

lib/matplotlib/tri/triinterpolate.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ def __init__(self, triangulation, z, trifinder=None):
7676
Returns
7777
-------
7878
z : np.ma.array
79-
Masked array of the same shape as *x* and *y* ; values
80-
corresponding to (*x*, *y*) points outside of the triangulation
81-
are masked out.
79+
Masked array of the same shape as *x* and *y*; values corresponding
80+
to (*x*, *y*) points outside of the triangulation are masked out.
8281
8382
"""
8483

@@ -95,7 +94,7 @@ def __init__(self, triangulation, z, trifinder=None):
9594
Returns
9695
-------
9796
dzdx, dzdy : np.ma.array
98-
2 masked arrays of the same shape as *x* and *y* ; values
97+
2 masked arrays of the same shape as *x* and *y*; values
9998
corresponding to (x,y) points outside of the triangulation
10099
are masked out.
101100
The first returned array contains the values of
@@ -466,7 +465,7 @@ def _compute_dof(self, kind, dz=None):
466465
Choice of the _DOF_estimator subclass to perform the gradient
467466
estimation.
468467
dz: tuple of array_likes (dzdx, dzdy), optional
469-
Used only if *kind=user ; in this case passed to the
468+
Used only if *kind*=user; in this case passed to the
470469
:class:`_DOF_estimator_user`.
471470
472471
Returns
@@ -486,7 +485,7 @@ def _compute_dof(self, kind, dz=None):
486485
elif kind == 'min_E':
487486
TE = _DOF_estimator_min_E(self)
488487
else:
489-
raise ValueError("CubicTriInterpolator *kind* proposed: {0} ; "
488+
raise ValueError("CubicTriInterpolator *kind* proposed: {0}; "
490489
"should be one of: "
491490
"'user', 'geom', 'min_E'".format(kind))
492491
return TE.compute_dof_from_df()
@@ -919,7 +918,7 @@ def get_Hrot_from_J(self, J, return_area=False):
919918
to global coordinates.
920919
if *return_area* is True, returns also the triangle area (0.5*det(J))
921920
"""
922-
# Here we try to deal with the simplest colinear cases ; a null
921+
# Here we try to deal with the simplest colinear cases; a null
923922
# energy and area is imposed.
924923
J_inv = _safe_inv22_vectorized(J)
925924
Ji00 = J_inv[:, 0, 0]
@@ -1138,7 +1137,7 @@ def compute_geom_weights(self):
11381137
# In the below formula we could take modulo 2. but
11391138
# modulo 1. is safer regarding round-off errors (flat triangles).
11401139
angle = np.abs(np.mod((alpha2-alpha1) / np.pi, 1.))
1141-
# Weight proportional to angle up np.pi/2 ; null weight for
1140+
# Weight proportional to angle up np.pi/2; null weight for
11421141
# degenerated cases 0. and np.pi (Note that `angle` is normalized
11431142
# by np.pi)
11441143
weights[:, ipt] = 0.5 - np.abs(angle-0.5)
@@ -1201,9 +1200,9 @@ def compute_dz(self):
12011200
J, eccs, triangles, Uc)
12021201

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

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

14561455
def _pseudo_inv22sym_vectorized(M):
14571456
"""
1458-
Inversion of arrays of (2,2) SYMMETRIC matrices ; returns the
1457+
Inversion of arrays of (2,2) SYMMETRIC matrices; returns the
14591458
(Moore-Penrose) pseudo-inverse for rank-deficient matrices.
14601459
14611460
In case M is of rank 1, we have M = trace(M) x P where P is the orthogonal

lib/matplotlib/tri/trirefine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
232232
# Each edge belongs to 1 triangle (if border edge) or is shared by 2
233233
# masked_triangles (interior edge).
234234
# We first build 2 * ntri arrays of edge starting nodes (edge_elems,
235-
# edge_apexes) ; we then extract only the masters to avoid overlaps.
235+
# edge_apexes); we then extract only the masters to avoid overlaps.
236236
# The so-called 'master' is the triangle with biggest index
237237
# The 'slave' is the triangle with lower index
238238
# (can be -1 if border edge)
@@ -257,7 +257,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
257257
refi_x[npts:] = x_add
258258
refi_y[npts:] = y_add
259259

260-
# Building the new masked_triangles ; each old masked_triangles hosts
260+
# Building the new masked_triangles; each old masked_triangles hosts
261261
# 4 new masked_triangles
262262
# there are 6 pts to identify per 'old' triangle, 3 new_pt_corner and
263263
# 3 new_pt_midside
@@ -267,7 +267,7 @@ def _refine_triangulation_once(triangulation, ancestors=None):
267267
# of elem ielem ?
268268
# If ielem is the apex master: simple count, given the way refi_x was
269269
# built.
270-
# If ielem is the apex slave: yet we do not know ; but we will soon
270+
# If ielem is the apex slave: yet we do not know; but we will soon
271271
# using the neighbors table.
272272
new_pt_midside = np.empty([ntri, 3], dtype=np.int32)
273273
cum_sum = npts

lib/matplotlib/tri/tritools.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,13 @@ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
127127
triangulation from its border-located flat triangles
128128
(according to their :meth:`circle_ratios`).
129129
This mask is meant to be subsequently applied to the triangulation
130-
using :func:`matplotlib.tri.Triangulation.set_mask` .
130+
using :func:`matplotlib.tri.Triangulation.set_mask`.
131131
*new_mask* is an extension of the initial triangulation mask
132132
in the sense that an initially masked triangle will remain masked.
133133
134-
The *new_mask* array is computed recursively ; at each step flat
135-
triangles are removed only if they share a side with the current
136-
mesh border. Thus no new holes in the triangulated domain will be
137-
created.
134+
The *new_mask* array is computed recursively; at each step flat
135+
triangles are removed only if they share a side with the current mesh
136+
border. Thus no new holes in the triangulated domain will be created.
138137
139138
Parameters
140139
----------

lib/mpl_toolkits/axes_grid1/axes_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_size(self, renderer):
5353

5454

5555
class Fixed(_Base):
56-
"Simple fixed size with absolute part = *fixed_size* and relative part = 0"
56+
"Simple fixed size with absolute part = *fixed_size* and relative part = 0"
5757
def __init__(self, fixed_size):
5858
self.fixed_size = fixed_size
5959

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
486486
Parameters
487487
----------
488488
za
489-
The location or locations to place the patches in the collection along
489+
The location or locations to place the patches in the collection along
490490
the *zdir* axis. Default: 0.
491491
zdir
492492
The axis in which to place the patches. Default: "z".

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ def locator_params(self, axis='both', tight=None, **kwargs):
13641364
Convenience method for controlling tick locators.
13651365
13661366
See :meth:`matplotlib.axes.Axes.locator_params` for full
1367-
documentation Note that this is for Axes3D objects,
1367+
documentation. Note that this is for Axes3D objects,
13681368
therefore, setting *axis* to 'both' will result in the
13691369
parameters being set for all three axes. Also, *axis*
13701370
can also take a value of 'z' to apply parameters to the

tutorials/introductory/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# ===============
1313
#
1414
# :mod:`matplotlib.pyplot` is a collection of command style functions
15-
# that make matplotlib work like MATLAB.
15+
# that make matplotlib work like MATLAB.
1616
# Each ``pyplot`` function makes
1717
# some change to a figure: e.g., creates a figure, creates a plotting area
1818
# in a figure, plots some lines in a plotting area, decorates the plot

tutorials/introductory/sample_plots.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Line Plot
1212
=========
1313
14-
Here's how to create a line plot with text labels using
14+
Here's how to create a line plot with text labels using
1515
:func:`~matplotlib.pyplot.plot`.
1616
1717
.. figure:: ../../gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001.png
@@ -147,11 +147,10 @@
147147
Ellipses
148148
========
149149
150-
In support of the
151-
`Phoenix <http://www.jpl.nasa.gov/news/phoenix/main.php>`_ mission to
152-
Mars (which used Matplotlib to display ground tracking of spacecraft),
153-
Michael Droettboom built on work by Charlie Moad to provide an extremely
154-
accurate 8-spline approximation to elliptical arcs (see
150+
In support of the `Phoenix <http://www.jpl.nasa.gov/news/phoenix/main.php>`_
151+
mission to Mars (which used Matplotlib to display ground tracking of
152+
spacecraft), Michael Droettboom built on work by Charlie Moad to provide
153+
an extremely accurate 8-spline approximation to elliptical arcs (see
155154
:class:`~matplotlib.patches.Arc`), which are insensitive to zoom level.
156155
157156
.. figure:: ../../gallery/shapes_and_collections/images/sphx_glr_ellipse_demo_001.png

0 commit comments

Comments
 (0)