Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common alias "verbose" (V) to all functions #662

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pygmt/base_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
G="land",
S="water",
U="timestamp",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -130,6 +131,7 @@ def coast(self, **kwargs):
water : str
Select filling or clipping of “wet” areas.
{U}
{V}
shorelines : str
``'[level/]pen'``
Draw shorelines [Default is no shorelines]. Append pen attributes.
Expand All @@ -152,6 +154,7 @@ def coast(self, **kwargs):
F="box",
G="truncate",
W="scale",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -217,6 +220,7 @@ 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.
{V}
{XY}
{p}
{t}
Expand All @@ -238,6 +242,7 @@ def colorbar(self, **kwargs):
R="region",
S="resample",
U="timestamp",
V="verbose",
W="pen",
l="label",
X="xshift",
Expand Down Expand Up @@ -292,6 +297,7 @@ def grdcontour(self, grid, **kwargs):
{B}
{G}
{U}
{V}
{W}
{XY}
label : str
Expand Down Expand Up @@ -489,6 +495,7 @@ def grdimage(self, grid, **kwargs):
Wm="meshpen",
Wf="facadepen",
I="shading",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -565,6 +572,7 @@ def grdview(self, grid, **kwargs):
intensity, and ambient arguments for that module, or just give
``+d`` to select the default arguments (``+a-45+nt1+m0``).

{V}
{XY}
{p}
{t}
Expand Down Expand Up @@ -608,6 +616,7 @@ def grdview(self, grid, **kwargs):
l="label",
C="cmap",
U="timestamp",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -679,6 +688,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
quoted lines).
{W}
{U}
{V}
{XY}
label : str
Add a legend entry for the symbol or line being plotted.
Expand Down Expand Up @@ -741,6 +751,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
i="columns",
l="label",
C="levels",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -802,6 +813,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
to be of the format [*annotcontlabel*][/*contlabel*]. If either
label contains a slash (/) character then use ``|`` as the
separator for the two labels instead.
{V}
{XY}
{p}
{t}
Expand Down Expand Up @@ -835,6 +847,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
Td="rose",
Tm="compass",
U="timestamp",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -872,6 +885,7 @@ def basemap(self, **kwargs):
Draws a map magnetic rose on the map at the location defined by the
reference and anchor points
{U}
{V}
{XY}
{p}
{t}
Expand Down Expand Up @@ -945,6 +959,7 @@ def logo(self, **kwargs):
D="position",
F="box",
M="monochrome",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -983,6 +998,7 @@ def image(self, imagefile, **kwargs):
monochrome : bool
Convert color image to monochrome grayshades using the (television)
YIQ-transformation.
{V}
{XY}
{p}
{t}
Expand All @@ -998,6 +1014,7 @@ def image(self, imagefile, **kwargs):
J="projection",
D="position",
F="box",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -1037,6 +1054,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
rectangular border around the legend using **MAP_FRAME_PEN**. By
default, uses '+gwhite+p1p' which draws a box around the legend
using a 1 point black pen and adds a white background.
{V}
{XY}
{p}
{t}
Expand Down Expand Up @@ -1067,6 +1085,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
C="clearance",
D="offset",
G="fill",
V="verbose",
W="pen",
X="xshift",
Y="yshift",
Expand Down Expand Up @@ -1178,6 +1197,7 @@ def text(
Sets the pen used to draw a rectangle around the text string
(see *clearance*) [Default is width = default, color = black,
style = solid].
{V}
{XY}
{p}
{t}
Expand Down Expand Up @@ -1235,6 +1255,7 @@ def text(
J="projection",
B="frame",
C="offset",
V="verbose",
X="xshift",
Y="yshift",
p="perspective",
Expand Down Expand Up @@ -1335,6 +1356,7 @@ def meca(
{J}
{R}
{B}
{V}
{XY}
{p}
{t}
Expand Down
4 changes: 3 additions & 1 deletion pygmt/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@fmt_docstring
@use_alias(I="spacing", R="region")
@use_alias(I="spacing", R="region", V="verbose")
@kwargs_to_strings(R="sequence")
def blockmedian(table, outfile=None, **kwargs):
"""
Expand Down Expand Up @@ -50,6 +50,8 @@ def blockmedian(table, outfile=None, **kwargs):
outfile : str
Required if 'table' is a file. The file name for the output ASCII file.

{V}

Returns
-------
output : pandas.DataFrame or None
Expand Down
4 changes: 3 additions & 1 deletion pygmt/gridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@fmt_docstring
@use_alias(I="spacing", R="region", G="outfile")
@use_alias(I="spacing", R="region", G="outfile", V="verbose")
@kwargs_to_strings(R="sequence")
def surface(x=None, y=None, z=None, data=None, **kwargs):
"""
Expand Down Expand Up @@ -58,6 +58,8 @@ def surface(x=None, y=None, z=None, data=None, **kwargs):
Optional. The file name for the output netcdf file with extension .nc
to store the grid in.

{V}

Returns
-------
ret: xarray.DataArray or None
Expand Down
3 changes: 3 additions & 0 deletions pygmt/gridops.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
J="projection",
N="extend",
S="circ_subregion",
V="verbose",
Z="z_subregion",
)
@kwargs_to_strings(R="sequence")
Expand Down Expand Up @@ -79,6 +80,8 @@ def grdcut(grid, **kwargs):
considering the range of the core subset for further reduction of the
area.

{V}

Returns
-------
ret: xarray.DataArray or None
Expand Down
12 changes: 11 additions & 1 deletion pygmt/mathops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@


@fmt_docstring
@use_alias(C="cmap", T="series", G="truncate", H="output", I="reverse", Z="continuous")
@use_alias(
C="cmap",
T="series",
G="truncate",
H="output",
I="reverse",
V="verbose",
Z="continuous",
)
@kwargs_to_strings(T="sequence", G="sequence")
def makecpt(**kwargs):
"""
Expand Down Expand Up @@ -52,6 +60,8 @@ def makecpt(**kwargs):
input CPT remains untouched, in the second case it is only scaled to
match the range z_min/z_max.

{V}

"""
with Session() as lib:
if "H" not in kwargs.keys(): # if no output is set
Expand Down
10 changes: 8 additions & 2 deletions pygmt/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@


@fmt_docstring
@use_alias(V="verbose")
def grdinfo(grid, **kwargs):
"""
Get information about a grid.
Expand All @@ -30,6 +31,8 @@ def grdinfo(grid, **kwargs):
grid : str or xarray.DataArray
The file name of the input grid or the grid loaded as a DataArray.

{V}

Returns
-------
info : str
Expand All @@ -55,7 +58,7 @@ def grdinfo(grid, **kwargs):


@fmt_docstring
@use_alias(C="per_column", I="spacing", T="nearest_multiple")
@use_alias(C="per_column", I="spacing", T="nearest_multiple", V="verbose")
def info(table, **kwargs):
"""
Get information about data tables.
Expand Down Expand Up @@ -94,6 +97,8 @@ def info(table, **kwargs):
Report the min/max of the first (0'th) column to the nearest multiple
of dz and output this in the form ``[zmin, zmax, dz]``.

{V}

Returns
-------
output : np.ndarray or str
Expand Down Expand Up @@ -137,7 +142,7 @@ def info(table, **kwargs):


@fmt_docstring
@use_alias(G="download")
@use_alias(G="download", V="verbose")
def which(fname, **kwargs):
"""
Find the full path to specified files.
Expand Down Expand Up @@ -165,6 +170,7 @@ def which(fname, **kwargs):
it. Use True or 'l' (default) to download to the current directory. Use
'c' to place in the user cache directory or 'u' user data directory
instead.
{V}

Returns
-------
Expand Down
4 changes: 3 additions & 1 deletion pygmt/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@fmt_docstring
@use_alias(n="interpolation")
@use_alias(n="interpolation", V="verbose")
def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
"""
Sample grids at specified (x,y) locations.
Expand Down Expand Up @@ -55,6 +55,8 @@ def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
Required if 'points' is a file. The file name for the output ASCII
file.

{V}

{n}

Returns
Expand Down