Skip to content

docs(interpolate): add IDW examples and backend-support notes#3547

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-documentation-interpolate-idw-2026-06-26
Jun 27, 2026
Merged

docs(interpolate): add IDW examples and backend-support notes#3547
brendancol merged 1 commit into
mainfrom
deep-sweep-documentation-interpolate-idw-2026-06-26

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

What

Documentation-only fix for idw() in xrspatial/interpolate/_idw.py, found by the documentation sweep.

Findings

  • Cat1 (MEDIUM): idw() (the only public function in the module) had Parameters/Returns/Raises but no Examples section.
  • Cat5 (MEDIUM): backend support was undocumented. The function dispatches to numpy, cupy, dask+numpy, and dask+cupy via ArrayTypeFunctionMapping, the k-nearest path raises NotImplementedError on GPU, and NaN/inf input points are dropped, none of which was stated in the docstring.

Changes

  • Added a backend-support line covering all four backends plus the k-nearest CPU-only restriction.
  • Added a runnable Examples block (output verified against the current code).
  • Expanded Returns to note the float64 dtype, NaN/inf input dropping, and the zero-weight fill_value behavior.

No behavior changes. test_interpolation.py passes (92 tests). The example output was reproduced exactly against the worktree build.

Cat2/Cat3/Cat4 were clean: all nine parameters are documented with matching defaults and types, there were no prior examples to break, and idw is already listed in docs/source/reference/interpolation.rst.

idw() lacked an Examples section and did not document which backends it
supports (Cat1/Cat5 from the documentation sweep). Add a runnable
Examples block, a backend-support line covering numpy/cupy/dask+numpy/
dask+cupy and the k-nearest CPU-only restriction, and Returns notes for
the float64 dtype, NaN/inf input dropping, and zero-weight fill_value.

Doc-only: no behavior changes. Tests in test_interpolation.py pass (92).
@brendancol brendancol merged commit 7cd5745 into main Jun 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant