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

Skip to content

[Bug] - Recharge.from_imod5_cap_data creates a 3D array, but primod expects a 2D array. #1437

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 Feb 19, 2025 · 0 comments Β· Fixed by #1448
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@JoerivanEngelen
Copy link
Contributor

Found with @WouterSwierstra: Recharge.from_imod5_cap_data creates a 3D array, but primod expects a 2D array.

This problem stems from the fact that we don't test if our changes run into issues downstream in primod.

Workaround now is:

simulation = Modflow6Simulation.from_imod5_data(...)
simulation["imported_model"]["msw-rch"].dataset = simulation["imported_model"]["msw-rch"].dataset.sel(layer=1)
@JoerivanEngelen JoerivanEngelen added the bug Something isn't working label Feb 19, 2025
@github-project-automation github-project-automation bot moved this to πŸ“― New in iMOD Suite Feb 19, 2025
@JoerivanEngelen JoerivanEngelen moved this from πŸ“― New to 🀝 Accepted in iMOD Suite Feb 19, 2025
@JoerivanEngelen JoerivanEngelen self-assigned this Feb 21, 2025
@JoerivanEngelen JoerivanEngelen moved this from 🀝 Accepted to πŸ— In Progress in iMOD Suite Feb 21, 2025
@JoerivanEngelen JoerivanEngelen added this to the v1.0 release milestone Feb 21, 2025
@JoerivanEngelen JoerivanEngelen moved this from πŸ— In Progress to 🧐 In Review in iMOD Suite Feb 24, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 25, 2025
Fixes #1437 

# Description
``primod`` expects a 2D rate array or single layer array for the dummy
MODFLOW6 package, as otherwise the ``squeeze("layer")`` it does returns
an error. I think the safest for iMOD Python is to return a 2D array
with extra layer coordinate. I added some extra tests to test if this
RCH package could be clipped and regridded, as in most/all fixtures for
clipping/regridding I added packages with layer dimension. Luckily these
two extra tests turned out to be mostly for my own peace of mind, as
they ran without problems.

# 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 🧐 In Review to βœ… Done in iMOD Suite Feb 25, 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