MCPcopy
hub / github.com/pydata/xarray / test_interp1d_bounds_error

Function test_interp1d_bounds_error

xarray/tests/test_interp.py:1018–1029  ·  view source on GitHub ↗

Ensure exception on bounds error is raised if requested

()

Source from the content-addressed store, hash-verified

1016
1017@requires_scipy
1018def test_interp1d_bounds_error() -> None:
1019 """Ensure exception on bounds error is raised if requested"""
1020 da = xr.DataArray(
1021 np.sin(0.3 * np.arange(4)),
1022 [("time", np.arange(4))],
1023 )
1024
1025 with pytest.raises(ValueError):
1026 da.interp(time=3.5, kwargs=dict(bounds_error=True))
1027
1028 # default is to fill with nans, so this should pass
1029 da.interp(time=3.5)
1030
1031
1032@requires_scipy

Callers

nothing calls this directly

Calls 3

interpMethod · 0.95
sinMethod · 0.80
arangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…