(self, tmpdir)
| 267 | original_dt.to_netcdf(filepath, encoding=enc, engine=self.engine) |
| 268 | |
| 269 | def test_write_subgroup(self, tmpdir) -> None: |
| 270 | original_dt = DataTree.from_dict( |
| 271 | { |
| 272 | "/": xr.Dataset(coords={"x": [1, 2, 3]}), |
| 273 | "/child": xr.Dataset({"foo": ("x", [4, 5, 6])}), |
| 274 | } |
| 275 | ).children["child"] |
| 276 | |
| 277 | expected_dt = original_dt.copy() |
| 278 | expected_dt.name = None |
| 279 | |
| 280 | filepath = tmpdir / "test.zarr" |
| 281 | original_dt.to_netcdf(filepath, engine=self.engine) |
| 282 | |
| 283 | with open_datatree(filepath, engine=self.engine) as roundtrip_dt: |
| 284 | assert_equal(original_dt, roundtrip_dt) |
| 285 | assert_identical(expected_dt, roundtrip_dt) |
| 286 | |
| 287 | @requires_netCDF4 |
| 288 | def test_no_redundant_dimensions(self, tmpdir) -> None: |
nothing calls this directly
no test coverage detected