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

Function test_interpolate_na_max_gap_errors

xarray/tests/test_missing.py:662–679  ·  view source on GitHub ↗
(da_time)

Source from the content-addressed store, hash-verified

660
661
662def test_interpolate_na_max_gap_errors(da_time):
663 with pytest.raises(
664 NotImplementedError, match=r"max_gap not implemented for unlabeled coordinates"
665 ):
666 da_time.interpolate_na("t", max_gap=1)
667
668 with pytest.raises(ValueError, match=r"max_gap must be a scalar."):
669 da_time.interpolate_na("t", max_gap=(1,))
670
671 da_time["t"] = pd.date_range("2001-01-01", freq="h", periods=11)
672 with pytest.raises(TypeError, match=r"Expected value of type str"):
673 da_time.interpolate_na("t", max_gap=1)
674
675 with pytest.raises(TypeError, match=r"Expected integer or floating point"):
676 da_time.interpolate_na("t", max_gap="1h", use_coordinate=False)
677
678 with pytest.raises(ValueError, match=r"Could not convert 'huh' to timedelta64"):
679 da_time.interpolate_na("t", max_gap="huh")
680
681
682@requires_bottleneck

Callers

nothing calls this directly

Calls 1

interpolate_naMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…