Skip to content

Commit

Permalink
Remove the old aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Oct 29, 2024
1 parent 4fae745 commit 5fac3ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
8 changes: 3 additions & 5 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
A="area_thresh",
B="frame",
C="lakes",
D="resolution",
E="dcw",
F="box",
G="land",
Expand All @@ -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,
Expand Down Expand Up @@ -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))
9 changes: 3 additions & 6 deletions pygmt/src/grdlandmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@fmt_docstring
@use_alias(
A="area_thresh",
D="resolution",
E="bordervalues",
I="spacing",
N="maskvalues",
Expand All @@ -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"""
Expand Down Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions pygmt/src/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
@use_alias(
A="area_thresh",
C="dist2pt",
D="resolution",
F="polygon",
G="gridmask",
I="reverse",
Expand All @@ -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"""
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5fac3ae

Please sign in to comment.