Skip to content

Align kriging metadata with ignored observations - #424

Open
antonsoo wants to merge 1 commit into
GeoStat-Framework:mainfrom
antonsoo:fix/missing-conditioning-metadata
Open

antonsoo wants to merge 1 commit into
GeoStat-Framework:mainfrom
antonsoo:fix/missing-conditioning-metadata

Conversation

@antonsoo

Copy link
Copy Markdown

Ignoring missing observations currently fails when per-observation measurement errors or external drifts accompany them:

import numpy as np
import gstools as gs

gs.krige.Ordinary(
    gs.Exponential(dim=1, nugget=0.1),
    [0., 1., 2.], [0., np.nan, 2.],
    cond_err=[0.01, 0.02, 0.03],
)

This raises krige.cond_err: wrong number of measurement errors. The positions and values are filtered, but the corresponding error entries remain. External drifts have the same mismatch. Apply the finite-value mask to full-length metadata, while retaining support for already filtered arrays and scalar/nugget errors.

Regressions cover both metadata types, multiple drifts, refreshes, NaN/infinity, unchanged input arrays and malformed metadata. The full suite passes (215 tests and 17 subtests; two existing PyVista skips), as do source/benchmark Ruff checks and wheel/sdist builds.

A separate audit with the bundled DWD measurements withholds station observations and checks interpolation against explicit filtering and independently assembled covariance equations. All 18 previously failing calls recover 1,152 predictions within 3.59e-13 of the dense reference; the 36 explicit-filter/already-filtered control paths remain identical. #422's current head still reproduces both errors.

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