def test_resample_1_size(PM_da_initialized_1d): """Tests that the resampled dimensions are appropriate for a single iteration.""" dim = "member" expected = _resample(PM_da_initialized_1d, resample_dim=dim) # 1 somehow fails actual = _resample_iterations_idx(PM_da_initialized_1d, 2, dim=dim).isel(iteration=0) assert expected.size == actual.size assert expected[dim].size == actual[dim].size
def test_resample_size(PM_ds_initialized_1d): """Tests that the resampled dimensions are appropriate for many iterations.""" dim = "member" expected = xr.concat( [_resample(PM_ds_initialized_1d, resample_dim=dim) for i in range(ITERATIONS)], "iteration", ).tos actual = _resample_iterations_idx(PM_ds_initialized_1d, ITERATIONS, dim=dim).tos assert expected.size == actual.size assert expected[dim].size == actual[dim].size