Skip to content
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 #921 Update uzf #867

Merged
merged 23 commits into from May 13, 2024
Merged

Issue #921 Update uzf #867

merged 23 commits into from May 13, 2024

Conversation

HendrikKok
Copy link
Contributor

@HendrikKok HendrikKok commented Feb 23, 2024

Fixes #921

Description

This branch contains all fixes that I needed to work with the UZF-package. The branch contains:

1- Changes to UZF- package methods
2- Changes to the open_cbc methods to deal with cbc-files of advanced packages
3- Changes to the UZF-tests + all tests that deal with budget output

There are some breaking changes in budget output names:
1- The new names support now support output of multiple equal boundary packages, since the package name is used.
2- The budget arrays now contain nans if a package is not active, since zero is a valid budget output.

Checklist

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example

@@ -261,6 +269,7 @@ def read_imeth6_budgets_dense(
size: int,
shape: tuple,
return_variable: str,
return_id: np.ndarray | None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call these indices, you're not returning any of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

imod/mf6/out/cbc.py Show resolved Hide resolved
imod/mf6/out/__init__.py Outdated Show resolved Hide resolved
imod/mf6/uzf.py Outdated Show resolved Hide resolved
@HendrikKok
Copy link
Contributor Author

This branch contains all fixes that I needed to work with the UZF-package. The branch contains:

1- Changes to UZF- package methods
2- Changes to the open_cbc methods to deal with cbc-files of advanced packages
3- Changes to the UZF-tests + all tests that deal with budget output

There are some breaking changes in budget output names:
1- The new names support now support output of multiple equal boundary packages, since the package name is used.
2- The budget arrays now contain nans if a package is not active, since zero is a valid budget output.

@JoerivanEngelen JoerivanEngelen marked this pull request as ready for review March 8, 2024 13:37
Copy link
Contributor

@JoerivanEngelen JoerivanEngelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR makes some necessary changes to iMOD Python, but I have some comments.

Furthermore, could you update the changelog with all your changes? Something like:

Added
-------
- Support reading fluxes in the CBC file for boundary packages that contain multiple fluxes (e.g. UZF)

Changed
----------
- Package type added to name of CBC output in fluxnames. E.g. a River package named ``primary-sys`` will get fluxname ``riv_primary-sys``.
- Fluxes in inactive cells now have value ``np.nan`` instead of 0.0

UPDATE: I also miss a test where the new UZF cbc fluxes are read. I think that can be added to the test in imod/tests/test_mf6/test_mf6_uzf_model.py?

@@ -261,6 +269,7 @@ def read_imeth6_budgets_dense(
size: int,
shape: tuple,
return_variable: str,
return_id: np.ndarray | None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

imod/mf6/out/cbc.py Show resolved Hide resolved
imod/mf6/out/common.py Outdated Show resolved Hide resolved
imod/mf6/out/dis.py Show resolved Hide resolved
imod/mf6/simulation.py Show resolved Hide resolved
imod/mf6/uzf.py Show resolved Hide resolved
imod/mf6/uzf.py Outdated Show resolved Hide resolved
imod/mf6/uzf.py Outdated Show resolved Hide resolved
imod/mf6/uzf.py Outdated Show resolved Hide resolved
@JoerivanEngelen JoerivanEngelen changed the title Update uzf Issue #921 Update uzf Mar 18, 2024
Copy link
Contributor

@JoerivanEngelen JoerivanEngelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I got one minor comment, which you can fix while resolving the changelog merge conflict ;-)

Comment on lines 27 to 30
- Budget arrays now contain np.nan for cells where budget variables are not defined.
Based on new budget output a disquisition between active cells but zero flow and
inactive cells can be made. Changes affect:
:func:`imod.mf6.open_cbc`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick: Best to put function at start of message. Something like:

Suggested change
- Budget arrays now contain np.nan for cells where budget variables are not defined.
Based on new budget output a disquisition between active cells but zero flow and
inactive cells can be made. Changes affect:
:func:`imod.mf6.open_cbc`
- :func:`imod.mf6.open_cbc` now returns arrays which contain np.nan for cells where budget variables are not defined.
Based on new budget output a disquisition between active cells but zero flow and
inactive cells can be made.

named ``primary-sys`` will get a budget name ``riv_primary-sys``. An UZF package
with name ``uzf-sys1`` will get a budget name ``uzf-gwrch_uzf-sys1`` for the
groundwater recharge budget from the UZF-CBC. Changes affect:
:func:`imod.mf6.open_cbc`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

@HendrikKok HendrikKok added this pull request to the merge queue May 13, 2024
@HendrikKok HendrikKok removed this pull request from the merge queue due to a manual request May 13, 2024
@HendrikKok HendrikKok added this pull request to the merge queue May 13, 2024
Merged via the queue into master with commit 6696e33 May 13, 2024
7 checks passed
@HendrikKok HendrikKok deleted the update_uzf branch May 13, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support reading multiple fluxes for one package
3 participants