()
| 331 | |
| 332 | @requires_scipy |
| 333 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…