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

Function test_interp_non_numeric_scalar

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

Source from the content-addressed store, hash-verified

1067
1068@requires_scipy
1069def test_interp_non_numeric_scalar() -> None:
1070 ds = xr.Dataset(
1071 {
1072 "non_numeric": ("time", np.array(["a"])),
1073 },
1074 coords={"time": (np.array([0]))},
1075 )
1076 actual = ds.interp(time=np.linspace(0, 3, 3))
1077
1078 expected = xr.Dataset(
1079 {
1080 "non_numeric": ("time", np.array(["a", "a", "a"])),
1081 },
1082 coords={"time": np.linspace(0, 3, 3)},
1083 )
1084 xr.testing.assert_identical(actual, expected)
1085
1086 # Make sure the array is a copy:
1087 assert actual["non_numeric"].data.base is None
1088
1089
1090@requires_scipy

Callers

nothing calls this directly

Calls 2

interpMethod · 0.95
linspaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…