Skip to content

Commit a4e557a

Browse files
yvonnefroehlichJosh Sixsmith
authored andcommitted
Correct and consistent usage of 'function, 'method', and 'class' (GenericMappingTools#2043)
1 parent 237d574 commit a4e557a

34 files changed

+73
-72
lines changed

doc/api/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Saving and displaying the figure
8484
Configuring the display settings
8585
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8686

87-
The following module is provided directly through the :mod:`pygmt` top level
87+
The following function is provided directly through the :mod:`pygmt` top level
8888
package.
8989

9090
.. autosummary::
@@ -95,7 +95,7 @@ package.
9595
Color palette table generation
9696
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9797

98-
The following modules are provided directly through the :mod:`pygmt` top level
98+
The following functions are provided directly through the :mod:`pygmt` top level
9999
package.
100100

101101
.. autosummary::

doc/contributing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Guidelines for a good tutorial:
392392
concise examples while the tutorials are detailed and full of text.
393393
* SI units should be used in the example code for tutorial plots.
394394

395-
Note that the `Figure.show()` function needs to be called for a plot to be inserted into
395+
Note that the `Figure.show()` method needs to be called for a plot to be inserted into
396396
the documentation.
397397

398398
### Editing the API Documentation
@@ -576,7 +576,7 @@ returning the `pygmt.Figure` object:
576576
```python
577577
@pytest.mark.mpl_image_compare
578578
def test_my_plotting_case():
579-
"Test that my plotting function works"
579+
"Test that my plotting method works"
580580
fig = Figure()
581581
fig.basemap(region=[0, 360, -90, 90], projection='W7i', frame=True)
582582
return fig
@@ -682,7 +682,7 @@ Here's an example:
682682
```python
683683
@check_figures_equal()
684684
def test_my_plotting_case():
685-
"Test that my plotting function works"
685+
"Test that my plotting method works"
686686
fig_ref, fig_test = Figure(), Figure()
687687
fig_ref.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap="geo")
688688
fig_test.grdimage(grid, projection="W120/15c", cmap="geo")

examples/gallery/3d_plots/scatter3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
can be visualized using a perspective 3D plot. The ``region``
99
parameter has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the
1010
form of (xmin, xmax, ymin, ymax, zmin, zmax), which can be done automatically
11-
using :meth:`pygmt.info`. To plot the z-axis frame, set ``frame`` as a
11+
using :func:`pygmt.info`. To plot the z-axis frame, set ``frame`` as a
1212
minimum to something like ``frame=["WsNeZ", "zaf"]``. Use ``perspective`` to
1313
control the azimuth and elevation angle of the view, and ``zscale`` to adjust
1414
the vertical exaggeration factor.

examples/gallery/embellishments/colorbars_multiple.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
nrows=1, ncols=2, figsize=("15c", "8c"), autolabel=True, margins="0.5c"
2424
):
2525
# Activate the first panel so that the colormap created by the makecpt
26-
# method is a panel-level CPT
26+
# function is a panel-level CPT
2727
with fig.set_panel(panel=0):
2828
pygmt.makecpt(cmap="geo", series=[-8000, 8000])
2929
# "R?" means Winkel Tripel projection with map width automatically
3030
# determined from the subplot width.
3131
fig.grdimage(grid=grid_globe, projection="R?", region="g", frame="a")
3232
fig.colorbar(frame=["a4000f2000", "x+lElevation", "y+lm"])
3333
# Activate the second panel so that the colormap created by the makecpt
34-
# method is a panel-level CPT
34+
# function is a panel-level CPT
3535
with fig.set_panel(panel=1):
3636
pygmt.makecpt(cmap="globe", series=[-6000, 3000])
3737
# "M?" means Mercator projection with map width also automatically

examples/gallery/embellishments/inset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-----
44
55
The :meth:`pygmt.Figure.inset` method adds an inset figure inside a larger
6-
figure. The function is called using a ``with`` statement, and its
6+
figure. The method is called using a ``with`` statement, and its
77
``position``, ``box``, ``offset``, and ``margin`` parameters are set. Plotting
88
methods called within the ``with`` statement are applied to the inset figure.
99
"""

examples/gallery/embellishments/inset_rectangle_region.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--------------------------------------
44
55
The :meth:`pygmt.Figure.inset` method adds an inset figure inside a larger
6-
figure. The function is called using a ``with`` statement, and its
6+
figure. The method is called using a ``with`` statement, and its
77
``position``, ``box``, ``offset``, and ``margin`` can be customized. Plotting
88
methods called within the ``with`` statement plot into the inset figure.
99
"""

examples/gallery/histograms/blockm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Blockmean
33
---------
4-
The :meth:`pygmt.blockmean` method calculates different quantities
4+
The :func:`pygmt.blockmean` function calculates different quantities
55
inside blocks/bins whose dimensions are defined via the ``spacing`` parameter.
66
The following examples show how to calculate the averages of the given values
77
inside each bin and how to report the number of points inside each bin.

examples/gallery/images/grdclip.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
22
Clipping grid values
33
--------------------
4-
The :meth:`pygmt.grdclip` method allows to clip defined ranges of grid values.
5-
In the example shown below we set all elevation values (grid points) smaller
6-
than 0 m (in general the bathymetric part of the grid) to a common value of
7-
-2000 m via the ``below`` parameter.
4+
The :func:`pygmt.grdclip` function allows to clip defined ranges of grid
5+
values. In the example shown below we set all elevation values (grid points)
6+
smaller than 0 m (in general the bathymetric part of the grid) to a common
7+
value of -2000 m via the ``below`` parameter.
88
"""
99

1010
import pygmt

examples/gallery/images/grdgradient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
Calculating grid gradient and radiance
33
--------------------------------------
4-
The :meth:`pygmt.grdgradient` method calculates the gradient of a grid file.
4+
The :func:`pygmt.grdgradient` function calculates the gradient of a grid file.
55
In the example shown below we will see how to calculate a hillshade map based
6-
on a Data Elevation Model (DEM). As input :meth:`pygmt.grdgradient` gets
6+
on a Data Elevation Model (DEM). As input :func:`pygmt.grdgradient` gets
77
a :class:`xarray.DataArray` object or a path string to a grid file, calculates
88
the respective gradient and returns it as an :class:`xarray.DataArray` object.
99
We will use the ``radiance`` parameter in order to set the illumination source

examples/gallery/images/grdlandmask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Create 'wet-dry' mask grid
33
--------------------------
4-
The :meth:`pygmt.grdlandmask` method allows setting
4+
The :func:`pygmt.grdlandmask` function allows setting
55
all nodes on land or water to a specified value using
66
the ``maskvalues`` parameter.
77
"""

0 commit comments

Comments
 (0)