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

Create model cleanup utilities #1164

Open
4 of 6 tasks
JoerivanEngelen opened this issue Aug 20, 2024 · 1 comment
Open
4 of 6 tasks

Create model cleanup utilities #1164

JoerivanEngelen opened this issue Aug 20, 2024 · 1 comment
Assignees

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Aug 20, 2024

With the introduction of model validation, users now have some good feedback of what is wrong to their model, for example a model that I recently imported:

E           imod.schemata.ValidationError:
E           Simulation validation status:
E               * imported_model model:
E                       * riv-2riv package:
E                               * stage:
E                                       * not all values comply with criterion: >= bottom_elevation
E                       * riv-3riv package:
E                               * stage:
E                                       * not all values comply with criterion: >= bottom_elevation
E                       * riv-5riv package:
E                               * stage:
E                                       * not all values comply with criterion: >= bottom_elevation
E                               * conductance:
E                                       * nodata is not aligned with stage
E                               * bottom_elevation:
E                                       * nodata is not aligned with stage
E                               not all values comply with criterion: >= bottom
E                       * riv-5drn package:
E                               * conductance:
E                                       * nodata is not aligned with elevation

However there is not so much guidance on how to fix things. To help them, I think we could create some cleanup utilities, which need to be very well documented on how they clean up data. Users then still need to make the calls to the functions themselves, so that they are aware what they are doing.

Requirements

  • Create a namespace, like imod.cleanup for these utilities, becomes part of public API
  • Extend ValidationError messages with hints to the appropriate functions to call
  • Well documented cleanup utilities
  • Add utilities for:
    • Masking all cells in inactive model domain. mask_all_models basically does this.
    • BC: Aligning nodata for a boundary condition
    • RIV: Setting stage above bottom_elevation
    • RIV/DRN: Setting stage/elevation equal to model bottom
    • More?
  • Add example showcasing these utilities
  • Add cleanup utility wells #1187
@JoerivanEngelen JoerivanEngelen added this to the v1.0 release milestone Aug 20, 2024
@JoerivanEngelen JoerivanEngelen self-assigned this Aug 23, 2024
JoerivanEngelen added a commit that referenced this issue Sep 3, 2024
Fixes #1164


# Description
This implements the following cleanup utilities for the robin boundary
conditions, namely the DRN, GHB, and RIV.

- Cleanup helper functions, which are part of the public API (so that
people could also use them outside MODFLOW 6)
- Cleanup methods to the River, GeneralHeadBoundary, Drain package for
convenience. These call the corresponding helper function. Save the user
the hassle of manually finding the right arguments to clean up grids.
- Add a utility method: Call function on grids, which separates grid
variables from settings, calls a function on them, and then merges these
dicts again.
- Converted the fixtures in ``test_mf6_riv`` to regular functions, as
they were used as such anyway. Without this, RivDisCases could not be
used outside the ``test_mf6_riv`` module, now it can be imported.

# Checklist
<!---
Before requesting review, please go through this 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
@JoerivanEngelen
Copy link
Contributor Author

The first steps are introduced in #1172, wells and other cleanup utilities (NPF?) are still to be added. As for the validation messages and the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📝Refined
Development

No branches or pull requests

1 participant