Skip to content

Commit 8e599a6

Browse files
committed
pygmt.grdclip: Deprecate parameter 'new' to 'replace' (will be removed in v0.19.0)
1 parent a11fc15 commit 8e599a6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pygmt/src/grdclip.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,26 @@
44

55
import xarray as xr
66
from pygmt.clib import Session
7-
from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias
7+
from pygmt.helpers import (
8+
build_arg_list,
9+
deprecate_parameter,
10+
fmt_docstring,
11+
kwargs_to_strings,
12+
use_alias,
13+
)
814

915
__doctest_skip__ = ["grdclip"]
1016

1117

18+
# TODO(PyGMT>=0.19.0): Remove the deprecated "new" parameter.
1219
@fmt_docstring
20+
@deprecate_parameter("new", "replace", "v0.15.0", remove_version="v0.19.0")
1321
@use_alias(
1422
R="region",
1523
Sa="above",
1624
Sb="below",
1725
Si="between",
18-
Sr="new",
26+
Sr="replace",
1927
V="verbose",
2028
)
2129
@kwargs_to_strings(
@@ -55,7 +63,7 @@ def grdclip(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
5563
between : str or list
5664
[*low*, *high*, *between*].
5765
Set all data[i] >= *low* and <= *high* to *between*.
58-
new : str or list
66+
replace : str or list
5967
[*old*, *new*].
6068
Set all data[i] == *old* to *new*. This is mostly useful when
6169
your data are known to be integer values.

0 commit comments

Comments
 (0)