Skip to content

Commit 6bd5e72

Browse files
DOC: Fix highlighting, typos, etc. - Part I (#3574)
1 parent 8b6f61d commit 6bd5e72

25 files changed

+63
-62
lines changed

pygmt/src/binstats.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def binstats(data, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
7272
Set the value assigned to empty nodes [Default is NaN].
7373
normalize : bool
7474
Normalize the resulting grid values by the area represented by the
75-
search *radius* [no normalization].
75+
search *radius* [Default is no normalization].
7676
search_radius : float or str
7777
Set the *search_radius* that determines which data points are
7878
considered close to a node. Append the distance unit.
@@ -98,7 +98,7 @@ def binstats(data, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
9898
Return type depends on whether the ``outgrid`` parameter is set:
9999
100100
- :class:`xarray.DataArray` if ``outgrid`` is not set
101-
- None if ``outgrid`` is set (grid output will be stored in file set by
101+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
102102
``outgrid``)
103103
"""
104104
with Session() as lib:

pygmt/src/blockm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def blockmedian(
244244
ret
245245
Return type depends on ``outfile`` and ``output_type``:
246246
247-
- ``None`` if ``outfile`` is set (output will be stored in file set by
247+
- ``None`` if ``outfile`` is set (output will be stored in the file set by
248248
``outfile``)
249249
- :class:`pandas.DataFrame` or :class:`numpy.ndarray` if ``outfile`` is not set
250250
(depends on ``output_type``)
@@ -342,7 +342,7 @@ def blockmode(
342342
ret
343343
Return type depends on ``outfile`` and ``output_type``:
344344
345-
- ``None`` if ``outfile`` is set (output will be stored in file set by
345+
- ``None`` if ``outfile`` is set (output will be stored in the file set by
346346
``outfile``)
347347
- :class:`pandas.DataFrame` or :class:`numpy.ndarray` if ``outfile`` is not set
348348
(depends on ``output_type``)

pygmt/src/dimfilter.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def dimfilter(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None
9898
spacing : str or list
9999
*x_inc* [and optionally *y_inc*] is the output increment. Append
100100
**m** to indicate minutes, or **c** to indicate seconds. If the new
101-
*x_inc*, *y_inc* are NOT integer multiples of the old ones (in the
101+
*x_inc*, *y_inc* are **not** integer multiples of the old ones (in the
102102
input data), filtering will be considerably slower. [Default is same
103-
as input.]
103+
as the input.]
104104
region : str or list
105105
[*xmin*, *xmax*, *ymin*, *ymax*].
106-
Define the region of the output points [Default is same as input].
106+
Define the region of the output points [Default is the same as the input].
107107
{verbose}
108108
109109
Returns
@@ -112,7 +112,7 @@ def dimfilter(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None
112112
Return type depends on whether the ``outgrid`` parameter is set:
113113
114114
- :class:`xarray.DataArray` if ``outgrid`` is not set
115-
- None if ``outgrid`` is set (grid output will be stored in file set by
115+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
116116
``outgrid``)
117117
118118
Example

pygmt/src/filter1d.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def filter1d(
105105
ret
106106
Return type depends on ``outfile`` and ``output_type``:
107107
108-
- None if ``outfile`` is set (output will be stored in file set by ``outfile``)
108+
- ``None`` if ``outfile`` is set (output will be stored in the file set by
109+
``outfile``)
109110
- :class:`pandas.DataFrame` or :class:`numpy.ndarray` if ``outfile`` is not set
110111
(depends on ``output_type``)
111112
"""

pygmt/src/grd2xyz.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def grd2xyz(
121121
ret
122122
Return type depends on ``outfile`` and ``output_type``:
123123
124-
- None if ``outfile`` is set (output will be stored in file set by ``outfile``)
124+
- ``None`` if ``outfile`` is set (output will be stored in the file set by
125+
``outfile``)
125126
- :class:`pandas.DataFrame` or :class:`numpy.ndarray` if ``outfile`` is not set
126127
(depends on ``output_type``)
127128
@@ -133,7 +134,7 @@ def grd2xyz(
133134
>>> grid = pygmt.datasets.load_earth_relief(
134135
... resolution="30m", region=[10, 30, 15, 25]
135136
... )
136-
>>> # Create a pandas DataFrame with the xyz data from an input grid
137+
>>> # Create a pandas.DataFrame with the xyz data from an input grid
137138
>>> xyz_dataframe = pygmt.grd2xyz(grid=grid, output_type="pandas")
138139
>>> xyz_dataframe.head(n=2)
139140
lon lat z

pygmt/src/grdclip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def grdclip(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
6767
Return type depends on whether the ``outgrid`` parameter is set:
6868
6969
- :class:`xarray.DataArray` if ``outgrid`` is not set
70-
- None if ``outgrid`` is set (grid output will be stored in file set by
70+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
7171
``outgrid``)
7272
7373
Example

pygmt/src/grdcontour.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def grdcontour(self, grid, **kwargs):
4040
r"""
4141
Convert grids or images to contours and plot them on maps.
4242
43-
Takes a grid file name or an xarray.DataArray object as input.
43+
Takes a grid file name or an :class:`xarray.DataArray` object as input.
4444
4545
Full option list at :gmt-docs:`grdcontour.html`
4646

pygmt/src/grdcut.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def grdcut(grid, **kwargs) -> xr.DataArray | None:
8585
Return type depends on whether the ``outgrid`` parameter is set:
8686
8787
- :class:`xarray.DataArray` if ``outgrid`` is not set
88-
- None if ``outgrid`` is set (grid output will be stored in file set by
88+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
8989
``outgrid``)
9090
9191
Example

pygmt/src/grdfill.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
5656
Return type depends on whether the ``outgrid`` parameter is set:
5757
5858
- :class:`xarray.DataArray` if ``outgrid`` is not set
59-
- None if ``outgrid`` is set (grid output will be stored in file set by
59+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
6060
``outgrid``)
6161
6262
Example

pygmt/src/grdfilter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def grdfilter(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None
102102
Return type depends on whether the ``outgrid`` parameter is set:
103103
104104
- :class:`xarray.DataArray` if ``outgrid`` is not set
105-
- None if ``outgrid`` is set (grid output will be stored in file set by
105+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
106106
``outgrid``)
107107
108108
Examples

pygmt/src/grdgradient.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def grdgradient(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | No
143143
Return type depends on whether the ``outgrid`` parameter is set:
144144
145145
- :class:`xarray.DataArray` if ``outgrid`` is not set
146-
- None if ``outgrid`` is set (grid output will be stored in file set by
146+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
147147
``outgrid``)
148148
149149

pygmt/src/grdhisteq.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ def equalize_grid(
9999
ret
100100
Return type depends on the ``outgrid`` parameter:
101101
102-
- xarray.DataArray if ``outgrid`` is None
103-
- None if ``outgrid`` is a str (grid output is stored in
104-
``outgrid``)
102+
- :class:`xarray.DataArray` if ``outgrid`` is ``None``
103+
- ``None`` if ``outgrid`` is a str (grid output is stored in ``outgrid``)
105104
106105
Example
107106
-------

pygmt/src/grdimage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def grdimage(self, grid, **kwargs):
103103
paint the mask with the given color. Append **+b** to paint the
104104
background pixels (1) or **+f** for the foreground pixels
105105
[Default is **+f**].
106-
shading : str or xarray.DataArray
106+
shading : str or :class:`xarray.DataArray`
107107
[*intensfile*\|\ *intensity*\|\ *modifiers*].
108108
Give the name of a grid file or a DataArray with intensities in the
109109
(-1,+1) range, or a constant intensity to apply everywhere (affects the

pygmt/src/grdinfo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def grdinfo(grid, **kwargs):
3030
r"""
3131
Get information about a grid.
3232
33-
Can read the grid from a file or given as an xarray.DataArray grid.
33+
Can read the grid from a file or given as an :class:`xarray.DataArray` grid.
3434
3535
Full option list at :gmt-docs:`grdinfo.html`
3636

pygmt/src/grdlandmask.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def grdlandmask(outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
8585
Return type depends on whether the ``outgrid`` parameter is set:
8686
8787
- :class:`xarray.DataArray` if ``outgrid`` is not set
88-
- None if ``outgrid`` is set (grid output will be stored in file set by
88+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
8989
``outgrid``)
9090
9191
Example

pygmt/src/grdproject.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def grdproject(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | Non
5353
{grid}
5454
{outgrid}
5555
inverse : bool
56-
When set to ``True`` transforms grid from rectangular to
57-
geographical [Default is False].
56+
When set to ``True`` transforms grid from rectangular to geographical
57+
[Default is ``False``].
5858
{projection}
5959
{region}
6060
center : str or list
@@ -63,7 +63,7 @@ def grdproject(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | Non
6363
is relative to lower left corner]. Optionally, add offsets in the
6464
projected units to be added (or subtracted when ``inverse`` is set) to
6565
(from) the projected coordinates, such as false eastings and
66-
northings for particular projection zones [0/0].
66+
northings for particular projection zones [Default is ``[0, 0]``].
6767
{spacing}
6868
dpi : int
6969
Set the resolution for the new grid in dots per inch.
@@ -89,7 +89,7 @@ def grdproject(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | Non
8989
Return type depends on whether the ``outgrid`` parameter is set:
9090
9191
- :class:`xarray.DataArray` if ``outgrid`` is not set
92-
- None if ``outgrid`` is set (grid output will be stored in file set by
92+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
9393
``outgrid``)
9494
9595
Example

pygmt/src/grdsample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def grdsample(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None
6565
Return type depends on whether the ``outgrid`` parameter is set:
6666
6767
- :class:`xarray.DataArray` if ``outgrid`` is not set
68-
- None if ``outgrid`` is set (grid output will be stored in file set by
68+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
6969
``outgrid``)
7070
7171
Example

pygmt/src/grdtrack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def grdtrack(
191191
{region}
192192
no_skip : bool
193193
Do *not* skip points that fall outside the domain of the grid(s)
194-
[Default only output points within grid domain].
194+
[Default only output points within the grid domain].
195195
stack : str or list
196196
*method*/*modifiers*.
197197
In conjunction with ``crossprofile``, compute a single stacked profile

pygmt/src/grdview.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def grdview(self, grid, **kwargs):
6161
{frame}
6262
cmap : str
6363
The name of the color palette table to use.
64-
drapegrid : str or xarray.DataArray
64+
drapegrid : str or :class:`xarray.DataArray`
6565
The file name or a DataArray of the image grid to be draped on top
6666
of the relief provided by ``grid`` [Default determines colors from grid].
6767
Note that ``zscale`` and ``plane`` always refer to the grid.

pygmt/src/histogram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Histogram - Create a histogram
2+
Histogram - Create a histogram.
33
"""
44

55
from pygmt.clib import Session

pygmt/src/info.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def info(data, **kwargs):
3434
the number of columns vary from record to record. As an option, it will
3535
find the extent of the first two columns rounded up and down to the nearest
3636
multiple of the supplied increments given by ``spacing``. Such output will
37-
be in a numpy.ndarray form [*w*, *e*, *s*, *n*], which can be used
37+
be in a :class:`numpy.ndarray` form [*w*, *e*, *s*, *n*], which can be used
3838
directly as the ``region`` parameter for other modules (hence only *dx*
3939
and *dy* are needed). If the ``per_column`` parameter is combined with
40-
``spacing``, then the numpy.ndarray output will be rounded up/down for as
40+
``spacing``, then the :class:`numpy.ndarray` output will be rounded up/down for as
4141
many columns as there are increments provided in ``spacing``. A similar
42-
parameter ``nearest_multiple`` will provide a numpy.ndarray in the form
42+
parameter ``nearest_multiple`` will provide a :class:`numpy.ndarray` in the form
4343
of [*zmin*, *zmax*, *dz*] for makecpt.
4444
4545
Full option list at :gmt-docs:`gmtinfo.html`
@@ -73,7 +73,7 @@ def info(data, **kwargs):
7373
7474
Returns
7575
-------
76-
output : np.ndarray or str
76+
output : :class:`numpy.ndarray` or str
7777
Return type depends on whether any of the ``per_column``,
7878
``spacing``, or ``nearest_multiple`` parameters are set.
7979

pygmt/src/meca.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915
227227
228228
Parameters
229229
----------
230-
spec : str, 1-D array, 2-D array, dict, or pd.DataFrame
230+
spec : str, 1-D array, 2-D array, dict, or :class:`pandas.DataFrame`
231231
Data that contain focal mechanism parameters.
232232
233233
``spec`` can be specified in either of the following types:
@@ -250,9 +250,10 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915
250250
The meanings of columns are the same as above.
251251
- *2-D array*: focal mechanism parameters of multiple events.
252252
The meanings of columns are the same as above.
253-
- *dictionary or pd.DataFrame*: The dictionary keys or pd.DataFrame
254-
column names determine the focal mechanism convention. For
255-
different conventions, the following combination of keys are allowed:
253+
- *dictionary or :class:`pandas.DataFrame`*: The dictionary keys or
254+
:class:`pandas.DataFrame` column names determine the focal mechanism
255+
convention. For different conventions, the following combination of
256+
keys are allowed:
256257
257258
- ``"aki"``: *strike, dip, rake, magnitude*
258259
- ``"gcmt"``: *strike1, dip1, rake1, strike2, dip2, rake2, mantissa,*
@@ -265,13 +266,13 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915
265266
A dictionary may contain values for a single focal mechanism or
266267
lists of values for multiple focal mechanisms.
267268
268-
Both dictionary and pd.DataFrame may optionally contain
269+
Both dictionary and :class:`pandas.DataFrame` may optionally contain
269270
keys/column names: ``latitude``, ``longitude``, ``depth``,
270271
``plot_longitude``, ``plot_latitude``, and/or ``event_name``.
271272
272273
If ``spec`` is either a str, a 1-D array or a 2-D array, the
273274
``convention`` parameter is required so we know how to interpret the
274-
columns. If ``spec`` is a dictionary or a pd.DataFrame,
275+
columns. If ``spec`` is a dictionary or a :class:`pandas.DataFrame`,
275276
``convention`` is not needed and is ignored if specified.
276277
scale : float or str
277278
*scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\
@@ -299,7 +300,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915
299300
- ``"partial"`` (partial focal mechanism)
300301
- ``"principal_axis"`` (principal axis)
301302
302-
Ignored if ``spec`` is a dictionary or pd.DataFrame.
303+
Ignored if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
303304
component : str
304305
The component of the seismic moment tensor to plot.
305306
@@ -310,28 +311,28 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915
310311
longitude : float, list, or 1-D numpy array
311312
Longitude(s) of event location(s). Must be the same length as the
312313
number of events. Will override the ``longitude`` values
313-
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
314+
in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
314315
latitude : float, list, or 1-D numpy array
315316
Latitude(s) of event location(s). Must be the same length as the
316317
number of events. Will override the ``latitude`` values
317-
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
318+
in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
318319
depth : float, list, or 1-D numpy array
319320
Depth(s) of event location(s) in kilometers. Must be the same length
320321
as the number of events. Will override the ``depth`` values in ``spec``
321-
if ``spec`` is a dictionary or pd.DataFrame.
322+
if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
322323
plot_longitude : float, str, list, or 1-D numpy array
323324
Longitude(s) at which to place beachball(s). Must be the same length
324325
as the number of events. Will override the ``plot_longitude`` values
325-
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
326+
in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
326327
plot_latitude : float, str, list, or 1-D numpy array
327328
Latitude(s) at which to place beachball(s). List must be the same
328329
length as the number of events. Will override the ``plot_latitude``
329-
values in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
330+
values in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`.
330331
event_name : str, list of str, or 1-D numpy array
331332
Text string(s), e.g., event name(s) to appear near the beachball(s).
332333
List must be the same length as the number of events. Will override
333334
the ``event_name`` labels in ``spec`` if ``spec`` is a dictionary
334-
or pd.DataFrame.
335+
or :class:`pandas.DataFrame`.
335336
labelbox : bool or str
336337
[*fill*].
337338
Draw a box behind the label if given. Use *fill* to give a fill color

pygmt/src/nearneighbor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def nearneighbor(
122122
Return type depends on whether the ``outgrid`` parameter is set:
123123
124124
- :class:`xarray.DataArray`: if ``outgrid`` is not set
125-
- None if ``outgrid`` is set (grid output will be stored in file set by
125+
- ``None`` if ``outgrid`` is set (grid output will be stored in the file set by
126126
``outgrid``)
127127
Example
128128
-------

0 commit comments

Comments
 (0)