Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Dataset.dims FutureWarning #190

Closed
veenstrajelmer opened this issue Dec 13, 2023 · 1 comment · Fixed by #254
Closed

Resolve Dataset.dims FutureWarning #190

veenstrajelmer opened this issue Dec 13, 2023 · 1 comment · Fixed by #254

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Dec 13, 2023

The below code gives a FutureWarning with xarray 2023.12.0:

import xugrid as xu
import dfm_tools as dfmt
file_nc = dfmt.data.fm_curvedbend_map(return_filepath=True)
uds = xu.open_dataset(file_nc)

"[...]\site-packages\xarray\core\utils.py:494: FutureWarning: The return type of Dataset.dimswill be changed to return a set of dimension names in future, in order to be more consistent withDataArray.dims. To access a mapping from dimension names to lengths, please use Dataset.sizes."

The used netcdf file is also available on opendap.

Also happens in:
C:\DATA\xugrid\xugrid\ugrid\partitioning.py:384: FutureWarning: The return type of Dataset.dimswill be changed to return a set of dimension names in future, in order to be more consistent withDataArray.dims. To access a mapping from dimension names to lengths, please use Dataset.sizes. chunks[dim] = (merged.dims[dim],)

@JoerivanEngelen
Copy link
Contributor

Relevant xarray issue: pydata/xarray#8496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants