14
14
def test_structured_model_splitter (function_tmpdir ):
15
15
sim_path = get_example_data_path () / "mf6-freyberg"
16
16
17
+ from pathlib import Path
18
+
19
+ function_tmpdir = Path ("./temp" )
20
+
21
+ split_path = function_tmpdir / "split_model"
22
+
17
23
sim = MFSimulation .load (sim_ws = sim_path )
18
24
sim .set_sim_path (function_tmpdir )
19
25
sim .write_simulation ()
@@ -32,7 +38,7 @@ def test_structured_model_splitter(function_tmpdir):
32
38
mfsplit = Mf6Splitter (sim )
33
39
new_sim = mfsplit .split_model (array )
34
40
35
- new_sim .set_sim_path (function_tmpdir / "split_model" )
41
+ new_sim .set_sim_path (split_path )
36
42
new_sim .write_simulation ()
37
43
new_sim .run_simulation ()
38
44
@@ -49,6 +55,21 @@ def test_structured_model_splitter(function_tmpdir):
49
55
err_msg = "Heads from original and split models do not match"
50
56
np .testing .assert_allclose (new_heads , original_heads , err_msg = err_msg )
51
57
58
+ # test that line length is ncol for each model....
59
+ ll_dict = {
60
+ split_path / "freyberg_001.npf" : ml0 .dis .ncol .get_data (),
61
+ split_path / "freyberg_100.npf" : ml1 .dis .ncol .get_data (),
62
+ }
63
+ for f , ncol in ll_dict .items ():
64
+ with open (f ) as foo :
65
+ while "internal" not in foo .readline ().lower ():
66
+ continue
67
+
68
+ line = foo .readline ().strip ()
69
+ tmp = line .split ()
70
+ if len (tmp ) != ncol :
71
+ raise AssertionError ("Array column length is not equal to ncol" )
72
+
52
73
53
74
@requires_exe ("mf6" )
54
75
def test_vertex_model_splitter (function_tmpdir ):
0 commit comments