-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixes #1311 # Description Adds the following: - ``imod.mf6.LayeredWell.from_imod5_cap_data``, to construct LayeredWells for MODLOW6 from the CAP package in iMOD5 Data. Throws an error if data is provided as point data (IPF, which is read as pandas DataFrame). This has rate 0.0, actual rates will be inserted by in the coupling scheme of iMOD Coupler. - ``imod.mf6.GroundwaterFlowModel.from_imod5_data`` adds Sprinkling well if CAP package present. This does not affect MODFLOW6 model if not coupled to MetaSWAP: The wells have rates 0.0, so will not affect the simulation results. - ``Sprinkling.from_imod5_data`` to construct a Sprinkling package from iMOD5 data. # 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
- Loading branch information
1 parent
8461d63
commit 68b5ef2
Showing
11 changed files
with
348 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import numpy as np | ||
import pandas as pd | ||
import pytest | ||
import xarray as xr | ||
|
||
from imod.typing import Imod5DataDict | ||
|
||
|
||
def zeros_grid(): | ||
x = [1.0, 2.0, 3.0] | ||
y = [3.0, 2.0, 1.0] | ||
dx = 1.0 | ||
dy = -1.0 | ||
|
||
coords = {"x": x, "y": y, "dx": dx, "dy": dy} | ||
shape = (len(y), len(x)) | ||
data = np.zeros(shape) | ||
|
||
return xr.DataArray(data, coords=coords, dims=("y", "x")) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def cap_data_sprinkling_grid() -> Imod5DataDict: | ||
type = zeros_grid() | ||
type[:, 1] = 1 | ||
type[:, 2] = 2 | ||
layer = xr.ones_like(type) | ||
layer[:, 1] = 2 | ||
|
||
cap_data = { | ||
"artificial_recharge": type, | ||
"artificial_recharge_layer": layer, | ||
"artificial_recharge_capacity": xr.DataArray(25.0), | ||
} | ||
|
||
return {"cap": cap_data} | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def cap_data_sprinkling_points() -> Imod5DataDict: | ||
type = zeros_grid() | ||
type[:, 1] = 3000 | ||
type[:, 2] = 4000 | ||
|
||
data = { | ||
"id": [3000, 4000], | ||
"layer": [2, 3], | ||
"capacity": [15.0, 30.0], | ||
"y": [1.0, 2.0], | ||
"x": [1.0, 2.0], | ||
} | ||
|
||
layer = pd.DataFrame(data=data) | ||
cap_data = { | ||
"artificial_recharge": type, | ||
"artificial_recharge_layer": layer, | ||
"artificial_recharge_capacity": xr.DataArray(25.0), | ||
} | ||
|
||
return {"cap": cap_data} |
Oops, something went wrong.