A test-coverage sweep on xrspatial/interpolate/_kriging.py found several untested paths in kriging(). The source is fine; these are missing tests.
Gaps
-
dask+numpy return_variance=True is never exercised. _kriging_dask_numpy._chunk_var has no test. The dask+cupy variance path is tested, but dask+numpy is not. Add a test asserting dask+numpy variance matches the numpy result.
-
nlags parameter. Only the default (15) is tested. Add a non-default nlags case and the invalid-input error paths: nlags=0 and nlags=-1 raise ValueError, nlags=2.5 raises TypeError.
-
Sparse-input warning path. A two-point input produces fewer than 3 non-empty lag bins and warns. The len(lag_h) < 3 branch is untested. Add a test asserting the UserWarning and finite output.
-
All-NaN kriging input. kriging() should raise ValueError when no valid points remain. Only the idw() equivalent is tested today.
-
Output metadata. No test asserts the kriging output preserves the template coords, dims, attrs, or name. idw() has this; kriging does not.
Related
Single-point kriging currently crashes (#2920). The PR for this issue adds an xfail test documenting the expected graceful behavior and links #2920. The source fix stays in #2920 so this PR is test-only.
A test-coverage sweep on
xrspatial/interpolate/_kriging.pyfound several untested paths inkriging(). The source is fine; these are missing tests.Gaps
dask+numpy
return_variance=Trueis never exercised._kriging_dask_numpy._chunk_varhas no test. The dask+cupy variance path is tested, but dask+numpy is not. Add a test asserting dask+numpy variance matches the numpy result.nlagsparameter. Only the default (15) is tested. Add a non-defaultnlagscase and the invalid-input error paths:nlags=0andnlags=-1raiseValueError,nlags=2.5raisesTypeError.Sparse-input warning path. A two-point input produces fewer than 3 non-empty lag bins and warns. The
len(lag_h) < 3branch is untested. Add a test asserting theUserWarningand finite output.All-NaN kriging input.
kriging()should raiseValueErrorwhen no valid points remain. Only theidw()equivalent is tested today.Output metadata. No test asserts the kriging output preserves the template coords, dims, attrs, or
name.idw()has this; kriging does not.Related
Single-point kriging currently crashes (#2920). The PR for this issue adds an
xfailtest documenting the expected graceful behavior and links #2920. The source fix stays in #2920 so this PR is test-only.