From 621ed4900e1f14a706b1bf2a6c32ba3a34304273 Mon Sep 17 00:00:00 2001 From: danielfromearth Date: Tue, 19 Nov 2024 12:26:28 -0500 Subject: [PATCH] use alias dataset.sizes because of the xarray FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes` --- concatenator/dataset_and_group_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concatenator/dataset_and_group_handling.py b/concatenator/dataset_and_group_handling.py index d387137..281c09c 100644 --- a/concatenator/dataset_and_group_handling.py +++ b/concatenator/dataset_and_group_handling.py @@ -195,7 +195,7 @@ def regroup_flattened_dataset( for dim_name, _ in dataset.dims.items(): new_dim_name = str(dim_name).rsplit(concatenator.group_delim, 1)[-1] dim_group = _get_nested_group(base_dataset, str(dim_name)) - dim_group.createDimension(new_dim_name, dataset.dims[dim_name]) + dim_group.createDimension(new_dim_name, dataset.sizes[dim_name]) # dst.createDimension( # name, (len(dimension) if not dimension.isunlimited() else None))