MCPcopy
hub / github.com/pydata/xarray / setUp

Method setUp

xarray/tests/test_plot.py:3029–3038  ·  view source on GitHub ↗

Create a DataArray with a time-axis that contains datetime objects.

(self)

Source from the content-addressed store, hash-verified

3027class 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

Callers

nothing calls this directly

Calls 3

DataArrayClass · 0.90
arangeMethod · 0.80
sinMethod · 0.80

Tested by

no test coverage detected