Skip to content

Commit 48131a8

Browse files
authored
pygmt.grdfill: Deprecate parameter 'no_data' to 'hole' (remove in v0.19.0) (#3852)
1 parent e7abf7c commit 48131a8

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

pygmt/src/grdfill.py

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
"""
2-
grdfill - Fill blank areas from a grid.
2+
grdfill - Interpolate across holes in a grid.
33
"""
44

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

1016
__doctest_skip__ = ["grdfill"]
1117

1218

1319
@fmt_docstring
14-
@use_alias(
15-
A="mode",
16-
N="no_data",
17-
R="region",
18-
V="verbose",
19-
)
20+
# TODO(PyGMT>=0.19.0): Remove the deprecated 'no_data' parameter.
21+
@deprecate_parameter("no_data", "hole", "v0.15.0", remove_version="v0.19.0")
22+
@use_alias(A="mode", N="hole", R="region", V="verbose")
2023
@kwargs_to_strings(R="sequence")
2124
def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
2225
r"""
23-
Fill blank areas from a grid file.
26+
Interpolate across holes in a grid.
2427
25-
Read a grid that presumably has unfilled holes that the user wants to
26-
fill in some fashion. Holes are identified by NaN values but this
27-
criteria can be changed via the ``no_data`` parameter. There are several
28-
different algorithms that can be used to replace the hole values.
28+
Read a grid that presumably has unfilled holes that the user wants to fill in some
29+
fashion. Holes are identified by NaN values but this criteria can be changed via the
30+
``hole`` parameter. There are several different algorithms that can be used to
31+
replace the hole values. If no holes are found the original unchanged grid is
32+
returned.
2933
3034
Full option list at :gmt-docs:`grdfill.html`
3135
@@ -43,10 +47,9 @@ def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
4347
where (*X,Y*) are the node dimensions of the grid]), or
4448
**s** for bicubic spline (optionally append a *tension*
4549
parameter [Default is no tension]).
46-
no_data : float
47-
Set the node value used to identify a point as a member of a hole
48-
[Default is NaN].
49-
50+
hole : float
51+
Set the node value used to identify a point as a member of a hole [Default is
52+
NaN].
5053
{region}
5154
{verbose}
5255

0 commit comments

Comments
 (0)