Honor the backend's preferred chunks when opening a dataset.
(self, shape, pref_chunks, request_with_empty_map)
| 216 | ) |
| 217 | @pytest.mark.parametrize("request_with_empty_map", [False, True]) |
| 218 | def test_honor_chunks(self, shape, pref_chunks, request_with_empty_map): |
| 219 | """Honor the backend's preferred chunks when opening a dataset.""" |
| 220 | initial = self.create_dataset(shape, pref_chunks) |
| 221 | # To keep the backend's preferred chunks, the `chunks` argument must be an |
| 222 | # empty mapping or map dimensions to `None`. |
| 223 | chunks = ( |
| 224 | {} |
| 225 | if request_with_empty_map |
| 226 | else dict.fromkeys(initial[self.var_name].dims, None) |
| 227 | ) |
| 228 | final = xr.open_dataset( |
| 229 | initial, engine=PassThroughBackendEntrypoint, chunks=chunks |
| 230 | ) |
| 231 | self.check_dataset(initial, final, explicit_chunks(pref_chunks, shape)) |
| 232 | |
| 233 | @pytest.mark.parametrize( |
| 234 | "shape,pref_chunks,req_chunks", |
nothing calls this directly
no test coverage detected