(self)
| 95 | self.assertLazyAndIdentical(self.eager_var, self.lazy_var.copy(deep=True)) |
| 96 | |
| 97 | def test_chunk(self): |
| 98 | test_cases: list[tuple[int | dict[str, Any], tuple[tuple[int, ...], ...]]] = [ |
| 99 | ({}, ((2, 2), (2, 2, 2))), |
| 100 | (3, ((3, 1), (3, 3))), |
| 101 | ({"x": 3, "y": 3}, ((3, 1), (3, 3))), |
| 102 | ({"x": 3}, ((3, 1), (2, 2, 2))), |
| 103 | ({"x": (3, 1)}, ((3, 1), (2, 2, 2))), |
| 104 | ] |
| 105 | for chunks, expected in test_cases: |
| 106 | rechunked = self.lazy_var.chunk(chunks) |
| 107 | assert rechunked.chunks == expected |
| 108 | self.assertLazyAndIdentical(self.eager_var, rechunked) |
| 109 | |
| 110 | expected_chunksizes = dict(zip(self.lazy_var.dims, expected, strict=True)) |
| 111 | assert rechunked.chunksizes == expected_chunksizes |
| 112 | |
| 113 | def test_indexing(self): |
| 114 | u = self.eager_var |
nothing calls this directly
no test coverage detected