Skip to content

pygmt.grdfill: Deprecate parameter 'no_data' to 'hole' (remove in v0.19.0) #3852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions pygmt/src/grdfill.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
"""
grdfill - Fill blank areas from a grid.
grdfill - Interpolate across holes in a grid.
"""

import xarray as xr
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias
from pygmt.helpers import (
build_arg_list,
deprecate_parameter,
fmt_docstring,
kwargs_to_strings,
use_alias,
)

__doctest_skip__ = ["grdfill"]


@fmt_docstring
@use_alias(
A="mode",
N="no_data",
R="region",
V="verbose",
)
# TODO(PyGMT>=0.19.0): Remove the deprecated 'no_data' parameter.
@deprecate_parameter("no_data", "hole", "v0.15.0", remove_version="v0.19.0")
@use_alias(A="mode", N="hole", R="region", V="verbose")
@kwargs_to_strings(R="sequence")
def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
r"""
Fill blank areas from a grid file.
Interpolate across holes in a grid.

Read a grid that presumably has unfilled holes that the user wants to
fill in some fashion. Holes are identified by NaN values but this
criteria can be changed via the ``no_data`` parameter. There are several
different algorithms that can be used to replace the hole values.
Read a grid that presumably has unfilled holes that the user wants to fill in some
fashion. Holes are identified by NaN values but this criteria can be changed via the
``hole`` parameter. There are several different algorithms that can be used to
replace the hole values. If no holes are found the original unchanged grid is
returned.

Full option list at :gmt-docs:`grdfill.html`

Expand All @@ -43,10 +47,9 @@ def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
where (*X,Y*) are the node dimensions of the grid]), or
**s** for bicubic spline (optionally append a *tension*
parameter [Default is no tension]).
no_data : float
Set the node value used to identify a point as a member of a hole
[Default is NaN].

hole : float
Set the node value used to identify a point as a member of a hole [Default is
NaN].
{region}
{verbose}

Expand Down
Loading