MCPcopy Index your code
hub / github.com/pydata/xarray / test_interpolate_methods

Function test_interpolate_methods

xarray/tests/test_missing.py:333–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

331
332@requires_scipy
333def test_interpolate_methods():
334 for method in ["linear", "nearest", "zero", "slinear", "quadratic", "cubic"]:
335 kwargs: dict[str, Any] = {}
336 da = xr.DataArray(
337 np.array([0, 1, 2, np.nan, np.nan, np.nan, 6, 7, 8], dtype=np.float64),
338 dims="x",
339 )
340 actual = da.interpolate_na("x", method=method, **kwargs) # type: ignore[arg-type]
341 assert actual.isnull().sum() == 0
342
343 actual = da.interpolate_na("x", method=method, limit=2, **kwargs) # type: ignore[arg-type]
344 assert actual.isnull().sum() == 1
345
346
347@requires_scipy

Callers

nothing calls this directly

Calls 3

interpolate_naMethod · 0.95
sumMethod · 0.45
isnullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…