Coverage for fixtures\flow_basic_unstructured_fixture.py: 100%
27 statements
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
1import numpy as np
2import pytest
3import xarray as xr
4import xugrid as xu
6import imod
9@pytest.fixture(scope="function")
10def basic_unstructured_dis(basic_dis):
11 idomain, top, bottom = basic_dis
12 idomain_ugrid = xu.UgridDataArray.from_structured(idomain)
13 top_mf6 = top.sel(layer=1) # Top for modlfow 6 shouldn't contain layer dim
15 return idomain_ugrid, top_mf6, bottom
18@pytest.fixture(scope="function")
19def basic_disv__topsystem(basic_dis__topsystem):
20 ibound, top, bottom = basic_dis__topsystem
21 idomain_ugrid = xu.UgridDataArray.from_structured(ibound)
23 return idomain_ugrid, top, bottom
26@pytest.fixture(scope="module")
27def circle_dis():
28 """Basic model discretization"""
30 grid_triangles = imod.data.circle()
31 grid = grid_triangles.tesselate_centroidal_voronoi()
33 nface = grid.n_face
34 nlayer = 15
36 layer = np.arange(nlayer, dtype=int) + 1
38 idomain = xu.UgridDataArray(
39 xr.DataArray(
40 np.ones((nlayer, nface), dtype=np.int32),
41 coords={"layer": layer},
42 dims=["layer", grid.face_dimension],
43 ),
44 grid=grid,
45 )
46 top = 0.0
47 bottom = xr.DataArray(top - (layer * 10.0), dims=["layer"])
49 return idomain, top, bottom