Skip to content

Commit 6c76559

Browse files
mjrenomjreno
authored andcommitted
add try/except
1 parent e92e16f commit 6c76559

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

autotest/test_mf6.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
ModflowGwfsto,
4040
ModflowGwfuzf,
4141
ModflowGwfwel,
42-
ModflowGwfwelg,
4342
ModflowGwtadv,
4443
ModflowGwtdis,
4544
ModflowGwtic,
@@ -1963,8 +1962,17 @@ def test_array(function_tmpdir):
19631962

19641963

19651964
@requires_exe("mf6")
1966-
@pytest.mark.slow
19671965
def test_grid_array(function_tmpdir):
1966+
try:
1967+
from flopy.mf6 import (
1968+
ModflowGwfchdg,
1969+
ModflowGwfdrng,
1970+
ModflowGwfghbg,
1971+
ModflowGwfrivg,
1972+
ModflowGwfwelg,
1973+
)
1974+
except ImportError:
1975+
return
19681976
# get_data
19691977
# empty data in period block vs data repeating
19701978
# array
@@ -2388,14 +2396,25 @@ def test_grid_array(function_tmpdir):
23882396

23892397
# TODO
23902398
wel_q_array = wel.q.array
2399+
assert np.all(wel_q_array[0][0] == 0.0)
23912400
assert wel_q_array[1][0][0, 0, 0] == 0.25
23922401
assert wel_q_array[2][0][0, 0, 0] == 0.1
2393-
# assert wel_array[3][0][1] == 0.1
2402+
assert wel_q_array[3][0][0, 0, 0] == 0.1
23942403
welg_q_per = wel.q.get_data()
23952404
assert welg_q_per[0] is None
23962405
assert welg_q_per[1][0, 0, 0] == 0.25
23972406
assert welg_q_per[2][0, 0, 0] == 0.1
2398-
# assert welg_q_per[3][0, 0, 0] == 0.1
2407+
assert welg_q_per[3] is None
2408+
wel_aux_array = wel.aux.array
2409+
assert np.all(wel_aux_array[0][0] == 0.0)
2410+
assert wel_aux_array[1][0][0, 0, 0] == 0.0
2411+
assert wel_aux_array[2][0][0, 0, 0] == 0.0
2412+
assert wel_aux_array[3][0][0, 0, 0] == 0.0
2413+
welg_aux_per = wel.aux.get_data()
2414+
assert welg_aux_per[0] is None
2415+
assert welg_aux_per[1][0][0, 0, 0] == 0.0
2416+
assert welg_aux_per[2][0][0, 0, 0] == 0.0
2417+
assert welg_aux_per[3] is None
23992418

24002419
welg_q_per1 = wel.q.get_data(1)
24012420
# print(wel.q.array)

0 commit comments

Comments
 (0)