Case when an attribute of type list differs across the multiple files
()
| 5566 | @requires_netCDF4 |
| 5567 | @requires_dask |
| 5568 | def test_open_mfdataset_list_attr() -> None: |
| 5569 | """ |
| 5570 | Case when an attribute of type list differs across the multiple files |
| 5571 | """ |
| 5572 | with create_tmp_files(2) as nfiles: |
| 5573 | for i in range(2): |
| 5574 | with nc4.Dataset(nfiles[i], "w") as f: |
| 5575 | f.createDimension("x", 3) |
| 5576 | vlvar = f.createVariable("test_var", np.int32, ("x")) |
| 5577 | # here create an attribute as a list |
| 5578 | vlvar.test_attr = [f"string a {i}", f"string b {i}"] |
| 5579 | vlvar[:] = np.arange(3) |
| 5580 | |
| 5581 | with open_dataset(nfiles[0]) as ds1: |
| 5582 | with open_dataset(nfiles[1]) as ds2: |
| 5583 | original = xr.concat([ds1, ds2], dim="x") |
| 5584 | with xr.open_mfdataset( |
| 5585 | [nfiles[0], nfiles[1]], combine="nested", concat_dim="x" |
| 5586 | ) as actual: |
| 5587 | assert_identical(actual, original) |
| 5588 | |
| 5589 | |
| 5590 | @requires_scipy_or_netCDF4 |
nothing calls this directly
no test coverage detected
searching dependent graphs…