Skip to content

Commit

Permalink
fix mesh_2d_from_rasterdataset for rasterdatasets with multidimension… (
Browse files Browse the repository at this point in the history
  • Loading branch information
roeldegoede authored Mar 18, 2024
1 parent f59f7a5 commit 9b7f394
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion hydromt/workflows/mesh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation for mesh based workflows."""

import logging
from typing import Dict, List, Optional, Union

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ s3fs = "*"
[feature.extra.dependencies]
matplotlib = "*"
pyet = "*"
xugrid = ">=0.6.5"
xugrid = ">=0.9.0"

[feature.dev.dependencies]
black = "*"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b7f394

Please sign in to comment.