Skip to content

Test coverage gaps in interpolate/_kriging.py (backend, params, edge cases) #2921

@brendancol

Description

@brendancol

A test-coverage sweep on xrspatial/interpolate/_kriging.py found several untested paths in kriging(). The source is fine; these are missing tests.

Gaps

  1. 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.

  2. 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.

  3. 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.

  4. All-NaN kriging input. kriging() should raise ValueError when no valid points remain. Only the idw() equivalent is tested today.

  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gpuCuPy / CUDA GPU supportseverity:mediumSweep finding: MEDIUMtestsTest coverage and parity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions