From 5fac3ae086fa09c84b52fd1d2eaabc63774d6998 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 29 Sep 2024 18:49:03 +0800 Subject: [PATCH] Remove the old aliases --- pygmt/src/coast.py | 8 +++----- pygmt/src/grdlandmask.py | 9 +++------ pygmt/src/select.py | 8 +++----- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index e456fc74a55..fe0a034ec30 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -22,7 +22,6 @@ A="area_thresh", B="frame", C="lakes", - D="resolution", E="dcw", F="box", G="land", @@ -41,7 +40,7 @@ @kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def coast( self, - resolution: Literal[ # noqa: ARG001 + resolution: Literal[ "auto", "full", "high", "intermediate", "low", "crude" ] = "auto", **kwargs, @@ -210,9 +209,8 @@ def coast( lakes, land, water, rivers, borders, dcw, Q, or shorelines""" ) - # Resolution - if kwargs.get("D") is not None: - kwargs["D"] = kwargs["D"][0] + # Alias 'resolution' to "D". + kwargs["D"] = resolution[0] with Session() as lib: lib.call_module(module="coast", args=build_arg_list(kwargs)) diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index fd8a539a8fa..b99b13497ad 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -15,7 +15,6 @@ @fmt_docstring @use_alias( A="area_thresh", - D="resolution", E="bordervalues", I="spacing", N="maskvalues", @@ -27,7 +26,7 @@ @kwargs_to_strings(I="sequence", R="sequence", N="sequence", E="sequence") def grdlandmask( outgrid: str | None = None, - resolution: Literal["full", "high", "intermediate", "low", "crude"] = "low", # noqa: ARG001 + resolution: Literal["full", "high", "intermediate", "low", "crude"] = "low", **kwargs, ) -> xr.DataArray | None: r""" @@ -100,10 +99,8 @@ def grdlandmask( if kwargs.get("I") is None or kwargs.get("R") is None: raise GMTInvalidInput("Both 'region' and 'spacing' must be specified.") - # Resolution - if kwargs.get("D") is not None: - kwargs["D"] = kwargs["D"][0] - + # Alias "resolution" to "D" + kwargs["D"] = resolution[0] with Session() as lib: with lib.virtualfile_out(kind="grid", fname=outgrid) as voutgrd: kwargs["G"] = voutgrd diff --git a/pygmt/src/select.py b/pygmt/src/select.py index c54c2fdf3a5..21d2c856217 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -22,7 +22,6 @@ @use_alias( A="area_thresh", C="dist2pt", - D="resolution", F="polygon", G="gridmask", I="reverse", @@ -48,7 +47,7 @@ def select( data=None, output_type: Literal["pandas", "numpy", "file"] = "pandas", outfile: str | None = None, - resolution: Literal["full", "high", "intermediate", "low", "crude"] = "low", # noqa: ARG001 + resolution: Literal["full", "high", "intermediate", "low", "crude"] = "low", **kwargs, ) -> pd.DataFrame | np.ndarray | None: r""" @@ -203,9 +202,8 @@ def select( >>> # longitudes 246 and 247 and latitudes 20 and 21 >>> out = pygmt.select(data=ship_data, region=[246, 247, 20, 21]) """ - # Resolution - if kwargs.get("D") is not None: - kwargs["D"] = kwargs["D"][0] + # Alias "resolution" to "D" + kwargs["D"] = resolution[0] output_type = validate_output_table_type(output_type, outfile=outfile)