Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] - Well.cleanup doesn't work with unstructured grids #1539

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

Closed
JoerivanEngelen opened this issue May 26, 2025 · 1 comment · Fixed by #1540
Closed

[Bug] - Well.cleanup doesn't work with unstructured grids #1539

JoerivanEngelen opened this issue May 26, 2025 · 1 comment · Fixed by #1540
Assignees
Labels
bug Something isn't working

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented May 26, 2025

Bug description
@jdelsman ran into this. When calling Well.cleanup with an unstructured grid, an error is raised in the call xy_top = imod.select.points_values(top, x=x, y=y, out_of_bounds="ignore"):

ValueError: DataArray has no coordinate "x"

@JoerivanEngelen
Copy link
Contributor Author

Turned out this was luckily not caused by the call to .isel, which would render xugrid as a useless package, but it was caused by a call to .dataset.data_vars. This returns a mapping of variable names to xr.DataArrays, instead xu.UgridDataArrays.

JoerivanEngelen added a commit that referenced this issue May 27, 2025
Fixes #1539 

# Description
Changes the following:

- Fix bug where UgridDataArrays where silently converted to regular
DataArrays (caused by the call to ``.data_vars``).
- Add unstructured grid test case to well tests where easily applicable.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example
@github-project-automation github-project-automation bot moved this from 📯 New to ✅ Done in iMOD Suite May 27, 2025
@JoerivanEngelen JoerivanEngelen self-assigned this May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant