Skip to content

Commit c0f17ef

Browse files
Use "general" verb form in docstrings (#2376)
1 parent 1ddbd9f commit c0f17ef

33 files changed

+130
-125
lines changed

pygmt/figure.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ def psconvert(self, **kwargs):
209209
anti_aliasing : str
210210
[**g**\|\ **p**\|\ **t**\][**1**\|\ **2**\|\ **4**].
211211
Set the anti-aliasing options for **g**\ raphics or **t**\ ext.
212-
Append the size of the subsample box (1, 2, or 4) [4]. [Default is
213-
no anti-aliasing (same as bits = 1)].
212+
Append the size of the subsample box (1, 2, or 4) [Default is
213+
``"4"``]. [Default is no anti-aliasing (same as bits = 1).]
214214
fmt : str
215-
Sets the output format, where **b** means BMP, **e** means EPS,
215+
Set the output format, where **b** means BMP, **e** means EPS,
216216
**E** means EPS with PageSize command, **f** means PDF, **F** means
217217
multi-page PDF, **j** means JPEG, **g** means PNG, **G** means
218218
transparent PNG (untouched regions are transparent), **m** means
@@ -273,21 +273,21 @@ def savefig(
273273
The desired figure file name, including the extension. See the list
274274
of supported formats and their extensions above.
275275
transparent : bool
276-
If True, will use a transparent background for the figure. Only
277-
valid for PNG format.
276+
If ``True``, will use a transparent background for the figure.
277+
Only valid for PNG format.
278278
crop : bool
279-
If True, will crop the figure canvas (page) to the plot area.
279+
If ``True``, will crop the figure canvas (page) to the plot area.
280280
anti_alias: bool
281-
If True, will use anti aliasing when creating raster images (PNG,
282-
JPG, TIFF). More specifically, it passes arguments ``t2``
281+
If ``True``, will use anti-aliasing when creating raster images
282+
(PNG, JPG, TIFF). More specifically, it passes arguments ``t2``
283283
and ``g2`` to the ``anti_aliasing`` parameter of
284284
:meth:`pygmt.Figure.psconvert`. Ignored if creating vector
285285
graphics.
286286
show: bool
287-
If True, will open the figure in an external viewer.
287+
If ``True``, will open the figure in an external viewer.
288288
dpi : int
289-
Set raster resolution in dpi. Default is 720 for PDF, 300 for
290-
others.
289+
Set raster resolution in dpi [Default is ``720`` for PDF, ``300``
290+
for others].
291291
**kwargs : dict
292292
Additional keyword arguments passed to
293293
:meth:`pygmt.Figure.psconvert`. Valid parameters are ``gs_path``,

pygmt/helpers/decorators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
[**s**\|\ **S**]][**+l**\|\ **r**][**+p**\ *percent*].
3030
Features with an area smaller than *min_area* in km\ :sup:`2` or of
3131
hierarchical level that is lower than *min_level* or higher than
32-
*max_level* will not be plotted [Default is 0/0/4 (all
32+
*max_level* will not be plotted [Default is ``"0/0/4"`` (all
3333
features)].""",
3434
"frame": r"""
3535
frame : bool or str or list
@@ -305,13 +305,13 @@
305305
[**x**\|\ **y**\|\ **z**]\ *azim*\[/*elev*\[/*zlevel*]]\
306306
[**+w**\ *lon0*/*lat0*\[/*z0*]][**+v**\ *x0*/*y0*].
307307
Select perspective view and set the azimuth and elevation angle of
308-
the viewpoint. Default is [180, 90]. Full documentation is at
308+
the viewpoint [Default is ``[180, 90]``]. Full documentation is at
309309
:gmt-docs:`gmt.html#perspective-full`.
310310
""",
311311
"registration": r"""
312312
registration : str
313313
**g**\|\ **p**.
314-
Force gridline (**g**) or pixel (**p**) node registration.
314+
Force gridline (**g**) or pixel (**p**) node registration
315315
[Default is **g**\ (ridline)].
316316
""",
317317
"skiprows": r"""
@@ -333,7 +333,7 @@
333333
"transparency": r"""
334334
transparency : int or float
335335
Set transparency level, in [0-100] percent range
336-
[Default is 0, i.e., opaque].
336+
[Default is ``0``, i.e., opaque].
337337
Only visible when PDF or raster format output is selected.
338338
Only the PNG format selection adds a transparency layer
339339
in the image (for further processing). """,

pygmt/src/basemap.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def basemap(self, **kwargs):
5454
map_scale : str
5555
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
5656
**+w**\ *length*.
57-
Draws a simple map scale centered on the reference point specified.
57+
Draw a simple map scale centered on the reference point specified.
5858
box : bool or str
5959
[**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\
6060
[**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]].
61-
If set to ``True``, draws a rectangular border around the
61+
If set to ``True``, draw a rectangular border around the
6262
map scale or rose. Alternatively, specify a different pen with
6363
**+p**\ *pen*. Add **+g**\ *fill* to fill the scale panel [Default is
6464
no fill]. Append **+c**\ *clearance* where *clearance* is either gap,
@@ -71,14 +71,14 @@ def basemap(self, **kwargs):
7171
radius. You can override this radius by appending another value.
7272
Finally, append **+s** to draw an offset background shaded region.
7373
Here, *dx/dy* indicates the shift relative to the foreground frame
74-
[Default is 4p/-4p] and shade sets the fill style to use for shading
75-
[Default is gray50].
74+
[Default is ``"4p/-4p"``] and shade sets the fill style to use for
75+
shading [Default is ``"gray50"``].
7676
rose : str
77-
Draws a map directional rose on the map at the location defined by
77+
Draw a map directional rose on the map at the location defined by
7878
the reference and anchor points.
7979
compass : str
80-
Draws a map magnetic rose on the map at the location defined by the
81-
reference and anchor points
80+
Draw a map magnetic rose on the map at the location defined by the
81+
reference and anchor points.
8282
{verbose}
8383
{panel}
8484
{coltypes}

pygmt/src/binstats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def binstats(data, **kwargs):
8484
Normalize the resulting grid values by the area represented by the
8585
search *radius* [no normalization].
8686
search_radius : float or str
87-
Sets the *search_radius* that determines which data points are
87+
Set the *search_radius* that determines which data points are
8888
considered close to a node. Append the distance unit.
8989
Not compatible with ``tiling``.
9090
weight : str

pygmt/src/coast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def coast(self, **kwargs):
7676
strings in a list.
7777
resolution : str
7878
**f**\|\ **h**\|\ **i**\|\ **l**\|\ **c**.
79-
Selects the resolution of the data set to: (**f**\ )ull,
79+
Select the resolution of the data set to: (**f**\ )ull,
8080
(**h**\ )igh, (**i**\ )ntermediate, (**l**\ )ow,
8181
and (**c**\ )rude.
8282
land : str
@@ -127,7 +127,7 @@ def coast(self, **kwargs):
127127
map_scale : str
128128
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
129129
**+w**\ *length*.
130-
Draws a simple map scale centered on the reference point specified.
130+
Draw a simple map scale centered on the reference point specified.
131131
borders : int or str or list
132132
*border*\ [/*pen*].
133133
Draw political boundaries. Specify the type of boundary and

pygmt/src/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def colorbar(self, **kwargs):
5454
[**+h**\|\ **v**][**+j**\ *justify*]\
5555
[**+m**\ [**a**\|\ **c**\|\ **l**\|\ **u**]]\
5656
[**+n**\ [*txt*]][**+o**\ *dx*\ [/*dy*]].
57-
Defines the reference point on the map for the color scale using one of
57+
Define the reference point on the map for the color scale using one of
5858
four coordinate systems: (1) Use **g** for map (user) coordinates, (2)
5959
use **j** or **J** for setting *refpoint* via a 2-character
6060
justification code that refers to the (invisible) map domain rectangle,
@@ -71,7 +71,7 @@ def colorbar(self, **kwargs):
7171
box : bool or str
7272
[**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\
7373
[**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]].
74-
If set to ``True``, draws a rectangular border around the color scale.
74+
If set to ``True``, draw a rectangular border around the color scale.
7575
Alternatively, specify a different pen with **+p**\ *pen*. Add
7676
**+g**\ *fill* to fill the scale panel [Default is no fill]. Append
7777
**+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or

pygmt/src/contour.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ def contour(self, data=None, x=None, y=None, z=None, **kwargs):
8383
I : bool
8484
Color the triangles using CPT.
8585
triangular_mesh_pen : str
86-
Pen to draw the underlying triangulation [Default is None].
86+
Pen to draw the underlying triangulation [Default is ``None``].
8787
no_clip : bool
88-
Do NOT clip contours or image at the boundaries [Default will clip
89-
to fit inside region].
88+
Do **not** clip contours or image at the frame boundaries
89+
[Default is ``False`` to fit inside ``region``].
9090
Q : float or str
9191
[*cut*][**+z**].
92-
Do not draw contours with less than cut number of points.
92+
Do not draw contours with less than *cut* number of points.
9393
skip : bool or str
9494
[**p**\|\ **t**].
9595
Skip input points outside region.

pygmt/src/dimfilter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def dimfilter(grid, **kwargs):
7777
calculation.
7878
filter : str
7979
**x**\ *width*\ [**+l**\|\ **u**].
80-
Sets the primary filter type. Choose among convolution and
80+
Set the primary filter type. Choose among convolution and
8181
non-convolution filters. Use the filter code **x** followed by
8282
the full diameter *width*. Available convolution filters are:
8383
@@ -94,7 +94,7 @@ def dimfilter(grid, **kwargs):
9494
to return the smallest or largest of each sector's modal values.
9595
sectors : str
9696
**x**\ *sectors*\ [**+l**\|\ **u**]
97-
Sets the secondary filter type **x** and the number of bow-tie sectors.
97+
Set the secondary filter type **x** and the number of bow-tie sectors.
9898
*sectors* must be integer and larger than 0. When *sectors* is
9999
set to 1, the secondary filter is not effective. Available secondary
100100
filters **x** are:
@@ -108,14 +108,14 @@ def dimfilter(grid, **kwargs):
108108
value. Append **+l** or **+h** to the sectors if you rather want to
109109
return the smallest or largest of the modal values.
110110
spacing : str or list
111-
*x_inc* [and optionally *y_inc*] is the output Increment. Append
111+
*x_inc* [and optionally *y_inc*] is the output increment. Append
112112
**m** to indicate minutes, or **c** to indicate seconds. If the new
113113
*x_inc*, *y_inc* are NOT integer multiples of the old ones (in the
114-
input data), filtering will be considerably slower. [Default: Same
114+
input data), filtering will be considerably slower. [Default is same
115115
as input.]
116116
region : str or list
117117
[*xmin*, *xmax*, *ymin*, *ymax*].
118-
Defines the region of the output points. [Default: Same as input.]
118+
Define the region of the output points [Default is same as input].
119119
{verbose}
120120
121121
Returns

pygmt/src/filter1d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def filter1d(data, output_type="pandas", outfile=None, **kwargs):
3535
----------
3636
filter_type : str
3737
**type**\ *width*\ [**+h**].
38-
Sets the filter **type**. Choose among convolution and non-convolution
38+
Set the filter **type**. Choose among convolution and non-convolution
3939
filters. Append the filter code followed by the full filter
4040
*width* in same units as time column. By default, this
4141
performs a low-pass filtering; append **+h** to select high-pass
@@ -82,9 +82,9 @@ def filter1d(data, output_type="pandas", outfile=None, **kwargs):
8282
half the filter-width of data at each end.
8383
8484
time_col : int
85-
Indicates which column contains the independent variable (time). The
85+
Indicate which column contains the independent variable (time). The
8686
left-most column is 0, while the right-most is (*n_cols* - 1)
87-
[Default is 0].
87+
[Default is ``0``].
8888
8989
output_type : str
9090
Determine the format the xyz data will be returned in [Default is

pygmt/src/grd2cpt.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def grd2cpt(grid, **kwargs):
7878
grid : str or xarray.DataArray
7979
The file name of the input grid or the grid loaded as a DataArray.
8080
transparency : int or float or str
81-
Sets a constant level of transparency (0-100) for all color slices.
81+
Set a constant level of transparency (0-100) for all color slices.
8282
Append **+a** to also affect the foreground, background, and NaN
83-
colors [Default is no transparency, i.e., 0 (opaque)].
83+
colors [Default is no transparency, i.e., ``0`` (opaque)].
8484
cmap : str
85-
Selects the master color palette table (CPT) to use in the
85+
Select the master color palette table (CPT) to use in the
8686
interpolation. Full list of built-in color palette tables can be found
8787
at :gmt-docs:`cookbook/cpts.html#built-in-color-palette-tables-cpt`.
8888
background : bool or str
@@ -111,10 +111,10 @@ def grd2cpt(grid, **kwargs):
111111
to resample the color table into *nlevels* equidistant slices.
112112
series : list or str
113113
[*min/max/inc*\ [**+b**\|\ **l**\|\ **n**\]|\ *file*\|\ *list*\].
114-
Defines the range of the new CPT by giving the lowest and highest
114+
Define the range of the new CPT by giving the lowest and highest
115115
z-value (and optionally an interval). If this is not given, the
116116
existing range in the master CPT will be used intact. The values
117-
produced defines the color slice boundaries. If **+n** is used it
117+
produced defines the color slice boundaries. If **+n** is used it
118118
refers to the number of such boundaries and not the number of slices.
119119
For details on array creation, see
120120
:gmt-docs:`makecpt.html#generate-1d-array`.

pygmt/src/grdgradient.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ def grdgradient(grid, **kwargs):
125125
all nodes after gradient calculations are completed.
126126
tiles : str
127127
**c**\|\ **r**\|\ **R**.
128-
Controls how normalization via ``normalize`` is carried out. When
129-
multiple grids should be normalized the same way (i.e., with the same
130-
*offset* and/or *sigma*),
131-
we must pass these values via ``normalize``. However, this is
132-
inconvenient if we compute these values from a grid. Use **c** to
133-
save the results of *offset* and *sigma* to a statistics file; if
134-
grid output is not needed for this run then do not specify
135-
``outgrid``. For subsequent runs, just use **r** to read these
136-
values. Using **R** will read then delete the statistics file.
128+
Control how normalization via ``normalize`` is carried out. When
129+
multiple grids should be normalized the same way (i.e., with the same
130+
*offset* and/or *sigma*),
131+
we must pass these values via ``normalize``. However, this is
132+
inconvenient if we compute these values from a grid. Use **c** to
133+
save the results of *offset* and *sigma* to a statistics file; if
134+
grid output is not needed for this run then do not specify
135+
``outgrid``. For subsequent runs, just use **r** to read these
136+
values. Using **R** will read then delete the statistics file.
137137
{region}
138138
slope_file : str
139139
Name of output grid file with scalar magnitudes of gradient vectors.

pygmt/src/grdhisteq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ def _grdhisteq(grid, output_type, **kwargs):
8484
The name of the output ASCII file to store the results of the
8585
histogram equalization in.
8686
output_type: str
87-
Determines the output type. Use "file", "xarray", "pandas", or
87+
Determine the output type. Use "file", "xarray", "pandas", or
8888
"numpy".
8989
divisions : int
90-
Set the number of divisions of the data range [Default is 16].
90+
Set the number of divisions of the data range [Default is ``16``].
9191
9292
{region}
9393
{verbose}

pygmt/src/grdimage.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ def grdimage(self, grid, **kwargs):
112112
to project a raw image (an image without referencing coordinates).
113113
dpi : int
114114
[**i**\|\ *dpi*].
115-
Sets the resolution of the projected grid that will be created if a
116-
map projection other than Linear or Mercator was selected [100]. By
117-
default, the projected grid will be of the same size (rows and
118-
columns) as the input file. Specify **i** to use the PostScript
119-
image operator to interpolate the image at the device resolution.
115+
Set the resolution of the projected grid that will be created if a
116+
map projection other than Linear or Mercator was selected [Default
117+
is ``100`` dpi]. By default, the projected grid will be of the
118+
same size (rows and columns) as the input file. Specify **i** to
119+
use the PostScript image operator to interpolate the image at the
120+
device resolution.
120121
bit_color : str
121122
*color*\ [**+b**\|\ **f**\].
122123
This parameter only applies when a resulting 1-bit image otherwise
@@ -145,8 +146,8 @@ def grdimage(self, grid, **kwargs):
145146
Force conversion to monochrome image using the (television) YIQ
146147
transformation. Cannot be used with ``nan_transparent``.
147148
no_clip : bool
148-
Do not clip the image at the map boundary (only relevant for
149-
non-rectangular maps).
149+
Do **not** clip the image at the frame boundaries (only relevant
150+
for non-rectangular maps) [Default is ``False``].
150151
nan_transparent : bool
151152
Make grid nodes with z = NaN transparent, using the color-masking
152153
feature in PostScript Level 3 (the PS device must support PS Level

pygmt/src/grdinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def grdinfo(grid, **kwargs):
4343
{region}
4444
per_column : str or bool
4545
**n**\|\ **t**.
46-
Formats the report using tab-separated fields on a single line. The
46+
Format the report using tab-separated fields on a single line. The
4747
output is name *w e s n z0 z1 dx dy nx ny* [ *x0 y0 x1 y1* ]
4848
[ *med scale* ] [ *mean std rms* ] [ *n_nan* ] *registration gtype*.
4949
The data in brackets are outputted depending on the ``force_scan``

pygmt/src/grdlandmask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def grdlandmask(**kwargs):
5252
{region}
5353
{area_thresh}
5454
resolution : str
55-
*res*\[\ **+f**\]. Selects the resolution of the data set to use
55+
*res*\[\ **+f**\]. Select the resolution of the data set to use
5656
((**f**)ull, (**h**)igh, (**i**)ntermediate, (**l**)ow, or
5757
(**c**)rude). The resolution drops off by ~80% between data sets.
5858
[Default is **l**]. Append **+f** to automatically select a lower
@@ -77,7 +77,7 @@ def grdlandmask(**kwargs):
7777
ponds-in-islands-in-lakes outlines [Default is no line tracing].
7878
maskvalues : str or list
7979
[*wet*, *dry*] or [*ocean*, *land*, *lake*, *island*, *pond*].
80-
Sets the values that will be assigned to nodes. Values can
80+
Set the values that will be assigned to nodes. Values can
8181
be any number, including the textstring NaN
8282
[Default is [0, 1, 0, 1, 0] (i.e., [0, 1])]. Also select
8383
``bordervalues`` to let nodes exactly on feature boundaries be

0 commit comments

Comments
 (0)