Skip to content

Commit bbab46e

Browse files
authored
Add common alias "verbose" (V) to all functions (#662)
1 parent 3b64511 commit bbab46e

File tree

7 files changed

+53
-6
lines changed

7 files changed

+53
-6
lines changed

pygmt/base_plotting.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
6969
G="land",
7070
S="water",
7171
U="timestamp",
72+
V="verbose",
7273
X="xshift",
7374
Y="yshift",
7475
p="perspective",
@@ -130,6 +131,7 @@ def coast(self, **kwargs):
130131
water : str
131132
Select filling or clipping of “wet” areas.
132133
{U}
134+
{V}
133135
shorelines : str
134136
``'[level/]pen'``
135137
Draw shorelines [Default is no shorelines]. Append pen attributes.
@@ -152,6 +154,7 @@ def coast(self, **kwargs):
152154
F="box",
153155
G="truncate",
154156
W="scale",
157+
V="verbose",
155158
X="xshift",
156159
Y="yshift",
157160
p="perspective",
@@ -217,6 +220,7 @@ def colorbar(self, **kwargs):
217220
scale : float
218221
Multiply all z-values in the CPT by the provided scale. By default
219222
the CPT is used as is.
223+
{V}
220224
{XY}
221225
{p}
222226
{t}
@@ -238,6 +242,7 @@ def colorbar(self, **kwargs):
238242
R="region",
239243
S="resample",
240244
U="timestamp",
245+
V="verbose",
241246
W="pen",
242247
l="label",
243248
X="xshift",
@@ -292,6 +297,7 @@ def grdcontour(self, grid, **kwargs):
292297
{B}
293298
{G}
294299
{U}
300+
{V}
295301
{W}
296302
{XY}
297303
label : str
@@ -489,6 +495,7 @@ def grdimage(self, grid, **kwargs):
489495
Wm="meshpen",
490496
Wf="facadepen",
491497
I="shading",
498+
V="verbose",
492499
X="xshift",
493500
Y="yshift",
494501
p="perspective",
@@ -565,6 +572,7 @@ def grdview(self, grid, **kwargs):
565572
intensity, and ambient arguments for that module, or just give
566573
``+d`` to select the default arguments (``+a-45+nt1+m0``).
567574
575+
{V}
568576
{XY}
569577
{p}
570578
{t}
@@ -608,6 +616,7 @@ def grdview(self, grid, **kwargs):
608616
l="label",
609617
C="cmap",
610618
U="timestamp",
619+
V="verbose",
611620
X="xshift",
612621
Y="yshift",
613622
p="perspective",
@@ -679,6 +688,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
679688
quoted lines).
680689
{W}
681690
{U}
691+
{V}
682692
{XY}
683693
label : str
684694
Add a legend entry for the symbol or line being plotted.
@@ -741,6 +751,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
741751
i="columns",
742752
l="label",
743753
C="levels",
754+
V="verbose",
744755
X="xshift",
745756
Y="yshift",
746757
p="perspective",
@@ -802,6 +813,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
802813
to be of the format [*annotcontlabel*][/*contlabel*]. If either
803814
label contains a slash (/) character then use ``|`` as the
804815
separator for the two labels instead.
816+
{V}
805817
{XY}
806818
{p}
807819
{t}
@@ -835,6 +847,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
835847
Td="rose",
836848
Tm="compass",
837849
U="timestamp",
850+
V="verbose",
838851
X="xshift",
839852
Y="yshift",
840853
p="perspective",
@@ -872,6 +885,7 @@ def basemap(self, **kwargs):
872885
Draws a map magnetic rose on the map at the location defined by the
873886
reference and anchor points
874887
{U}
888+
{V}
875889
{XY}
876890
{p}
877891
{t}
@@ -945,6 +959,7 @@ def logo(self, **kwargs):
945959
D="position",
946960
F="box",
947961
M="monochrome",
962+
V="verbose",
948963
X="xshift",
949964
Y="yshift",
950965
p="perspective",
@@ -983,6 +998,7 @@ def image(self, imagefile, **kwargs):
983998
monochrome : bool
984999
Convert color image to monochrome grayshades using the (television)
9851000
YIQ-transformation.
1001+
{V}
9861002
{XY}
9871003
{p}
9881004
{t}
@@ -998,6 +1014,7 @@ def image(self, imagefile, **kwargs):
9981014
J="projection",
9991015
D="position",
10001016
F="box",
1017+
V="verbose",
10011018
X="xshift",
10021019
Y="yshift",
10031020
p="perspective",
@@ -1037,6 +1054,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
10371054
rectangular border around the legend using **MAP_FRAME_PEN**. By
10381055
default, uses '+gwhite+p1p' which draws a box around the legend
10391056
using a 1 point black pen and adds a white background.
1057+
{V}
10401058
{XY}
10411059
{p}
10421060
{t}
@@ -1067,6 +1085,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
10671085
C="clearance",
10681086
D="offset",
10691087
G="fill",
1088+
V="verbose",
10701089
W="pen",
10711090
X="xshift",
10721091
Y="yshift",
@@ -1178,6 +1197,7 @@ def text(
11781197
Sets the pen used to draw a rectangle around the text string
11791198
(see *clearance*) [Default is width = default, color = black,
11801199
style = solid].
1200+
{V}
11811201
{XY}
11821202
{p}
11831203
{t}
@@ -1235,6 +1255,7 @@ def text(
12351255
J="projection",
12361256
B="frame",
12371257
C="offset",
1258+
V="verbose",
12381259
X="xshift",
12391260
Y="yshift",
12401261
p="perspective",
@@ -1335,6 +1356,7 @@ def meca(
13351356
{J}
13361357
{R}
13371358
{B}
1359+
{V}
13381360
{XY}
13391361
{p}
13401362
{t}

pygmt/filtering.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@fmt_docstring
20-
@use_alias(I="spacing", R="region")
20+
@use_alias(I="spacing", R="region", V="verbose")
2121
@kwargs_to_strings(R="sequence")
2222
def blockmedian(table, outfile=None, **kwargs):
2323
"""
@@ -50,6 +50,8 @@ def blockmedian(table, outfile=None, **kwargs):
5050
outfile : str
5151
Required if 'table' is a file. The file name for the output ASCII file.
5252
53+
{V}
54+
5355
Returns
5456
-------
5557
output : pandas.DataFrame or None

pygmt/gridding.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@fmt_docstring
20-
@use_alias(I="spacing", R="region", G="outfile")
20+
@use_alias(I="spacing", R="region", G="outfile", V="verbose")
2121
@kwargs_to_strings(R="sequence")
2222
def surface(x=None, y=None, z=None, data=None, **kwargs):
2323
"""
@@ -58,6 +58,8 @@ def surface(x=None, y=None, z=None, data=None, **kwargs):
5858
Optional. The file name for the output netcdf file with extension .nc
5959
to store the grid in.
6060
61+
{V}
62+
6163
Returns
6264
-------
6365
ret: xarray.DataArray or None

pygmt/gridops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
J="projection",
2626
N="extend",
2727
S="circ_subregion",
28+
V="verbose",
2829
Z="z_subregion",
2930
)
3031
@kwargs_to_strings(R="sequence")
@@ -79,6 +80,8 @@ def grdcut(grid, **kwargs):
7980
considering the range of the core subset for further reduction of the
8081
area.
8182
83+
{V}
84+
8285
Returns
8386
-------
8487
ret: xarray.DataArray or None

pygmt/mathops.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77

88

99
@fmt_docstring
10-
@use_alias(C="cmap", T="series", G="truncate", H="output", I="reverse", Z="continuous")
10+
@use_alias(
11+
C="cmap",
12+
T="series",
13+
G="truncate",
14+
H="output",
15+
I="reverse",
16+
V="verbose",
17+
Z="continuous",
18+
)
1119
@kwargs_to_strings(T="sequence", G="sequence")
1220
def makecpt(**kwargs):
1321
"""
@@ -52,6 +60,8 @@ def makecpt(**kwargs):
5260
input CPT remains untouched, in the second case it is only scaled to
5361
match the range z_min/z_max.
5462
63+
{V}
64+
5565
"""
5666
with Session() as lib:
5767
if "H" not in kwargs.keys(): # if no output is set

pygmt/modules.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
@fmt_docstring
20+
@use_alias(V="verbose")
2021
def grdinfo(grid, **kwargs):
2122
"""
2223
Get information about a grid.
@@ -30,6 +31,8 @@ def grdinfo(grid, **kwargs):
3031
grid : str or xarray.DataArray
3132
The file name of the input grid or the grid loaded as a DataArray.
3233
34+
{V}
35+
3336
Returns
3437
-------
3538
info : str
@@ -55,7 +58,7 @@ def grdinfo(grid, **kwargs):
5558

5659

5760
@fmt_docstring
58-
@use_alias(C="per_column", I="spacing", T="nearest_multiple")
61+
@use_alias(C="per_column", I="spacing", T="nearest_multiple", V="verbose")
5962
def info(table, **kwargs):
6063
"""
6164
Get information about data tables.
@@ -94,6 +97,8 @@ def info(table, **kwargs):
9497
Report the min/max of the first (0'th) column to the nearest multiple
9598
of dz and output this in the form ``[zmin, zmax, dz]``.
9699
100+
{V}
101+
97102
Returns
98103
-------
99104
output : np.ndarray or str
@@ -137,7 +142,7 @@ def info(table, **kwargs):
137142

138143

139144
@fmt_docstring
140-
@use_alias(G="download")
145+
@use_alias(G="download", V="verbose")
141146
def which(fname, **kwargs):
142147
"""
143148
Find the full path to specified files.
@@ -165,6 +170,7 @@ def which(fname, **kwargs):
165170
it. Use True or 'l' (default) to download to the current directory. Use
166171
'c' to place in the user cache directory or 'u' user data directory
167172
instead.
173+
{V}
168174
169175
Returns
170176
-------

pygmt/sampling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
@fmt_docstring
19-
@use_alias(n="interpolation")
19+
@use_alias(n="interpolation", V="verbose")
2020
def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
2121
"""
2222
Sample grids at specified (x,y) locations.
@@ -55,6 +55,8 @@ def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
5555
Required if 'points' is a file. The file name for the output ASCII
5656
file.
5757
58+
{V}
59+
5860
{n}
5961
6062
Returns

0 commit comments

Comments
 (0)