From caa23c5c96b21a992375255c41f04c90613c5052 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 10 Nov 2025 21:17:54 +0800 Subject: [PATCH 1/3] AliasSystem: Migrate the 'frame' parameter to the new alias system --- pygmt/alias.py | 2 ++ pygmt/src/basemap.py | 4 +++- pygmt/src/coast.py | 6 ++++-- pygmt/src/colorbar.py | 4 +++- pygmt/src/contour.py | 4 +++- pygmt/src/grdcontour.py | 4 +++- pygmt/src/grdimage.py | 6 ++++-- pygmt/src/grdview.py | 4 +++- pygmt/src/histogram.py | 4 +++- pygmt/src/meca.py | 4 +++- pygmt/src/plot.py | 4 +++- pygmt/src/plot3d.py | 4 +++- pygmt/src/rose.py | 4 +++- pygmt/src/solar.py | 7 +++++-- pygmt/src/subplot.py | 4 +++- pygmt/src/ternary.py | 4 +++- pygmt/src/text.py | 4 +++- pygmt/src/tilemap.py | 10 +++------- pygmt/src/velo.py | 4 +++- pygmt/src/wiggle.py | 4 +++- 20 files changed, 63 insertions(+), 28 deletions(-) diff --git a/pygmt/alias.py b/pygmt/alias.py index 22c2ac061f8..7e1344c104d 100644 --- a/pygmt/alias.py +++ b/pygmt/alias.py @@ -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": diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 6ec874fdbe4..67ae20a45f5 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -14,7 +14,6 @@ @use_alias( Jz="zscale", JZ="zsize", - B="frame", L="map_scale", F="box", Td="rose", @@ -26,6 +25,7 @@ def basemap( self, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -47,6 +47,7 @@ def basemap( Full GMT docs at :gmt-docs:`basemap.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -98,6 +99,7 @@ def basemap( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 730e3dab404..181f162790f 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -23,7 +23,6 @@ @fmt_docstring @use_alias( A="area_thresh", - B="frame", C="lakes", E="dcw", G="land", @@ -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 | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -69,6 +69,7 @@ def coast( Full GMT docs at :gmt-docs:`coast.html`. {aliases} + - B = frame - D = resolution - F = box - J = projection @@ -223,6 +224,7 @@ def coast( ), F=Alias(box, name="box"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 391233f6801..cfee8bd44ae 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -15,7 +15,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="position", G="truncate", @@ -31,6 +30,7 @@ def colorbar( self, projection: str | None = None, box: Box | bool = False, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -63,6 +63,7 @@ def colorbar( Full GMT docs at :gmt-docs:`colorbar.html`. {aliases} + - B = frame - F = box - J = projection - R = region @@ -163,6 +164,7 @@ def colorbar( aliasdict = AliasSystem( F=Alias(box, name="box"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index f85434543f6..e9922413e1c 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -20,7 +20,6 @@ @fmt_docstring @use_alias( A="annotation", - B="frame", C="levels", G="label_placement", L="triangular_mesh_pen", @@ -44,6 +43,7 @@ def contour( # noqa: PLR0913 z=None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -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 @@ -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, diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 000eefa95b6..e409a3d5c4b 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -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", @@ -41,6 +40,7 @@ def grdcontour( self, grid: PathLike | xr.DataArray, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -56,6 +56,7 @@ def grdcontour( Full GMT docs at :gmt-docs:`grdcontour.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -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, diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index ca64d550373..33778b62392 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -16,7 +16,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="img_in", E="dpi", @@ -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 | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -76,6 +76,7 @@ def grdimage( Full GMT docs at :gmt-docs:`grdimage.html`. {aliases} + - B = frame - J = projection - M = monochrome - N = no_clip @@ -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, diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 8835cca7cf2..7811fff50c2 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -18,7 +18,6 @@ @use_alias( Jz="zscale", JZ="zsize", - B="frame", C="cmap", G="drapegrid", N="plane", @@ -36,6 +35,7 @@ def grdview( self, grid: PathLike | xr.DataArray, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -55,6 +55,7 @@ def grdview( Full GMT docs at :gmt-docs:`grdview.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -157,6 +158,7 @@ def grdview( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 5fa11cacc21..b73016071fb 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -14,7 +14,6 @@ @fmt_docstring @use_alias( A="horizontal", - B="frame", C="cmap", D="annotate", E="barwidth", @@ -41,6 +40,7 @@ def histogram( self, data: PathLike | TableLike, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -54,6 +54,7 @@ def histogram( Full GMT docs at :gmt-docs:`histogram.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -150,6 +151,7 @@ def histogram( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 6969f41f40a..89a5d00ccf2 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -118,7 +118,6 @@ def _auto_offset(spec) -> bool: @fmt_docstring @use_alias( A="offset", - B="frame", C="cmap", E="extensionfill", Fr="labelbox", @@ -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 | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -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 @@ -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, diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 0c5142c7828..833f33ee9f0 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -22,7 +22,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="offset", E="error_bar", @@ -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 | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -89,6 +89,7 @@ def plot( # noqa: PLR0912, PLR0913 {aliases} - A = straight_line + - B = frame - J = projection - R = region - V = verbose @@ -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, diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 6601d39ca2b..32a11e7b874 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -22,7 +22,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="offset", G="fill", @@ -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 | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -91,6 +91,7 @@ def plot3d( # noqa: PLR0912, PLR0913 {aliases} - A = straight_line + - B = frame - J = projection - R = region - V = verbose @@ -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, diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 685c196c494..ff5f7d4d8a4 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -14,7 +14,6 @@ @fmt_docstring @use_alias( A="sector", - B="frame", C="cmap", D="shift", Em="vectors", @@ -43,6 +42,7 @@ def rose( data: PathLike | TableLike | None = None, length=None, azimuth=None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -66,6 +66,7 @@ def rose( Full GMT docs at :gmt-docs:`rose.html`. {aliases} + - B = frame - R = region - V = verbose - c = panel @@ -210,6 +211,7 @@ def rose( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, R=region, V=verbose, c=panel, diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index dea8d7d4d21..9ff55d0632e 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -15,15 +15,16 @@ @fmt_docstring -@use_alias(B="frame", p="perspective") +@use_alias(p="perspective") @kwargs_to_strings(p="sequence") -def solar( +def solar( # noqa: PLR0913 self, terminator: Literal["astronomical", "civil", "day_night", "nautical"] = "day_night", terminator_datetime=None, fill: str | None = None, pen: str | None = None, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -40,6 +41,7 @@ def solar( Full GMT docs at :gmt-docs:`solar.html`. {aliases} + - B = frame - G = fill - J = projection - R = region @@ -139,6 +141,7 @@ def solar( ], W=Alias(pen, name="pen"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index db64120d206..0fece7e3744 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -23,7 +23,6 @@ Ff="figsize", Fs="subsize", A="autolabel", - B="frame", C="clearance", SC="sharex", SR="sharey", @@ -36,6 +35,7 @@ def subplot( ncols=1, margins: float | str | Sequence[float | str] | None = None, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -53,6 +53,7 @@ def subplot( Full GMT docs at :gmt-docs:`subplot.html#synopsis-begin-mode`. {aliases} + - B = frame - J = projection - M = margins - R = region @@ -175,6 +176,7 @@ def subplot( aliasdict = AliasSystem( M=Alias(margins, name="margins", sep="/", size=(2, 4)), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 43a0128780e..9aba66e5c23 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -13,7 +13,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", G="fill", JX="width", @@ -28,6 +27,7 @@ def ternary( alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -49,6 +49,7 @@ def ternary( Full GMT docs at :gmt-docs:`ternary.html`. {aliases} + - B = frame - L = alabel/blabel/clabel - R = region - V = verbose @@ -98,6 +99,7 @@ def ternary( aliasdict = AliasSystem( L=Alias(labels, name="alabel/blabel/clabel", sep="/", size=3), ).add_common( + B=frame, R=region, V=verbose, c=panel, diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 07027e10f5e..19f1592af13 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -24,7 +24,6 @@ @fmt_docstring @use_alias( - B="frame", C="clearance", D="offset", G="fill", @@ -50,6 +49,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -74,6 +74,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 Full GMT docs at :gmt-docs:`text.html`. {aliases} + - B = frame - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font - J = projection - N = no_clip @@ -275,6 +276,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index 5fa03cfc727..fbd13788451 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -18,13 +18,7 @@ @fmt_docstring -@use_alias( - B="frame", - E="dpi", - I="shading", - Q="nan_transparent", - p="perspective", -) +@use_alias(E="dpi", I="shading", Q="nan_transparent", p="perspective") @kwargs_to_strings(p="sequence") def tilemap( # noqa: PLR0913 self, @@ -38,6 +32,7 @@ def tilemap( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | tuple[int, int] | bool = False, @@ -137,6 +132,7 @@ def tilemap( # noqa: PLR0913 M=Alias(monochrome, name="monochrome"), N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index f4fe41d8a7f..7b64c62c35e 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -17,7 +17,6 @@ @fmt_docstring @use_alias( A="vector", - B="frame", C="cmap", D="rescale", E="uncertaintyfill", @@ -40,6 +39,7 @@ def velo( data: PathLike | TableLike | None = None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -62,6 +62,7 @@ def velo( Full GMT docs at :gmt-docs:`supplements/geodesy/velo.html`. {aliases} + - B = frame - J = projection - N = no_clip - R = region @@ -268,6 +269,7 @@ def velo( aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index b0d145a3687..f4be8f2cea8 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -40,7 +40,6 @@ def _parse_fills(fillpositive, fillnegative): @fmt_docstring @use_alias( - B="frame", D="position", T="track", W="pen", @@ -66,6 +65,7 @@ def wiggle( # noqa: PLR0913 fillnegative=None, projection: str | None = None, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | tuple[int, int] | bool = False, @@ -83,6 +83,7 @@ def wiggle( # noqa: PLR0913 Full GMT docs at :gmt-docs:`wiggle.html`. {aliases} + - B = frame - G = **+p**: fillpositive, **+n**: fillnegative - J = projection - R = region @@ -141,6 +142,7 @@ def wiggle( # noqa: PLR0913 aliasdict = AliasSystem( G=Alias(_fills, name="fillpositive/fillnegative"), ).add_common( + B=frame, J=projection, R=region, V=verbose, From 322dcf77ab3fea0a59dc5c1b6cd39210df9fdb64 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 10 Nov 2025 21:28:21 +0800 Subject: [PATCH 2/3] Fix type hints --- pygmt/src/basemap.py | 2 +- pygmt/src/coast.py | 2 +- pygmt/src/colorbar.py | 2 +- pygmt/src/contour.py | 2 +- pygmt/src/grdcontour.py | 2 +- pygmt/src/grdimage.py | 2 +- pygmt/src/grdview.py | 2 +- pygmt/src/histogram.py | 2 +- pygmt/src/meca.py | 2 +- pygmt/src/plot.py | 2 +- pygmt/src/plot3d.py | 2 +- pygmt/src/rose.py | 2 +- pygmt/src/solar.py | 2 +- pygmt/src/subplot.py | 2 +- pygmt/src/ternary.py | 2 +- pygmt/src/text.py | 2 +- pygmt/src/tilemap.py | 2 +- pygmt/src/velo.py | 2 +- pygmt/src/wiggle.py | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 67ae20a45f5..d2664a12673 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -25,7 +25,7 @@ def basemap( self, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 181f162790f..29fe4df9d96 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -41,7 +41,7 @@ def coast( ] = None, box: Box | bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index cfee8bd44ae..d183c1531ef 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -30,7 +30,7 @@ def colorbar( self, projection: str | None = None, box: Box | bool = False, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index e9922413e1c..d39f2e58f12 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -43,7 +43,7 @@ def contour( # noqa: PLR0913 z=None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index e409a3d5c4b..a54d36208e3 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -40,7 +40,7 @@ def grdcontour( self, grid: PathLike | xr.DataArray, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 33778b62392..d7f6cd5cdd9 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -33,7 +33,7 @@ def grdimage( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 7811fff50c2..460cd0edfaf 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -35,7 +35,7 @@ def grdview( self, grid: PathLike | xr.DataArray, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index b73016071fb..ac3cfe90d36 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -40,7 +40,7 @@ def histogram( self, data: PathLike | TableLike, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 89a5d00ccf2..1659c53ebbb 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -142,7 +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 | 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, diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 833f33ee9f0..9ed4408afdf 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -56,7 +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 | 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, diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 32a11e7b874..40a3ba89b06 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -58,7 +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 | 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, diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index ff5f7d4d8a4..ec776747ae3 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -42,7 +42,7 @@ def rose( data: PathLike | TableLike | None = None, length=None, azimuth=None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 9ff55d0632e..c318fb9e642 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -24,7 +24,7 @@ def solar( # noqa: PLR0913 fill: str | None = None, pen: str | None = None, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 0fece7e3744..8916d0edbb7 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -35,7 +35,7 @@ def subplot( ncols=1, margins: float | str | Sequence[float | str] | None = None, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 9aba66e5c23..02dbec1b626 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -27,7 +27,7 @@ def ternary( alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 19f1592af13..9f1cf00d73b 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -49,7 +49,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index fbd13788451..e0c3797b45a 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -32,7 +32,7 @@ def tilemap( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | tuple[int, int] | bool = False, diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 7b64c62c35e..8b7af32b0c6 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -39,7 +39,7 @@ def velo( data: PathLike | TableLike | None = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool | 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, diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index f4be8f2cea8..2ee1354d476 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -65,7 +65,7 @@ def wiggle( # noqa: PLR0913 fillnegative=None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - frame: str | Sequence[str] | bool | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | tuple[int, int] | bool = False, From 0577f12ba8e38a2f801ff2fcaf6321eecb607c0d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 10 Nov 2025 21:32:01 +0800 Subject: [PATCH 3/3] Add missing alias to tilemap --- pygmt/src/tilemap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index e0c3797b45a..ddedce590cd 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -53,6 +53,7 @@ def tilemap( # noqa: PLR0913 provide Spherical Mercator (EPSG:3857) coordinates to the ``region`` parameter. {aliases} + - B = frame - J = projection - M = monochrome - N = no_clip