Deltares / xugrid

Xarray and unstructured grids
https://deltares.github.io/xugrid/
MIT License
53 stars 8 forks source link

Avoid Futurewarning for `dim_size = ds.dims[dim]` #211

Closed veenstrajelmer closed 5 months ago

veenstrajelmer commented 5 months ago

Xarray 2024.1.1 gives a futurewarning upon: dim_size = ds.dims[dim]

[...]\site-packages\xugrid\ugrid\conventions.py:274: 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`.
  dim_size = ds.dims[dim]