Improve lake gwt#562
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request extends lake_from_gdf to better support the MF6 Lake Transport (LKT/GWT) workflow by allowing users to provide concentration inputs for lake-related fluxes (analogous to how fluxes are provided for the LAK/GWF model).
Changes:
- Adds support for GWT-specific lake setting columns (e.g.,
GWT_CONCENTRATION,GWT_RUNOFF,GWT_EXT-INFLOW) and writes them intolakeperioddata. - Improves outlet handling by recognizing
lakeout = "-1"(string) as a sentinel meaning “remove from model”. - Generalizes stress-period value resolution so settings can be taken from the dataset (when present) or treated as literal values.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lakeout = _get_and_check_single_value(lake_gdf, "lakeout") | ||
| if isinstance(lakeout, str): | ||
| if isinstance(lakeout, str) and lakeout == "-1": | ||
| # an integer -1 could have been converted to a string after saving gdf to disk | ||
| lakeout = int(lakeout) | ||
| elif isinstance(lakeout, str): | ||
| # when lakeout is a string, it represents the boundname | ||
| # we need to find the lakeno that belongs to this boundname | ||
| boundnameout = lakeout |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| and not lake_gdf["lakeout"].eq("").all() | ||
| ): | ||
| lakeout = _get_and_check_single_value(lake_gdf, "lakeout") | ||
| if isinstance(lakeout, str): |
There was a problem hiding this comment.
Shouldn't this logic be part of _get_and_check_single_value()?
There was a problem hiding this comment.
Maybe it is way easier and robust to just expect boundnames, and to be strings? I don't like this behavior of using a single argument for either indices or names. The indices seem fragile anyway, when adding a feature, suddenly the numbering has to be checked
This PR improves the support for a GroundWater Transport (GWT) model in the Lake (LAK) package. The user can now supply the concentration of the fluxes in and out of the lake, in the same way he can supply the fluxes for the GroundWater Flow (GWF) model.