Skip to content

Commit c39f196

Browse files
committed
Merge branch 'main' into text-list-support
2 parents 610f765 + 9217078 commit c39f196

38 files changed

+83
-80
lines changed

pygmt/helpers/decorators.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
COMMON_DOCSTRINGS = {
1818
"area_thresh": r"""
19-
area_thresh : int or float or str
19+
area_thresh : float or str
2020
*min_area*\ [/*min_level*/*max_level*][**+a**\[**g**\|\ **i**]\
2121
[**s**\|\ **S**]][**+l**\|\ **r**][**+p**\ *percent*].
2222
Features with an area smaller than *min_area* in km\ :sup:`2` or of
@@ -105,7 +105,7 @@
105105
that do not match the pattern. Append **i** for case insensitive
106106
matching. This does not apply to headers or segment headers.""",
107107
"frame": r"""
108-
frame : bool or str or list
108+
frame : bool, str, or list
109109
Set map boundary
110110
:doc:`frame and axes attributes </tutorials/basics/frames>`. """,
111111
"gap": r"""
@@ -247,7 +247,7 @@
247247
used then the columns given to ``outcols`` correspond to the
248248
order after the ``incols`` selection has taken place.""",
249249
"panel": r"""
250-
panel : bool or int or list
250+
panel : bool, int, or list
251251
[*row,col*\|\ *index*].
252252
Select a specific subplot panel. Only allowed when in subplot
253253
mode. Use ``panel=True`` to advance to the next panel in the
@@ -298,7 +298,7 @@
298298
more of the columns equal NaN [Default skips record only
299299
if values in all specified *cols* equal NaN].""",
300300
"spacing": r"""
301-
spacing : int or float or str or list or tuple
301+
spacing : float, str, or list
302302
*x_inc*\ [**+e**\|\ **n**][/\ *y_inc*\ [**+e**\|\ **n**]].
303303
*x_inc* [and optionally *y_inc*] is the grid spacing.
304304
@@ -329,7 +329,7 @@
329329
the registration have already been initialized; use ``spacing`` and
330330
``registration`` to override these values.""",
331331
"transparency": r"""
332-
transparency : int or float
332+
transparency : float
333333
Set transparency level, in [0-100] percent range
334334
[Default is ``0``, i.e., opaque].
335335
Only visible when PDF or raster format output is selected.
@@ -400,7 +400,7 @@ def fmt_docstring(module_func):
400400
...
401401
... Parameters
402402
... ----------
403-
... data : str or {table-like}
403+
... data : str, {table-like}
404404
... Pass in either a file name to an ASCII data table, a 2-D
405405
... {table-classes}.
406406
... {region}
@@ -416,7 +416,7 @@ def fmt_docstring(module_func):
416416
<BLANKLINE>
417417
Parameters
418418
----------
419-
data : str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geo...
419+
data : str, numpy.ndarray, pandas.DataFrame, xarray.Dataset, or geo...
420420
Pass in either a file name to an ASCII data table, a 2-D
421421
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an
422422
:class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`
@@ -444,13 +444,15 @@ def fmt_docstring(module_func):
444444
aliases.append(f"- {arg} = {alias}")
445445
filler_text["aliases"] = "\n".join(aliases)
446446

447-
filler_text["table-like"] = " or ".join(
448-
[
449-
"numpy.ndarray",
450-
"pandas.DataFrame",
451-
"xarray.Dataset",
452-
"geopandas.GeoDataFrame",
453-
]
447+
filler_text["table-like"] = (
448+
", ".join(
449+
[
450+
"numpy.ndarray",
451+
"pandas.DataFrame",
452+
"xarray.Dataset",
453+
]
454+
)
455+
+ ", or geopandas.GeoDataFrame"
454456
)
455457
filler_text["table-classes"] = (
456458
":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an\n"

pygmt/src/binstats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def binstats(data, **kwargs):
4848
4949
Parameters
5050
----------
51-
data : str or {table-like}
51+
data : str, {table-like}
5252
A file name of an ASCII data table or a 2-D
5353
{table-classes}.
5454
outgrid : str or None
@@ -78,7 +78,7 @@ def binstats(data, **kwargs):
7878
- **u** for maximum (upper)
7979
- **U** for maximum of negative values only
8080
- **z** for the sum
81-
empty : float or int
81+
empty : float
8282
Set the value assigned to empty nodes [Default is NaN].
8383
normalize : bool
8484
Normalize the resulting grid values by the area represented by the

pygmt/src/blockm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
105105
106106
Parameters
107107
----------
108-
data : str or {table-like}
108+
data : str, {table-like}
109109
Pass in (x, y, z) or (longitude, latitude, elevation) values by
110110
providing a file name to an ASCII data table, a 2-D
111111
{table-classes}.
@@ -201,7 +201,7 @@ def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
201201
202202
Parameters
203203
----------
204-
data : str or {table-like}
204+
data : str, {table-like}
205205
Pass in (x, y, z) or (longitude, latitude, elevation) values by
206206
providing a file name to an ASCII data table, a 2-D
207207
{table-classes}.
@@ -288,7 +288,7 @@ def blockmode(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
288288
289289
Parameters
290290
----------
291-
data : str or {table-like}
291+
data : str, {table-like}
292292
Pass in (x, y, z) or (longitude, latitude, elevation) values by
293293
providing a file name to an ASCII data table, a 2-D
294294
{table-classes}.

pygmt/src/coast.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def coast(self, **kwargs):
8181
and (**c**\ )rude.
8282
land : str
8383
Select filling or clipping of "dry" areas.
84-
rivers : int or str or list
84+
rivers : int, str, or list
8585
*river*\ [/*pen*].
8686
Draw rivers. Specify the type of rivers and [optionally] append
8787
pen attributes [Default is ``"0.25p,black,solid"``].
@@ -128,7 +128,7 @@ def coast(self, **kwargs):
128128
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
129129
**+w**\ *length*.
130130
Draw a simple map scale centered on the reference point specified.
131-
borders : int or str or list
131+
borders : int, str, or list
132132
*border*\ [/*pen*].
133133
Draw political boundaries. Specify the type of boundary and
134134
[optionally] append pen attributes
@@ -146,7 +146,7 @@ def coast(self, **kwargs):
146146
a = All boundaries (1-3)
147147
water : str
148148
Select filling or clipping of "wet" areas.
149-
shorelines : int or str or list
149+
shorelines : int, str, or list
150150
[*level*\ /]\ *pen*.
151151
Draw shorelines [Default is no shorelines]. Append pen attributes
152152
[Default is ``"0.25p,black,solid"``] which

pygmt/src/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def colorbar(self, **kwargs):
9696
scale : float
9797
Multiply all z-values in the CPT by the provided scale. By default,
9898
the CPT is used as is.
99-
shading : str or list or bool
99+
shading : str, list, or bool
100100
Add illumination effects. Passing a single numerical value sets the
101101
range of intensities from -value to +value. If not specified, 1 is
102102
used. Alternatively, set ``shading=[low, high]`` to specify an
103103
asymmetric intensity range from *low* to *high*. [Default is no
104104
illumination].
105-
equalsize : int or float or str
105+
equalsize : float or str
106106
[**i**]\ [*gap*].
107107
Equal-sized color rectangles. By default, the rectangles are scaled
108108
according to the z-range in the CPT (see also ``zfile``). If *gap* is

pygmt/src/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def contour(self, data=None, x=None, y=None, z=None, **kwargs):
4646
4747
Parameters
4848
----------
49-
data : str or {table-like}
49+
data : str, {table-like}
5050
Pass in (x, y, z) or (longitude, latitude, elevation) values by
5151
providing a file name to an ASCII data table, a 2-D
5252
{table-classes}.

pygmt/src/grd2cpt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def grd2cpt(grid, **kwargs):
110110
*start*, where we automatically build monotonically increasing
111111
labels from *start* (a single letter or an integer). Additionally
112112
append **-** to build ranges *start*-*start+1* as labels instead.
113-
nlevels : bool or int or str
113+
nlevels : bool, int, or str
114114
Set to ``True`` to create a linear color table by using the grid
115115
z-range as the new limits in the CPT. Alternatively, set *nlevels*
116116
to resample the color table into *nlevels* equidistant slices.

pygmt/src/grdclip.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ def grdclip(grid, **kwargs):
5656
The name of the output netCDF file with extension .nc to store the grid
5757
in.
5858
{region}
59-
above : str or list or tuple
59+
above : str or list
6060
[*high*, *above*].
6161
Set all data[i] > *high* to *above*.
62-
below : str or list or tuple
62+
below : str or list
6363
[*low*, *below*].
6464
Set all data[i] < *low* to *below*.
65-
between : str or list or tuple
65+
between : str or list
6666
[*low*, *high*, *between*].
6767
Set all data[i] >= *low* and <= *high* to *between*.
68-
new : str or list or tuple
68+
new : str or list
6969
[*old*, *new*].
7070
Set all data[i] == *old* to *new*. This is mostly useful when
7171
your data are known to be integer values.

pygmt/src/grdcontour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def grdcontour(self, grid, **kwargs):
5353
angle (col 3).
5454
- A fixed contour interval *cont_int* or a single contour with
5555
+\ *cont_int*.
56-
annotation : str, int, or list
56+
annotation : str, int, or list
5757
Specify or disable annotated contour levels, modifies annotated
5858
contours specified in ``interval``.
5959

pygmt/src/grdcut.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def grdcut(grid, **kwargs):
5353
in.
5454
{projection}
5555
{region}
56-
extend : bool or int or float
56+
extend : bool or float
5757
Allow grid to be extended if new ``region`` exceeds existing
5858
boundaries. Give a value to initialize nodes outside current region.
5959
circ_subregion : str

pygmt/src/grdfill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def grdfill(grid, **kwargs):
5353
where (*X,Y*) are the node dimensions of the grid]), or
5454
**s** for bicubic spline (optionally append a *tension*
5555
parameter [Default is no tension]).
56-
no_data : int or float
56+
no_data : float
5757
Set the node value used to identify a point as a member of a hole
5858
[Default is NaN].
5959

pygmt/src/grdgradient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def grdgradient(grid, **kwargs):
5050
outgrid : str or None
5151
The name of the output netCDF file with extension .nc to store the grid
5252
in.
53-
azimuth : int or float or str or list
53+
azimuth : float, str, or list
5454
*azim*\ [/*azim2*].
5555
Azimuthal direction for a directional derivative; *azim* is the
5656
angle in the x,y plane measured in degrees positive clockwise from

pygmt/src/grdhisteq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _grdhisteq(grid, output_type, **kwargs):
8080
outgrid : str or bool or None
8181
The name of the output netCDF file with extension .nc to store the
8282
grid in.
83-
outfile : str or bool or None
83+
outfile : str, bool, or None
8484
The name of the output ASCII file to store the results of the
8585
histogram equalization in.
8686
output_type: str

pygmt/src/grdlandmask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def grdlandmask(**kwargs):
6262
the coastlines differ in details a node in a mask file using one
6363
resolution is not guaranteed to remain inside [or outside] when a
6464
different resolution is selected.
65-
bordervalues : bool or str or float or list
65+
bordervalues : bool, str, float, or list
6666
Nodes that fall exactly on a polygon boundary should be
6767
considered to be outside the polygon [Default considers them to be
6868
inside]. Alternatively, append either a list of four values

pygmt/src/grdtrack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
7171
Gridded array from which to sample values from, or a file name (netCDF
7272
format).
7373
74-
points : str or {table-like}
74+
points : str, {table-like}
7575
Pass in either a file name to an ASCII data table, a 2-D
7676
{table-classes}.
7777
@@ -228,7 +228,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
228228
by deviations (**+d**) and finally residuals (**+r**). When more
229229
than one grid is sampled this sequence of 1-3 columns is repeated
230230
for each grid.
231-
radius : bool or int or float or str
231+
radius : bool, float, or str
232232
[*radius*][**+e**\|\ **p**].
233233
To be used with normal grid sampling, and limited to a single, non-IMG
234234
grid. If the nearest node to the input point is NaN, search outwards

pygmt/src/grdvolume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs):
5050
- ``file`` - ASCII file (requires ``outfile``)
5151
outfile : str
5252
The file name for the output ASCII file.
53-
contour : str or int or float or list
53+
contour : str, float, or list
5454
*cval*\|\ *low/high/delta*\|\ **r**\ *low/high*\|\ **r**\ *cval*.
5555
Find area, volume and mean height (volume/area) inside and above the
5656
*cval* contour. Alternatively, search using all contours from *low* to

pygmt/src/histogram.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def histogram(self, data, **kwargs):
4848
4949
Parameters
5050
----------
51-
data : str or list or {table-like}
51+
data : str, list, {table-like}
5252
Pass in either a file name to an ASCII data table, a Python list, a 2-D
5353
{table-classes}.
5454
{projection}
@@ -67,7 +67,7 @@ def histogram(self, data, **kwargs):
6767
annotation font; use **+o** to change the offset between bar and
6868
label [Default is ``"6p"``]; use **+r** to rotate the labels from
6969
horizontal to vertical.
70-
barwidth : int or float or str
70+
barwidth : float or str
7171
*width*\ [**+o**\ *offset*].
7272
Use an alternative histogram bar width than the default set via
7373
``series``, and optionally shift all bars by an *offset*. Here
@@ -78,7 +78,7 @@ def histogram(self, data, **kwargs):
7878
plot dimension units by appending the relevant unit.
7979
center : bool
8080
Center bin on each value. [Default is left edge].
81-
distribution : bool or int or float or str
81+
distribution : bool, float, or str
8282
[*mode*][**+p**\ *pen*].
8383
Draw the equivalent normal distribution; append desired
8484
*pen* [Default is ``"0.25p,black,solid"``].
@@ -105,7 +105,7 @@ def histogram(self, data, **kwargs):
105105
horizontal : bool
106106
Plot the histogram using horizontal bars instead of the
107107
default vertical bars.
108-
series : int or str or list
108+
series : int, str, or list
109109
[*min*\ /*max*\ /]\ *inc*\ [**+n**\ ].
110110
Set the interval for the width of each bar in the histogram.
111111
histtype : int or str

pygmt/src/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def info(data, **kwargs):
4747
4848
Parameters
4949
----------
50-
data : str or {table-like}
50+
data : str, {table-like}
5151
Pass in either a file name to an ASCII data table, a 1-D/2-D
5252
{table-classes}.
5353
per_column : bool

pygmt/src/inset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def inset(self, **kwargs):
9393
indicates the shift relative to the foreground frame [Default is
9494
``"4p/-4p"``] and ``shade`` sets the fill style to use for
9595
shading [Default is ``"gray50"``].
96-
margin : int or str or list
96+
margin : float, str, or list
9797
This is clearance that is added around the inside of the inset.
9898
Plotting will take place within the inner region only. The margins
9999
can be a single value, a pair of values separated (for setting

pygmt/src/meca.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def meca(
273273
``convention`` parameter is required so we know how to interpret the
274274
columns. If ``spec`` is a dictionary or a pd.DataFrame,
275275
``convention`` is not needed and is ignored if specified.
276-
scale : int, float, or str
276+
scale : float or str
277277
*scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\
278278
[**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*].
279279
Adjust scaling of the radius of the beachball, which is
@@ -307,27 +307,27 @@ def meca(
307307
- ``"dc"``: the closest double couple defined from the moment tensor
308308
(zero trace and zero determinant)
309309
- ``"deviatoric"``: deviatoric part of the moment tensor (zero trace)
310-
longitude : int, float, list, or 1-D numpy array
310+
longitude : float, list, or 1-D numpy array
311311
Longitude(s) of event location(s). Must be the same length as the
312312
number of events. Will override the ``longitude`` values
313313
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
314-
latitude : int, float, list, or 1-D numpy array
314+
latitude : float, list, or 1-D numpy array
315315
Latitude(s) of event location(s). Must be the same length as the
316316
number of events. Will override the ``latitude`` values
317317
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
318-
depth : int, float, list, or 1-D numpy array
318+
depth : float, list, or 1-D numpy array
319319
Depth(s) of event location(s) in kilometers. Must be the same length
320320
as the number of events. Will override the ``depth`` values in ``spec``
321321
if ``spec`` is a dictionary or pd.DataFrame.
322-
plot_longitude : int, float, str, list, or 1-D numpy array
322+
plot_longitude : float, str, list, or 1-D numpy array
323323
Longitude(s) at which to place beachball(s). Must be the same length
324324
as the number of events. Will override the ``plot_longitude`` values
325325
in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
326-
plot_latitude : int, float, str, list, or 1-D numpy array
326+
plot_latitude : float, str, list, or 1-D numpy array
327327
Latitude(s) at which to place beachball(s). List must be the same
328328
length as the number of events. Will override the ``plot_latitude``
329329
values in ``spec`` if ``spec`` is a dictionary or pd.DataFrame.
330-
event_name : str or list of str, or 1-D numpy array
330+
event_name : str, list of str, or 1-D numpy array
331331
Text string(s), e.g., event name(s) to appear near the beachball(s).
332332
List must be the same length as the number of events. Will override
333333
the ``event_name`` labels in ``spec`` if ``spec`` is a dictionary

pygmt/src/nearneighbor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def nearneighbor(data=None, x=None, y=None, z=None, **kwargs):
7777
7878
Parameters
7979
----------
80-
data : str or {table-like}
80+
data : str, {table-like}
8181
Pass in (x, y, z) or (longitude, latitude, elevation) values by
8282
providing a file name to an ASCII data table, a 2-D
8383
{table-classes}.

0 commit comments

Comments
 (0)