Create a DataArray with a time-axis that contains cftime.datetime objects.
(self)
| 3114 | class TestNcAxisNotInstalled(PlotTestCase): |
| 3115 | @pytest.fixture(autouse=True) |
| 3116 | def setUp(self) -> None: |
| 3117 | """ |
| 3118 | Create a DataArray with a time-axis that contains cftime.datetime |
| 3119 | objects. |
| 3120 | """ |
| 3121 | month = np.arange(1, 13, 1) |
| 3122 | data = np.sin(2 * np.pi * month / 12.0) |
| 3123 | darray = DataArray(data, dims=["time"]) |
| 3124 | darray.coords["time"] = xr.date_range( |
| 3125 | start="2017", periods=12, freq="1ME", calendar="noleap", use_cftime=True |
| 3126 | ) |
| 3127 | |
| 3128 | self.darray = darray |
| 3129 | |
| 3130 | def test_ncaxis_notinstalled_line_plot(self) -> None: |
| 3131 | with pytest.raises(ImportError, match=r"optional `nc-time-axis`"): |