diff --git a/docs/changelog.rst b/docs/changelog.rst index db57a3c72..65a332863 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -16,6 +16,7 @@ Changed Fixed ----- - Bug in `raster.transform` with lazy coordinates. (#801) +- Bug in `workflows.mesh.mesh2d_from_rasterdataset` with multi-dimensional coordinates. (#843) v0.9.4 (2024-02-26) diff --git a/hydromt/workflows/mesh.py b/hydromt/workflows/mesh.py index dd67c559f..0b52ee210 100644 --- a/hydromt/workflows/mesh.py +++ b/hydromt/workflows/mesh.py @@ -1,4 +1,5 @@ """Implementation for mesh based workflows.""" + import logging from typing import Dict, List, Optional, Union @@ -261,7 +262,7 @@ def mesh2d_from_rasterdataset( # Get one variable name in ds to simplify to da var = [v for v in ds.data_vars][0] uda = xu.UgridDataArray.from_structured( - ds[var].rename({ds.raster.x_dim: "x", ds.raster.y_dim: "y"}) + ds[var], x=ds.raster.xcoords.name, y=ds.raster.ycoords.name ) uda.ugrid.set_crs(ds.raster.crs) diff --git a/pixi.toml b/pixi.toml index 572b1eb40..1b8292e62 100644 --- a/pixi.toml +++ b/pixi.toml @@ -185,7 +185,7 @@ s3fs = "*" [feature.extra.dependencies] matplotlib = "*" pyet = "*" -xugrid = ">=0.6.5" +xugrid = ">=0.9.0" [feature.dev.dependencies] black = "*" diff --git a/pyproject.toml b/pyproject.toml index b254d315d..ed03f8a87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ io = [ extra = [ "matplotlib", # plotting; required for slippy tiles "pyet", # calc evapotraspiration, quite well used, used in all wflow models but domain specific - "xugrid>=0.6.5", # xarray wrapper for mesh processing + "xugrid>=0.9.0", # xarray wrapper for mesh processing ] dev = [ "black", # linting