Skip to content
Merged
30 changes: 16 additions & 14 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

COMMON_DOCSTRINGS = {
"area_thresh": r"""
area_thresh : int or float or str
area_thresh : float or str
*min_area*\ [/*min_level*/*max_level*][**+a**\[**g**\|\ **i**]\
[**s**\|\ **S**]][**+l**\|\ **r**][**+p**\ *percent*].
Features with an area smaller than *min_area* in km\ :sup:`2` or of
Expand Down Expand Up @@ -105,7 +105,7 @@
that do not match the pattern. Append **i** for case insensitive
matching. This does not apply to headers or segment headers.""",
"frame": r"""
frame : bool or str or list
frame : bool, str, or list
Set map boundary
:doc:`frame and axes attributes </tutorials/basics/frames>`. """,
"gap": r"""
Expand Down Expand Up @@ -247,7 +247,7 @@
used then the columns given to ``outcols`` correspond to the
order after the ``incols`` selection has taken place.""",
"panel": r"""
panel : bool or int or list
panel : bool, int, or list
[*row,col*\|\ *index*].
Select a specific subplot panel. Only allowed when in subplot
mode. Use ``panel=True`` to advance to the next panel in the
Expand Down Expand Up @@ -298,7 +298,7 @@
more of the columns equal NaN [Default skips record only
if values in all specified *cols* equal NaN].""",
"spacing": r"""
spacing : int or float or str or list or tuple
spacing : float, str, or list
*x_inc*\ [**+e**\|\ **n**][/\ *y_inc*\ [**+e**\|\ **n**]].
*x_inc* [and optionally *y_inc*] is the grid spacing.

Expand Down Expand Up @@ -329,7 +329,7 @@
the registration have already been initialized; use ``spacing`` and
``registration`` to override these values.""",
"transparency": r"""
transparency : int or float
transparency : float
Set transparency level, in [0-100] percent range
[Default is ``0``, i.e., opaque].
Only visible when PDF or raster format output is selected.
Expand Down Expand Up @@ -400,7 +400,7 @@ def fmt_docstring(module_func):
...
... Parameters
... ----------
... data : str or {table-like}
... data : str, {table-like}
... Pass in either a file name to an ASCII data table, a 2-D
... {table-classes}.
... {region}
Expand All @@ -416,7 +416,7 @@ def fmt_docstring(module_func):
<BLANKLINE>
Parameters
----------
data : str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geo...
data : str, numpy.ndarray, pandas.DataFrame, xarray.Dataset, or geo...
Pass in either a file name to an ASCII data table, a 2-D
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an
:class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`
Expand Down Expand Up @@ -444,13 +444,15 @@ def fmt_docstring(module_func):
aliases.append(f"- {arg} = {alias}")
filler_text["aliases"] = "\n".join(aliases)

filler_text["table-like"] = " or ".join(
[
"numpy.ndarray",
"pandas.DataFrame",
"xarray.Dataset",
"geopandas.GeoDataFrame",
]
filler_text["table-like"] = (
", ".join(
[
"numpy.ndarray",
"pandas.DataFrame",
"xarray.Dataset",
]
)
+ ", or geopandas.GeoDataFrame"
)
filler_text["table-classes"] = (
":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an\n"
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/binstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def binstats(data, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
A file name of an ASCII data table or a 2-D
{table-classes}.
outgrid : str or None
Expand Down Expand Up @@ -78,7 +78,7 @@ def binstats(data, **kwargs):
- **u** for maximum (upper)
- **U** for maximum of negative values only
- **z** for the sum
empty : float or int
empty : float
Set the value assigned to empty nodes [Default is NaN].
normalize : bool
Normalize the resulting grid values by the area represented by the
Expand Down
6 changes: 3 additions & 3 deletions pygmt/src/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2-D
{table-classes}.
Expand Down Expand Up @@ -201,7 +201,7 @@ def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2-D
{table-classes}.
Expand Down Expand Up @@ -288,7 +288,7 @@ def blockmode(data=None, x=None, y=None, z=None, outfile=None, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2-D
{table-classes}.
Expand Down
6 changes: 3 additions & 3 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def coast(self, **kwargs):
and (**c**\ )rude.
land : str
Select filling or clipping of "dry" areas.
rivers : int or str or list
rivers : int, str, or list
*river*\ [/*pen*].
Draw rivers. Specify the type of rivers and [optionally] append
pen attributes [Default is ``"0.25p,black,solid"``].
Expand Down Expand Up @@ -128,7 +128,7 @@ def coast(self, **kwargs):
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
**+w**\ *length*.
Draw a simple map scale centered on the reference point specified.
borders : int or str or list
borders : int, str, or list
*border*\ [/*pen*].
Draw political boundaries. Specify the type of boundary and
[optionally] append pen attributes
Expand All @@ -146,7 +146,7 @@ def coast(self, **kwargs):
a = All boundaries (1-3)
water : str
Select filling or clipping of "wet" areas.
shorelines : int or str or list
shorelines : int, str, or list
[*level*\ /]\ *pen*.
Draw shorelines [Default is no shorelines]. Append pen attributes
[Default is ``"0.25p,black,solid"``] which
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def colorbar(self, **kwargs):
scale : float
Multiply all z-values in the CPT by the provided scale. By default,
the CPT is used as is.
shading : str or list or bool
shading : str, list, or bool
Add illumination effects. Passing a single numerical value sets the
range of intensities from -value to +value. If not specified, 1 is
used. Alternatively, set ``shading=[low, high]`` to specify an
asymmetric intensity range from *low* to *high*. [Default is no
illumination].
equalsize : int or float or str
equalsize : float or str
[**i**]\ [*gap*].
Equal-sized color rectangles. By default, the rectangles are scaled
according to the z-range in the CPT (see also ``zfile``). If *gap* is
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def contour(self, data=None, x=None, y=None, z=None, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2-D
{table-classes}.
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grd2cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def grd2cpt(grid, **kwargs):
*start*, where we automatically build monotonically increasing
labels from *start* (a single letter or an integer). Additionally
append **-** to build ranges *start*-*start+1* as labels instead.
nlevels : bool or int or str
nlevels : bool, int, or str
Set to ``True`` to create a linear color table by using the grid
z-range as the new limits in the CPT. Alternatively, set *nlevels*
to resample the color table into *nlevels* equidistant slices.
Expand Down
8 changes: 4 additions & 4 deletions pygmt/src/grdclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ def grdclip(grid, **kwargs):
The name of the output netCDF file with extension .nc to store the grid
in.
{region}
above : str or list or tuple
above : str or list
[*high*, *above*].
Set all data[i] > *high* to *above*.
below : str or list or tuple
below : str or list
[*low*, *below*].
Set all data[i] < *low* to *below*.
between : str or list or tuple
between : str or list
[*low*, *high*, *between*].
Set all data[i] >= *low* and <= *high* to *between*.
new : str or list or tuple
new : str or list
[*old*, *new*].
Set all data[i] == *old* to *new*. This is mostly useful when
your data are known to be integer values.
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdcontour.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def grdcontour(self, grid, **kwargs):
angle (col 3).
- A fixed contour interval *cont_int* or a single contour with
+\ *cont_int*.
annotation : str, int, or list
annotation : str, int, or list
Specify or disable annotated contour levels, modifies annotated
contours specified in ``interval``.

Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def grdcut(grid, **kwargs):
in.
{projection}
{region}
extend : bool or int or float
extend : bool or float
Allow grid to be extended if new ``region`` exceeds existing
boundaries. Give a value to initialize nodes outside current region.
circ_subregion : str
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def grdfill(grid, **kwargs):
where (*X,Y*) are the node dimensions of the grid]), or
**s** for bicubic spline (optionally append a *tension*
parameter [Default is no tension]).
no_data : int or float
no_data : float
Set the node value used to identify a point as a member of a hole
[Default is NaN].

Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdgradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def grdgradient(grid, **kwargs):
outgrid : str or None
The name of the output netCDF file with extension .nc to store the grid
in.
azimuth : int or float or str or list
azimuth : float, str, or list
*azim*\ [/*azim2*].
Azimuthal direction for a directional derivative; *azim* is the
angle in the x,y plane measured in degrees positive clockwise from
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdhisteq.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _grdhisteq(grid, output_type, **kwargs):
outgrid : str or bool or None
The name of the output netCDF file with extension .nc to store the
grid in.
outfile : str or bool or None
outfile : str, bool, or None
The name of the output ASCII file to store the results of the
histogram equalization in.
output_type: str
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdlandmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def grdlandmask(**kwargs):
the coastlines differ in details a node in a mask file using one
resolution is not guaranteed to remain inside [or outside] when a
different resolution is selected.
bordervalues : bool or str or float or list
bordervalues : bool, str, float, or list
Nodes that fall exactly on a polygon boundary should be
considered to be outside the polygon [Default considers them to be
inside]. Alternatively, append either a list of four values
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/grdtrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
Gridded array from which to sample values from, or a file name (netCDF
format).

points : str or {table-like}
points : str, {table-like}
Pass in either a file name to an ASCII data table, a 2-D
{table-classes}.

Expand Down Expand Up @@ -228,7 +228,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
by deviations (**+d**) and finally residuals (**+r**). When more
than one grid is sampled this sequence of 1-3 columns is repeated
for each grid.
radius : bool or int or float or str
radius : bool, float, or str
[*radius*][**+e**\|\ **p**].
To be used with normal grid sampling, and limited to a single, non-IMG
grid. If the nearest node to the input point is NaN, search outwards
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs):
- ``file`` - ASCII file (requires ``outfile``)
outfile : str
The file name for the output ASCII file.
contour : str or int or float or list
contour : str, float, or list
*cval*\|\ *low/high/delta*\|\ **r**\ *low/high*\|\ **r**\ *cval*.
Find area, volume and mean height (volume/area) inside and above the
*cval* contour. Alternatively, search using all contours from *low* to
Expand Down
8 changes: 4 additions & 4 deletions pygmt/src/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def histogram(self, data, **kwargs):

Parameters
----------
data : str or list or {table-like}
data : str, list, {table-like}
Pass in either a file name to an ASCII data table, a Python list, a 2-D
{table-classes}.
{projection}
Expand All @@ -67,7 +67,7 @@ def histogram(self, data, **kwargs):
annotation font; use **+o** to change the offset between bar and
label [Default is ``"6p"``]; use **+r** to rotate the labels from
horizontal to vertical.
barwidth : int or float or str
barwidth : float or str
*width*\ [**+o**\ *offset*].
Use an alternative histogram bar width than the default set via
``series``, and optionally shift all bars by an *offset*. Here
Expand All @@ -78,7 +78,7 @@ def histogram(self, data, **kwargs):
plot dimension units by appending the relevant unit.
center : bool
Center bin on each value. [Default is left edge].
distribution : bool or int or float or str
distribution : bool, float, or str
[*mode*][**+p**\ *pen*].
Draw the equivalent normal distribution; append desired
*pen* [Default is ``"0.25p,black,solid"``].
Expand All @@ -105,7 +105,7 @@ def histogram(self, data, **kwargs):
horizontal : bool
Plot the histogram using horizontal bars instead of the
default vertical bars.
series : int or str or list
series : int, str, or list
[*min*\ /*max*\ /]\ *inc*\ [**+n**\ ].
Set the interval for the width of each bar in the histogram.
histtype : int or str
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def info(data, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in either a file name to an ASCII data table, a 1-D/2-D
{table-classes}.
per_column : bool
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/inset.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def inset(self, **kwargs):
indicates the shift relative to the foreground frame [Default is
``"4p/-4p"``] and ``shade`` sets the fill style to use for
shading [Default is ``"gray50"``].
margin : int or str or list
margin : float, str, or list
This is clearance that is added around the inside of the inset.
Plotting will take place within the inner region only. The margins
can be a single value, a pair of values separated (for setting
Expand Down
14 changes: 7 additions & 7 deletions pygmt/src/meca.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def meca(
``convention`` parameter is required so we know how to interpret the
columns. If ``spec`` is a dictionary or a pd.DataFrame,
``convention`` is not needed and is ignored if specified.
scale : int, float, or str
scale : float or str
*scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\
[**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*].
Adjust scaling of the radius of the beachball, which is
Expand Down Expand Up @@ -307,27 +307,27 @@ def meca(
- ``"dc"``: the closest double couple defined from the moment tensor
(zero trace and zero determinant)
- ``"deviatoric"``: deviatoric part of the moment tensor (zero trace)
longitude : int, float, list, or 1-D numpy array
longitude : float, list, or 1-D numpy array
Longitude(s) of event location(s). Must be the same length as the
number of events. Will override the ``longitude`` values
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
latitude : int, float, list, or 1-D numpy array
latitude : float, list, or 1-D numpy array
Latitude(s) of event location(s). Must be the same length as the
number of events. Will override the ``latitude`` values
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
depth : int, float, list, or 1-D numpy array
depth : float, list, or 1-D numpy array
Depth(s) of event location(s) in kilometers. Must be the same length
as the number of events. Will override the ``depth`` values in ``spec``
if ``spec`` is a dictionary or pd.DataFrame.
plot_longitude : int, float, str, list, or 1-D numpy array
plot_longitude : float, str, list, or 1-D numpy array
Longitude(s) at which to place beachball(s). Must be the same length
as the number of events. Will override the ``plot_longitude`` values
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
plot_latitude : int, float, str, list, or 1-D numpy array
plot_latitude : float, str, list, or 1-D numpy array
Latitude(s) at which to place beachball(s). List must be the same
length as the number of events. Will override the ``plot_latitude``
values in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
event_name : str or list of str, or 1-D numpy array
event_name : str, list of str, or 1-D numpy array
Text string(s), e.g., event name(s) to appear near the beachball(s).
List must be the same length as the number of events. Will override
the ``event_name`` labels in ``spec`` if ``spec`` is a dictionary
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/nearneighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def nearneighbor(data=None, x=None, y=None, z=None, **kwargs):

Parameters
----------
data : str or {table-like}
data : str, {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2-D
{table-classes}.
Expand Down
Loading