(calendar, units_year)
| 7196 | @pytest.mark.parametrize("calendar", _NON_STANDARD_CALENDARS) |
| 7197 | @pytest.mark.parametrize("units_year", [1500, 2000, 2500]) |
| 7198 | def test_use_cftime_false_nonstandard_calendar(calendar, units_year) -> None: |
| 7199 | x = [0, 1] |
| 7200 | time = [0, 720] |
| 7201 | units = f"days since {units_year}" |
| 7202 | original = DataArray(x, [("time", time)], name="x").to_dataset() |
| 7203 | for v in ["x", "time"]: |
| 7204 | original[v].attrs["units"] = units |
| 7205 | original[v].attrs["calendar"] = calendar |
| 7206 | |
| 7207 | with create_tmp_file() as tmp_file: |
| 7208 | original.to_netcdf(tmp_file) |
| 7209 | decoder = CFDatetimeCoder(use_cftime=False) |
| 7210 | with pytest.raises((OutOfBoundsDatetime, ValueError)): |
| 7211 | open_dataset(tmp_file, decode_times=decoder) |
| 7212 | |
| 7213 | |
| 7214 | @pytest.mark.parametrize("engine", ["netcdf4", "scipy"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…