-
Notifications
You must be signed in to change notification settings - Fork 3
Issue #1437 fix recharge from imod5 cap data 2d #1448
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
Issue #1437 fix recharge from imod5 cap data 2d #1448
Conversation
imod/tests/test_mf6/test_mf6_rch.py
Outdated
assert np.isnan(rate[:, -1]).all() | ||
assert np.isnan(rate[0, :]).all() | ||
assert np.isnan(rate[-1, :]).all() | ||
assert np.isnan(rate[100, 100]).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this one already tested by rate[-1, :] and rate[:, -1]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the grid is size 184, 184. So this is a central cell where areas have been set in such a way the cell needs to be deactivated. I set this more explicit now in the test by computing a midpoint cell and assigning values to that.
assert np.isnan(rate[0, 0, :]).all() | ||
assert np.isnan(rate[0, -1, :]).all() | ||
assert np.isnan(rate[:, 100, 100]).all() | ||
assert np.isnan(rate[:, 0]).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happend to the extra dimension? Are we using a disv grid now? Or did you drop a coordinate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did drop the dimension, only the coordinate label is preserved. That reminds me: probably good to test for that as well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just updated the test you had two comments on, this should avoid any further confusion.
assert np.isnan(rate[0, 0, :]).all() | ||
assert np.isnan(rate[0, -1, :]).all() | ||
assert np.isnan(rate[:, 100, 100]).all() | ||
assert np.isnan(rate[:, 0]).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did drop the dimension, only the coordinate label is preserved. That reminds me: probably good to test for that as well!
imod/tests/test_mf6/test_mf6_rch.py
Outdated
assert np.isnan(rate[:, -1]).all() | ||
assert np.isnan(rate[0, :]).all() | ||
assert np.isnan(rate[-1, :]).all() | ||
assert np.isnan(rate[100, 100]).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the grid is size 184, 184. So this is a central cell where areas have been set in such a way the cell needs to be deactivated. I set this more explicit now in the test by computing a midpoint cell and assigning values to that.
|
Fixes #1437
Description
primod
expects a 2D rate array or single layer array for the dummy MODFLOW6 package, as otherwise thesqueeze("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
Issue #nr
, e.g.Issue #737