()
| 298 | |
| 299 | @requires_cftime |
| 300 | def test_interp_calendar_errors(): |
| 301 | src_nl = DataArray( |
| 302 | [1] * 100, |
| 303 | dims=("time",), |
| 304 | coords={ |
| 305 | "time": date_range("0000-01-01", periods=100, freq="MS", calendar="noleap") |
| 306 | }, |
| 307 | ) |
| 308 | tgt_360 = date_range("0001-01-01", "0001-12-30", freq="MS", calendar="standard") |
| 309 | |
| 310 | with pytest.raises( |
| 311 | ValueError, match="Source time coordinate contains dates with year 0" |
| 312 | ): |
| 313 | interp_calendar(src_nl, tgt_360) |
| 314 | |
| 315 | da1 = DataArray([0, 1, 2], dims=("x",), name="x") |
| 316 | da2 = da1 + 1 |
| 317 | |
| 318 | with pytest.raises( |
| 319 | ValueError, match=r"Both 'source.x' and 'target' must contain datetime objects." |
| 320 | ): |
| 321 | interp_calendar(da1, da2, dim="x") |
| 322 | |
| 323 | |
| 324 | @requires_cftime |
nothing calls this directly
no test coverage detected
searching dependent graphs…