Create a DataArray with a time-axis that contains datetime objects.
(self)
| 3027 | class TestDatetimePlot(PlotTestCase): |
| 3028 | @pytest.fixture(autouse=True) |
| 3029 | def setUp(self) -> None: |
| 3030 | """ |
| 3031 | Create a DataArray with a time-axis that contains datetime objects. |
| 3032 | """ |
| 3033 | month = np.arange(1, 13, 1) |
| 3034 | data = np.sin(2 * np.pi * month / 12.0) |
| 3035 | times = pd.date_range(start="2017-01-01", freq="MS", periods=12) |
| 3036 | darray = DataArray(data, dims=["time"], coords=[times]) |
| 3037 | |
| 3038 | self.darray = darray |
| 3039 | |
| 3040 | def test_datetime_line_plot(self) -> None: |
| 3041 | # test if line plot raises no Exception |