-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'multiple_improvements' of https://github.com/gwmod/nlmod …
…into multiple_improvements
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import nlmod | ||
|
||
|
||
def test_prepare(): | ||
ds = nlmod.get_ds([0, 1000, 0, 2000]) | ||
ds = nlmod.gwt.prepare.set_default_transport_parameters( | ||
ds, transport_type="chloride" | ||
) |
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,37 @@ | ||
from shapely.geometry import LineString, Polygon | ||
import geopandas as gpd | ||
import flopy | ||
import nlmod | ||
import util | ||
|
||
|
||
def test_get_hfb_spd(): | ||
# this test also tests line2hfb | ||
ds = util.get_ds_vertex() | ||
ds = nlmod.time.set_ds_time(ds, "2023", time="2024") | ||
gwf = util.get_gwf(ds) | ||
|
||
coords = [(0, 1000), (1000, 0)] | ||
gdf = gpd.GeoDataFrame({"geometry": [LineString(coords)]}) | ||
|
||
spd = nlmod.gwf.horizontal_flow_barrier.get_hfb_spd(gwf, gdf, depth=5.0) | ||
hfb = flopy.mf6.ModflowGwfhfb(gwf, stress_period_data={0: spd}) | ||
|
||
# also test the plot method | ||
ax = gdf.plot() | ||
nlmod.gwf.horizontal_flow_barrier.plot_hfb(hfb, gwf, ax=ax) | ||
|
||
|
||
def test_polygon_to_hfb(): | ||
ds = util.get_ds_vertex() | ||
ds = nlmod.time.set_ds_time(ds, "2023", time="2024") | ||
gwf = util.get_gwf(ds) | ||
|
||
coords = [(135, 230), (568, 170), (778, 670), (260, 786)] | ||
gdf = gpd.GeoDataFrame({"geometry": [Polygon(coords)]}).reset_index() | ||
|
||
hfb = nlmod.gwf.horizontal_flow_barrier.polygon_to_hfb(gdf, ds, gwf=gwf) | ||
|
||
# also test the plot method | ||
ax = gdf.plot() | ||
nlmod.gwf.horizontal_flow_barrier.plot_hfb(hfb, gwf, ax=ax) |
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