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

Function test_interp_non_numeric_nd

xarray/tests/test_interp.py:1112–1125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1110
1111@requires_scipy
1112def test_interp_non_numeric_nd() -> None:
1113 # regression test for GH8099, GH9839
1114 ds = xr.Dataset({"x": ("a", np.arange(4))}, coords={"a": (np.arange(4) - 1.5)})
1115 t = xr.DataArray(
1116 np.random.randn(6).reshape((2, 3)) * 0.5,
1117 dims=["r", "s"],
1118 coords={"r": np.arange(2) - 0.5, "s": np.arange(3) - 1},
1119 )
1120 ds["m"] = ds.x > 1
1121
1122 actual = ds.interp(a=t, method="linear")
1123 # with numeric only
1124 expected = ds[["x"]].interp(a=t, method="linear")
1125 assert_identical(actual[["x"]], expected)
1126
1127
1128@requires_dask

Callers

nothing calls this directly

Calls 3

interpMethod · 0.95
assert_identicalFunction · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…