Skip to content
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
2 changes: 2 additions & 0 deletions pygmt/alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def add_common(self, **kwargs):
"""
for key, value in kwargs.items():
match key:
case "B":
alias = Alias(value, name="frame")
case "J":
alias = Alias(value, name="projection")
case "R":
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/basemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@use_alias(
Jz="zscale",
JZ="zsize",
B="frame",
L="map_scale",
F="box",
Td="rose",
Expand All @@ -26,6 +25,7 @@
def basemap(
self,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand All @@ -47,6 +47,7 @@ def basemap(
Full GMT docs at :gmt-docs:`basemap.html`.

{aliases}
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -98,6 +99,7 @@ def basemap(
self._activate_figure()

aliasdict = AliasSystem().add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
6 changes: 4 additions & 2 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@fmt_docstring
@use_alias(
A="area_thresh",
B="frame",
C="lakes",
E="dcw",
G="land",
Expand All @@ -37,11 +36,12 @@
@kwargs_to_strings(p="sequence")
def coast(
self,
projection: str | None = None,
resolution: Literal[
"auto", "full", "high", "intermediate", "low", "crude", None
] = None,
box: Box | bool = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -69,6 +69,7 @@ def coast(
Full GMT docs at :gmt-docs:`coast.html`.

{aliases}
- B = frame
- D = resolution
- F = box
- J = projection
Expand Down Expand Up @@ -223,6 +224,7 @@ def coast(
),
F=Alias(box, name="box"),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

@fmt_docstring
@use_alias(
B="frame",
C="cmap",
D="position",
G="truncate",
Expand All @@ -31,6 +30,7 @@ def colorbar(
shading: float | Sequence[float] | bool = False,
projection: str | None = None,
box: Box | bool = False,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -63,6 +63,7 @@ def colorbar(
Full GMT docs at :gmt-docs:`colorbar.html`.

{aliases}
- B = frame
- F = box
- I = shading
- J = projection
Expand Down Expand Up @@ -167,6 +168,7 @@ def colorbar(
F=Alias(box, name="box"),
I=Alias(shading, name="shading", sep="/", size=2),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
@fmt_docstring
@use_alias(
A="annotation",
B="frame",
C="levels",
G="label_placement",
L="triangular_mesh_pen",
Expand All @@ -44,6 +43,7 @@ def contour( # noqa: PLR0913
z=None,
no_clip: bool = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand All @@ -62,6 +62,7 @@ def contour( # noqa: PLR0913
Full GMT docs at :gmt-docs:`contour.html`.

{aliases}
- B = frame
- J = projection
- N = no_clip
- R = region
Expand Down Expand Up @@ -165,6 +166,7 @@ def contour( # noqa: PLR0913
aliasdict = AliasSystem(
N=Alias(no_clip, name="no_clip"),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/grdcontour.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
@deprecate_parameter("interval", "levels", "v0.12.0", remove_version="v0.16.0")
@use_alias(
A="annotation",
B="frame",
C="levels",
G="label_placement",
L="limit",
Expand All @@ -41,6 +40,7 @@ def grdcontour(
self,
grid: PathLike | xr.DataArray,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand All @@ -56,6 +56,7 @@ def grdcontour(
Full GMT docs at :gmt-docs:`grdcontour.html`.

{aliases}
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -166,6 +167,7 @@ def grdcontour(
kwargs[arg] = ",".join(f"{item}" for item in kwargs[arg])

aliasdict = AliasSystem().add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
6 changes: 4 additions & 2 deletions pygmt/src/grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

@fmt_docstring
@use_alias(
B="frame",
C="cmap",
D="img_in",
E="dpi",
Expand All @@ -28,12 +27,13 @@
p="perspective",
)
@kwargs_to_strings(p="sequence")
def grdimage(
def grdimage( # noqa: PLR0913
self,
grid: PathLike | xr.DataArray,
monochrome: bool = False,
no_clip: bool = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -76,6 +76,7 @@ def grdimage(
Full GMT docs at :gmt-docs:`grdimage.html`.

{aliases}
- B = frame
- J = projection
- M = monochrome
- N = no_clip
Expand Down Expand Up @@ -181,6 +182,7 @@ def grdimage(
M=Alias(monochrome, name="monochrome"),
N=Alias(no_clip, name="no_clip"),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/grdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@use_alias(
Jz="zscale",
JZ="zsize",
B="frame",
C="cmap",
G="drapegrid",
N="plane",
Expand All @@ -36,6 +35,7 @@ def grdview(
self,
grid: PathLike | xr.DataArray,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand All @@ -55,6 +55,7 @@ def grdview(
Full GMT docs at :gmt-docs:`grdview.html`.

{aliases}
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -157,6 +158,7 @@ def grdview(
self._activate_figure()

aliasdict = AliasSystem().add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@fmt_docstring
@use_alias(
A="horizontal",
B="frame",
C="cmap",
D="annotate",
E="barwidth",
Expand All @@ -41,6 +40,7 @@ def histogram(
self,
data: PathLike | TableLike,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand All @@ -54,6 +54,7 @@ def histogram(
Full GMT docs at :gmt-docs:`histogram.html`.

{aliases}
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -150,6 +151,7 @@ def histogram(
self._activate_figure()

aliasdict = AliasSystem().add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/meca.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def _auto_offset(spec) -> bool:
@fmt_docstring
@use_alias(
A="offset",
B="frame",
C="cmap",
E="extensionfill",
Fr="labelbox",
Expand All @@ -143,6 +142,7 @@ def meca( # noqa: PLR0913
event_name: str | Sequence[str] | None = None,
no_clip: bool = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -202,6 +202,7 @@ def meca( # noqa: PLR0913
Full GMT docs at :gmt-docs:`supplements/seis/meca.html`.

{aliases}
- B = frame
- J = projection
- N = no_clip
- R = region
Expand Down Expand Up @@ -374,6 +375,7 @@ def meca( # noqa: PLR0913
aliasdict = AliasSystem(
N=Alias(no_clip, name="no_clip"),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

@fmt_docstring
@use_alias(
B="frame",
C="cmap",
D="offset",
E="error_bar",
Expand Down Expand Up @@ -57,6 +56,7 @@ def plot( # noqa: PLR0912, PLR0913
direction=None,
straight_line: bool | Literal["x", "y"] = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -89,6 +89,7 @@ def plot( # noqa: PLR0912, PLR0913

{aliases}
- A = straight_line
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -294,6 +295,7 @@ def plot( # noqa: PLR0912, PLR0913
aliasdict = AliasSystem(
A=Alias(straight_line, name="straight_line"),
).add_common(
B=frame,
R=region,
J=projection,
V=verbose,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

@fmt_docstring
@use_alias(
B="frame",
C="cmap",
D="offset",
G="fill",
Expand Down Expand Up @@ -59,6 +58,7 @@ def plot3d( # noqa: PLR0912, PLR0913
direction=None,
straight_line: bool | Literal["x", "y"] = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
Expand Down Expand Up @@ -91,6 +91,7 @@ def plot3d( # noqa: PLR0912, PLR0913

{aliases}
- A = straight_line
- B = frame
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -273,6 +274,7 @@ def plot3d( # noqa: PLR0912, PLR0913
aliasdict = AliasSystem(
A=Alias(straight_line, name="straight_line"),
).add_common(
B=frame,
J=projection,
R=region,
V=verbose,
Expand Down
Loading