(self, mode, stat_length)
| 4709 | "stat_length", (None, 3, (1, 3), {"dim_0": (2, 1), "dim_2": (4, 2)}) |
| 4710 | ) |
| 4711 | def test_pad_stat_length(self, mode, stat_length) -> None: |
| 4712 | ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5)) |
| 4713 | actual = ar.pad(dim_0=(1, 3), dim_2=(2, 2), mode=mode, stat_length=stat_length) |
| 4714 | if isinstance(stat_length, dict): |
| 4715 | stat_length = (stat_length["dim_0"], (4, 4), stat_length["dim_2"]) |
| 4716 | expected = DataArray( |
| 4717 | np.pad( |
| 4718 | np.arange(3 * 4 * 5).reshape(3, 4, 5), |
| 4719 | pad_width=((1, 3), (0, 0), (2, 2)), |
| 4720 | mode=mode, |
| 4721 | stat_length=stat_length, |
| 4722 | ) |
| 4723 | ) |
| 4724 | assert actual.shape == (7, 4, 9) |
| 4725 | assert_identical(actual, expected) |
| 4726 | |
| 4727 | @pytest.mark.parametrize( |
| 4728 | "end_values", (None, 3, (3, 5), {"dim_0": (2, 1), "dim_2": (4, 2)}) |
nothing calls this directly
no test coverage detected