(request, backend)
| 94 | |
| 95 | @pytest.fixture(params=[1]) |
| 96 | def da(request, backend): |
| 97 | if request.param == 1: |
| 98 | times = pd.date_range("2000-01-01", freq="1D", periods=21) |
| 99 | da = DataArray( |
| 100 | np.random.random((3, 21, 4)), |
| 101 | dims=("a", "time", "x"), |
| 102 | coords=dict(time=times), |
| 103 | ) |
| 104 | |
| 105 | if request.param == 2: |
| 106 | da = DataArray([0, np.nan, 1, 2, np.nan, 3, 4, 5, np.nan, 6, 7], dims="time") |
| 107 | |
| 108 | if request.param == "repeating_ints": |
| 109 | da = DataArray( |
| 110 | np.tile(np.arange(12), 5).reshape(5, 4, 3), |
| 111 | coords={"x": list("abc"), "y": list("defg")}, |
| 112 | dims=list("zyx"), |
| 113 | ) |
| 114 | |
| 115 | if backend == "dask": |
| 116 | return da.chunk() |
| 117 | elif backend == "numpy": |
| 118 | return da |
| 119 | else: |
| 120 | raise ValueError |
| 121 | |
| 122 | |
| 123 | @pytest.fixture( |
no test coverage detected