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
5 changes: 4 additions & 1 deletion pygmt/src/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,10 @@ def _alias_option_N(dpi=None): # noqa: N802


@fmt_docstring
@use_alias(C="cmap", L="equalsize", Z="zfile")
@use_alias(L="equalsize", Z="zfile")
def colorbar(
self,
cmap: str | bool = False,
position: Position | Sequence[float | str] | AnchorCode | None = None,
length: float | str | None = None,
width: float | str | None = None,
Expand Down Expand Up @@ -306,6 +307,7 @@ def colorbar(
Full GMT docs at :gmt-docs:`colorbar.html`.

$aliases
- C = cmap
- F = box
- G = truncate
- I = shading
Expand Down Expand Up @@ -499,6 +501,7 @@ def colorbar(
)

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
D=_alias_option_D(
position=position,
length=length,
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/grd2cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@fmt_docstring
@use_alias(
A="transparency",
C="cmap",
D="background",
F="color_model",
E="nlevels",
Expand All @@ -32,6 +31,7 @@
@kwargs_to_strings(L="sequence", T="sequence")
def grd2cpt(
grid: PathLike | xr.DataArray,
cmap: str | bool = False,
truncate: Sequence[float] | None = None,
overrule_bg: bool = False,
no_bg: bool = False,
Expand Down Expand Up @@ -86,6 +86,7 @@ def grd2cpt(
Full GMT docs at :gmt-docs:`grd2cpt.html`.

$aliases
- C = cmap
- G = truncate
- M = overrule_bg
- N = no_bg
Expand Down Expand Up @@ -206,6 +207,7 @@ def grd2cpt(
kwargs["H"] = True

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
G=Alias(truncate, name="truncate", sep="/", size=2),
M=Alias(overrule_bg, name="overrule_bg"),
N=Alias(no_bg, name="no_bg"),
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

@fmt_docstring
@use_alias(
C="cmap",
D="img_in",
E="dpi",
G="bitcolor",
Expand All @@ -29,6 +28,7 @@
def grdimage(
self,
grid: PathLike | xr.DataArray,
cmap: str | bool = False,
monochrome: bool = False,
no_clip: bool = False,
projection: str | None = None,
Expand Down Expand Up @@ -77,6 +77,7 @@ def grdimage(

$aliases
- B = frame
- C = cmap
- J = projection
- M = monochrome
- N = no_clip
Expand Down Expand Up @@ -184,6 +185,7 @@ def grdimage(
raise NotImplementedError(msg)

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
M=Alias(monochrome, name="monochrome"),
N=Alias(no_clip, name="no_clip"),
).add_common(
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
@deprecate_parameter("barwidth", "bar_width", "v0.18.0", remove_version="v0.20.0")
@use_alias(
A="horizontal",
C="cmap",
D="annotate",
F="center",
G="fill",
Expand All @@ -48,6 +47,7 @@ def histogram(
data: PathLike | TableLike,
bar_width: float | str | None = None,
bar_offset: float | str | None = None,
cmap: str | bool = False,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False,
Expand All @@ -66,6 +66,7 @@ def histogram(

$aliases
- B = frame
- C = cmap
- E = bar_width, bar_offset
- J = projection
- R = region
Expand Down Expand Up @@ -167,6 +168,7 @@ def histogram(
)

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
E=[
Alias(bar_width, name="bar_width"),
Alias(bar_offset, name="bar_offset", prefix="+o"),
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/makecpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@fmt_docstring
@use_alias(
A="transparency",
C="cmap",
D="background",
F="color_model",
H="output",
Expand All @@ -25,6 +24,7 @@
)
@kwargs_to_strings(T="sequence")
def makecpt(
cmap: str | bool = False,
truncate: Sequence[float] | None = None,
overrule_bg: bool = False,
no_bg: bool = False,
Expand Down Expand Up @@ -74,6 +74,7 @@ def makecpt(
Full GMT docs at :gmt-docs:`makecpt.html`.

$aliases
- C = cmap
- G = truncate
- M = overrule_bg
- N = no_bg
Expand Down Expand Up @@ -175,6 +176,7 @@ def makecpt(
kwargs["H"] = True

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
G=Alias(truncate, name="truncate", sep="/", size=2),
M=Alias(overrule_bg, name="overrule_bg"),
N=Alias(no_bg, name="no_bg"),
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(
C="cmap",
D="offset",
E="error_bar",
F="connection",
Expand Down Expand Up @@ -51,6 +50,7 @@ def plot( # noqa: PLR0912
size=None,
symbol=None,
direction=None,
cmap: str | bool = False,
straight_line: bool | Literal["x", "y"] = False,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
Expand Down Expand Up @@ -89,6 +89,7 @@ def plot( # noqa: PLR0912
$aliases
- A = straight_line
- B = frame
- C = cmap
- J = projection
- R = region
- V = verbose
Expand Down Expand Up @@ -303,6 +304,7 @@ def plot( # noqa: PLR0912

aliasdict = AliasSystem(
A=Alias(straight_line, name="straight_line"),
C=Alias(cmap, name="cmap"),
).add_common(
B=frame,
R=region,
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(
C="cmap",
D="offset",
G="fill",
I="intensity",
Expand Down Expand Up @@ -51,6 +50,7 @@ def plot3d( # noqa: PLR0912
size=None,
symbol=None,
direction=None,
cmap: str | bool = False,
straight_line: bool | Literal["x", "y"] = False,
projection: str | None = None,
zscale: float | str | None = None,
Expand Down Expand Up @@ -91,6 +91,7 @@ def plot3d( # noqa: PLR0912
$aliases
- A = straight_line
- B = frame
- C = cmap
- J = projection
- Jz = zscale
- JZ = zsize
Expand Down Expand Up @@ -274,6 +275,7 @@ def plot3d( # noqa: PLR0912

aliasdict = AliasSystem(
A=Alias(straight_line, name="straight_line"),
C=Alias(cmap, name="cmap"),
Jz=Alias(zscale, name="zscale"),
JZ=Alias(zsize, name="zsize"),
).add_common(
Expand Down
7 changes: 4 additions & 3 deletions pygmt/src/rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Literal

from pygmt._typing import PathLike, TableLike
from pygmt.alias import AliasSystem
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
from pygmt.params import Axis, Frame
Expand All @@ -15,7 +15,6 @@
@fmt_docstring
@use_alias(
A="sector",
C="cmap",
D="shift",
Em="vectors",
F="no_scale",
Expand All @@ -40,6 +39,7 @@ def rose(
data: PathLike | TableLike | None = None,
length=None,
azimuth=None,
cmap: str | bool = False,
region: Sequence[float | str] | str | None = None,
frame: Frame | Axis | Literal["none"] | str | Sequence[str] | bool = False,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
Expand Down Expand Up @@ -67,6 +67,7 @@ def rose(

$aliases
- B = frame
- C = cmap
- R = region
- V = verbose
- c = panel
Expand Down Expand Up @@ -209,7 +210,7 @@ def rose(
$transparency
$wrap
"""
aliasdict = AliasSystem().add_common(
aliasdict = AliasSystem(C=Alias(cmap, name="cmap")).add_common(
B=frame,
R=region,
V=verbose,
Expand Down
5 changes: 4 additions & 1 deletion pygmt/src/ternary.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ def _ternary_frame(frame):


@fmt_docstring
@use_alias(C="cmap", S="style")
@use_alias(S="style")
def ternary(
self,
data: PathLike | TableLike,
cmap: str | bool = False,
fill: str | None = None,
width: float | str | None = None,
pen: str | None = None,
Expand Down Expand Up @@ -143,6 +144,7 @@ def ternary(

$aliases
- B = frame
- C = cmap
- G = fill
- JX = width
- L = alabel/blabel/clabel
Expand Down Expand Up @@ -199,6 +201,7 @@ def ternary(
labels = _labels if any(v != "-" for v in _labels) else None

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
G=Alias(fill, name="fill"),
JX=Alias(width, name="width"),
L=Alias(labels, name="alabel/blabel/clabel", sep="/", size=3),
Expand Down
4 changes: 3 additions & 1 deletion pygmt/src/velo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)
@use_alias(
A="vector",
C="cmap",
D="rescale",
E="uncertainty_fill",
G="fill",
Expand All @@ -39,6 +38,7 @@
def velo(
self,
data: PathLike | TableLike | None = None,
cmap: str | bool = False,
no_clip: bool = False,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
Expand Down Expand Up @@ -67,6 +67,7 @@ def velo(

$aliases
- B = frame
- C = cmap
- J = projection
- N = no_clip
- R = region
Expand Down Expand Up @@ -273,6 +274,7 @@ def velo(
)

aliasdict = AliasSystem(
C=Alias(cmap, name="cmap"),
N=Alias(no_clip, name="no_clip"),
).add_common(
B=frame,
Expand Down