From 15ed33ec1a9a71ce4bc1da570d85390a473b8d01 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 30 Jul 2025 16:28:45 +0800 Subject: [PATCH 1/2] Migrate the 'panel' parameter to the new alias system --- pygmt/src/basemap.py | 7 ++++--- pygmt/src/coast.py | 6 ++++-- pygmt/src/colorbar.py | 9 ++++----- pygmt/src/contour.py | 6 ++++-- pygmt/src/grdcontour.py | 9 ++++++--- pygmt/src/grdimage.py | 9 ++++++--- pygmt/src/grdview.py | 7 ++++--- pygmt/src/histogram.py | 9 ++++----- pygmt/src/image.py | 7 ++++--- pygmt/src/legend.py | 6 ++++-- pygmt/src/logo.py | 7 ++++--- pygmt/src/meca.py | 6 ++++-- pygmt/src/plot.py | 6 ++++-- pygmt/src/plot3d.py | 8 +++++--- pygmt/src/rose.py | 20 ++++++++++++++++---- pygmt/src/solar.py | 6 ++++-- pygmt/src/subplot.py | 4 ++-- pygmt/src/ternary.py | 12 +++++++++--- pygmt/src/text.py | 8 +++++--- pygmt/src/tilemap.py | 6 ++++-- pygmt/src/velo.py | 13 ++++++++++--- pygmt/src/wiggle.py | 6 ++++-- 22 files changed, 115 insertions(+), 62 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index b28009ab55d..053319115b9 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -18,13 +18,12 @@ Td="rose", Tm="compass", V="verbose", - c="panel", f="coltypes", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def basemap(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def basemap(self, projection=None, panel=None, **kwargs): r""" Plot base maps and frames. @@ -40,6 +39,7 @@ def basemap(self, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -86,6 +86,7 @@ def basemap(self, projection=None, **kwargs): self._activate_figure() aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: lib.call_module(module="basemap", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 5cc38899eb6..e06178374f1 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -35,17 +35,17 @@ S="water", V="verbose", W="shorelines", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def coast( self, projection=None, resolution: Literal[ "auto", "full", "high", "intermediate", "low", "crude", None ] = None, + panel=None, **kwargs, ): r""" @@ -69,6 +69,7 @@ def coast( {aliases} - J=projection + - c=panel Parameters ---------- @@ -218,6 +219,7 @@ def coast( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index bc81a06b829..3863446a60b 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -23,14 +23,11 @@ V="verbose", W="scale", Z="zfile", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings( - R="sequence", G="sequence", I="sequence", c="sequence_comma", p="sequence" -) -def colorbar(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", G="sequence", I="sequence", p="sequence") +def colorbar(self, projection=None, panel=None, **kwargs): r""" Plot gray scale or color scale bar. @@ -46,6 +43,7 @@ def colorbar(self, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -149,6 +147,7 @@ def colorbar(self, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: lib.call_module(module="colorbar", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index ecda516e5b3..260fa728781 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -27,7 +27,6 @@ V="verbose", W="pen", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -37,7 +36,7 @@ p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def contour( self, data: PathLike | TableLike | None = None, @@ -45,6 +44,7 @@ def contour( y=None, z=None, projection=None, + panel=None, **kwargs, ): r""" @@ -59,6 +59,7 @@ def contour( {aliases} - J=projection + - c=panel Parameters ---------- @@ -155,6 +156,7 @@ def contour( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 8110ad651e1..7243c400a1e 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -32,13 +32,14 @@ V="verbose", W="pen", l="label", - c="panel", f="coltypes", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", L="sequence", c="sequence_comma", p="sequence") -def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", L="sequence", p="sequence") +def grdcontour( + self, grid: PathLike | xr.DataArray, projection=None, panel=None, **kwargs +): r""" Make contour map using a grid. @@ -48,6 +49,7 @@ def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -154,6 +156,7 @@ def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 8a5ebdb76c6..de456903acc 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -31,14 +31,15 @@ R="region", V="verbose", n="interpolation", - c="panel", f="coltypes", p="perspective", t="transparency", x="cores", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def grdimage( + self, grid: PathLike | xr.DataArray, projection=None, panel=None, **kwargs +): r""" Project and plot grids or images. @@ -74,6 +75,7 @@ def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -169,6 +171,7 @@ def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 7dc9b61197d..c99a59fd7a4 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -26,14 +26,13 @@ Wf="facadepen", I="shading", V="verbose", - c="panel", f="coltypes", n="interpolation", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def grdview(self, grid: PathLike | xr.DataArray, projection=None, panel=None, **kwargs): r""" Create 3-D perspective image or surface mesh from a grid. @@ -47,6 +46,7 @@ def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -145,6 +145,7 @@ def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 0bb3ab68c43..f18c5af108e 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -27,7 +27,6 @@ W="pen", Z="histtype", b="binary", - c="panel", d="nodata", e="find", h="header", @@ -37,10 +36,8 @@ t="transparency", w="wrap", ) -@kwargs_to_strings( - R="sequence", T="sequence", c="sequence_comma", i="sequence_comma", p="sequence" -) -def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", T="sequence", i="sequence_comma", p="sequence") +def histogram(self, data: PathLike | TableLike, projection=None, panel=None, **kwargs): r""" Calculate and plot histograms. @@ -48,6 +45,7 @@ def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -140,6 +138,7 @@ def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/image.py b/pygmt/src/image.py index 57e7d2cf6ae..b98e91b4237 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -16,12 +16,11 @@ M="monochrome", R="region", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def image(self, imagefile: PathLike, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def image(self, imagefile: PathLike, projection=None, panel=None, **kwargs): r""" Plot raster or EPS images. @@ -32,6 +31,7 @@ def image(self, imagefile: PathLike, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -73,6 +73,7 @@ def image(self, imagefile: PathLike, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index e6b0bae6fe9..8ffb5876f0b 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -24,17 +24,17 @@ D="position", F="box", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def legend( self, spec: PathLike | io.StringIO | None = None, projection=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", + panel=None, **kwargs, ): r""" @@ -50,6 +50,7 @@ def legend( {aliases} - J=projection + - c=panel Parameters ---------- @@ -101,6 +102,7 @@ def legend( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index bb8487ddb0f..df56b8e620f 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -14,11 +14,10 @@ F="box", S="style", V="verbose", - c="panel", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def logo(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def logo(self, projection=None, panel=None, **kwargs): r""" Plot the GMT logo. @@ -31,6 +30,7 @@ def logo(self, projection=None, **kwargs): {aliases} - J=projection + - c=panel Parameters ---------- @@ -59,6 +59,7 @@ def logo(self, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 0df6b32b3d8..3bb23f6f8d5 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -130,11 +130,10 @@ def _auto_offset(spec) -> bool: T="nodal", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def meca( # noqa: PLR0913 self, spec: PathLike | TableLike, @@ -148,6 +147,7 @@ def meca( # noqa: PLR0913 plot_latitude: float | Sequence[float] | None = None, event_name: str | Sequence[str] | None = None, projection=None, + panel=None, **kwargs, ): r""" @@ -203,6 +203,7 @@ def meca( # noqa: PLR0913 {aliases} - J=projection + - c=panel Parameters ---------- @@ -367,6 +368,7 @@ def meca( # noqa: PLR0913 aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 5595474afd8..776ba2c74d4 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -38,7 +38,6 @@ Z="zvalue", a="aspatial", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -50,7 +49,7 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def plot( # noqa: PLR0912 self, data: PathLike | TableLike | None = None, @@ -61,6 +60,7 @@ def plot( # noqa: PLR0912 direction=None, straight_line: bool | Literal["x", "y"] = False, # noqa: ARG001 projection=None, + panel=None, **kwargs, ): r""" @@ -88,6 +88,7 @@ def plot( # noqa: PLR0912 {aliases} - J=projection + - c=panel Parameters ---------- @@ -285,6 +286,7 @@ def plot( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 8cd20079764..9dbe0b5e89c 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -39,7 +39,6 @@ Z="zvalue", a="aspatial", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -51,8 +50,8 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") -def plot3d( # noqa: PLR0912 +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +def plot3d( # noqa: PLR0912, PLR0913 self, data: PathLike | TableLike | None = None, x=None, @@ -63,6 +62,7 @@ def plot3d( # noqa: PLR0912 direction=None, straight_line: bool | Literal["x", "y"] = False, # noqa: ARG001 projection=None, + panel=None, **kwargs, ): r""" @@ -90,6 +90,7 @@ def plot3d( # noqa: PLR0912 {aliases} - J=projection + - c=panel Parameters ---------- @@ -264,6 +265,7 @@ def plot3d( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index c99e0ecd09a..5959f7c8b20 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -3,6 +3,7 @@ """ from pygmt._typing import PathLike, TableLike +from pygmt.alias import Alias, AliasSystem from pygmt.clib import Session from pygmt.helpers import ( build_arg_list, @@ -37,14 +38,18 @@ e="find", h="header", i="incols", - c="panel", p="perspective", t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def rose( - self, data: PathLike | TableLike | None = None, length=None, azimuth=None, **kwargs + self, + data: PathLike | TableLike | None = None, + length=None, + azimuth=None, + panel=None, + **kwargs, ): """ Plot a polar histogram (rose, sector, windrose diagrams). @@ -62,6 +67,7 @@ def rose( Full GMT docs at :gmt-docs:`rose.html`. {aliases} + - c=panel Parameters ---------- @@ -201,8 +207,14 @@ def rose( """ self._activate_figure() + aliasdict = AliasSystem( + c=Alias(panel, name="panel", separator=",", size=2), + ).merge(kwargs) + with Session() as lib: with lib.virtualfile_in( check_kind="vector", data=data, x=length, y=azimuth ) as vintbl: - lib.call_module(module="rose", args=build_arg_list(kwargs, infile=vintbl)) + lib.call_module( + module="rose", args=build_arg_list(aliasdict, infile=vintbl) + ) diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index f7bac8c517b..2a5e63c5512 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -21,16 +21,16 @@ T="terminator/terminator_datetime-", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def solar( self, terminator: Literal["astronomical", "civil", "day_night", "nautical"] = "day_night", terminator_datetime=None, projection=None, + panel=None, **kwargs, ): r""" @@ -43,6 +43,7 @@ def solar( {aliases} - J=projection + - c=panel Parameters ---------- @@ -121,6 +122,7 @@ def solar( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 4003538df44..ecfba8ef083 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -11,6 +11,7 @@ build_arg_list, fmt_docstring, kwargs_to_strings, + sequence_join, use_alias, ) @@ -186,7 +187,6 @@ def subplot(self, nrows=1, ncols=1, projection=None, **kwargs): @fmt_docstring @contextlib.contextmanager @use_alias(A="fixedlabel", C="clearance", V="verbose") -@kwargs_to_strings(panel="sequence_comma") def set_panel(self, panel=None, **kwargs): r""" Set the current subplot panel to plot on. @@ -236,7 +236,7 @@ def set_panel(self, panel=None, **kwargs): {verbose} """ self._activate_figure() - + panel = sequence_join(panel, separator=",", size=2, name="panel") with Session() as lib: lib.call_module( module="subplot", args=["set", str(panel), *build_arg_list(kwargs)] diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index af88a5586cb..468ba83007b 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -5,6 +5,7 @@ import pandas as pd from packaging.version import Version from pygmt._typing import PathLike, TableLike +from pygmt.alias import Alias, AliasSystem from pygmt.clib import Session, __gmt_version__ from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias @@ -20,17 +21,17 @@ S="style", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def ternary( self, data: PathLike | TableLike, alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, + panel=None, **kwargs, ): r""" @@ -47,6 +48,7 @@ def ternary( Full GMT docs at :gmt-docs:`ternary.html`. {aliases} + - c=panel Parameters ---------- @@ -94,9 +96,13 @@ def ternary( if Version(__gmt_version__) < Version("6.5.0") and isinstance(data, pd.DataFrame): data = data.to_numpy() + aliasdict = AliasSystem( + c=Alias(panel, name="panel", separator=",", size=2), + ).merge(kwargs) + with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=data) as vintbl: lib.call_module( module="ternary", - args=build_arg_list(kwargs, infile=vintbl), + args=build_arg_list(aliasdict, infile=vintbl), ) diff --git a/pygmt/src/text.py b/pygmt/src/text.py index cd8e788e691..9c8f2fb9e1b 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -33,7 +33,6 @@ V="verbose", W="pen", a="aspatial", - c="panel", e="find", f="coltypes", h="header", @@ -42,8 +41,8 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def text_( # noqa: PLR0912 +@kwargs_to_strings(R="sequence", p="sequence") +def text_( # noqa: PLR0912, PLR0913 self, textfiles: PathLike | TableLike | None = None, x=None, @@ -54,6 +53,7 @@ def text_( # noqa: PLR0912 font=None, justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, projection=None, + panel=None, **kwargs, ): r""" @@ -74,6 +74,7 @@ def text_( # noqa: PLR0912 {aliases} - J=projection + - c=panel Parameters ---------- @@ -266,6 +267,7 @@ def text_( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index e7bdc0d3042..5b6aedb4992 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -26,11 +26,10 @@ Q="nan_transparent", # R="region", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(c="sequence_comma", p="sequence") # R="sequence", +@kwargs_to_strings(p="sequence") # R="sequence", def tilemap( self, region: list, @@ -41,6 +40,7 @@ def tilemap( max_retries: int = 2, zoom_adjust: int | None = None, projection=None, + panel=None, **kwargs, ): r""" @@ -58,6 +58,7 @@ def tilemap( {aliases} - J=projection + - c=panel Parameters ---------- @@ -129,6 +130,7 @@ def tilemap( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index c65c82e500f..21bc4408dc6 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -33,7 +33,6 @@ V="verbose", W="pen", Z="zvalue", - c="panel", d="nodata", e="find", h="header", @@ -41,8 +40,14 @@ p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") -def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +def velo( + self, + data: PathLike | TableLike | None = None, + projection=None, + panel=None, + **kwargs, +): r""" Plot velocity vectors, crosses, anisotropy bars, and wedges. @@ -59,6 +64,7 @@ def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwar {aliases} - J=projection + - c=panel Parameters ---------- @@ -259,6 +265,7 @@ def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwar aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index e4885809680..2ae55da0ec6 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -19,7 +19,6 @@ W="pen", Z="scale", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -30,7 +29,7 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def wiggle( self, data: PathLike | TableLike | None = None, @@ -40,6 +39,7 @@ def wiggle( fillpositive=None, fillnegative=None, projection=None, + panel=None, **kwargs, ): r""" @@ -54,6 +54,7 @@ def wiggle( {aliases} - J=projection + - c=panel Parameters ---------- @@ -112,6 +113,7 @@ def wiggle( aliasdict = AliasSystem( J=Alias(projection, name="projection"), + c=Alias(panel, name="panel", separator=",", size=2), ).merge(kwargs) with Session() as lib: From ee00133d7e56c4c5523419660830e30c2838e6a8 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 31 Jul 2025 14:48:20 +0800 Subject: [PATCH 2/2] Replace separator with sep --- 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/image.py | 2 +- pygmt/src/legend.py | 2 +- pygmt/src/logo.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 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 053319115b9..6d2c145b7d2 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -86,7 +86,7 @@ def basemap(self, projection=None, panel=None, **kwargs): self._activate_figure() aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: lib.call_module(module="basemap", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index e06178374f1..0d78f9c1f0b 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -219,7 +219,7 @@ def coast( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 3863446a60b..c5a67609ae8 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -147,7 +147,7 @@ def colorbar(self, projection=None, panel=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: lib.call_module(module="colorbar", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index 260fa728781..06596004ba7 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -156,7 +156,7 @@ def contour( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 7243c400a1e..5756fcc7075 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -156,7 +156,7 @@ def grdcontour( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index de456903acc..29dd91d18fc 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -171,7 +171,7 @@ def grdimage( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index c99a59fd7a4..36e689ad464 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -145,7 +145,7 @@ def grdview(self, grid: PathLike | xr.DataArray, projection=None, panel=None, ** aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index f18c5af108e..37e8ecbfe3c 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -138,7 +138,7 @@ def histogram(self, data: PathLike | TableLike, projection=None, panel=None, **k aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/image.py b/pygmt/src/image.py index b98e91b4237..2cd9f1a1710 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -73,7 +73,7 @@ def image(self, imagefile: PathLike, projection=None, panel=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index 8ffb5876f0b..b93ba0b74c1 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -102,7 +102,7 @@ def legend( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index df56b8e620f..e473b63df9c 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -59,7 +59,7 @@ def logo(self, projection=None, panel=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 3bb23f6f8d5..7bf4fae6d5a 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -368,7 +368,7 @@ def meca( # noqa: PLR0913 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 776ba2c74d4..48ee180fbdb 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -286,7 +286,7 @@ def plot( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 9dbe0b5e89c..72deeff2e2d 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -265,7 +265,7 @@ def plot3d( # noqa: PLR0912, PLR0913 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 5959f7c8b20..6a76f8de7b0 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -208,7 +208,7 @@ def rose( self._activate_figure() aliasdict = AliasSystem( - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 2a5e63c5512..07545ba5187 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -122,7 +122,7 @@ def solar( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index ecfba8ef083..caf42da4152 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -236,7 +236,7 @@ def set_panel(self, panel=None, **kwargs): {verbose} """ self._activate_figure() - panel = sequence_join(panel, separator=",", size=2, name="panel") + panel = sequence_join(panel, sep=",", size=2, name="panel") with Session() as lib: lib.call_module( module="subplot", args=["set", str(panel), *build_arg_list(kwargs)] diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 468ba83007b..8836e8e98c1 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -97,7 +97,7 @@ def ternary( data = data.to_numpy() aliasdict = AliasSystem( - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 9c8f2fb9e1b..d2749becc87 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -267,7 +267,7 @@ def text_( # noqa: PLR0912, PLR0913 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index 5b6aedb4992..130d3397cd1 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -130,7 +130,7 @@ def tilemap( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 21bc4408dc6..1371b0be081 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -265,7 +265,7 @@ def velo( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 2ae55da0ec6..8b539f457c2 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -113,7 +113,7 @@ def wiggle( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - c=Alias(panel, name="panel", separator=",", size=2), + c=Alias(panel, name="panel", sep=",", size=2), ).merge(kwargs) with Session() as lib: