|
3 | 3 | import flopy |
4 | 4 | import numpy as np |
5 | 5 | import pytest |
6 | | -from binary_util import write_budget, write_head |
| 6 | +from flopy.utils.binaryfile import CellBudgetFile, HeadFile |
7 | 7 | from framework import TestFramework |
8 | 8 |
|
9 | 9 | cases = ["dsp01a_fmi", "dsp01b_fmi"] |
@@ -120,9 +120,7 @@ def build_models(idx, test): |
120 | 120 |
|
121 | 121 | # create a heads file with head equal top |
122 | 122 | fname = os.path.join(ws, "myhead.hds") |
123 | | - with open(fname, "wb") as fbin: |
124 | | - for kstp in range(1): # nstp[0]): |
125 | | - write_head(fbin, top * np.ones((nrow, ncol)), kstp=kstp + 1) |
| 123 | + HeadFile.write(fname, {(1, 1): top * np.ones((nrow, ncol))}, precision="double") |
126 | 124 |
|
127 | 125 | # create a budget file with flows set to zero |
128 | 126 | nja = (ncol - 2) * 3 + 2 * 2 |
@@ -151,12 +149,14 @@ def build_models(idx, test): |
151 | 149 | sat = np.array([(i, i, 0.0, 1.0) for i in range(nlay * nrow * ncol)], dtype=dt) |
152 | 150 |
|
153 | 151 | fname = os.path.join(ws, "mybudget.bud") |
154 | | - with open(fname, "wb") as fbin: |
155 | | - for kstp in range(1): # nstp[0]): |
156 | | - write_budget(fbin, flowja, kstp=kstp + 1) |
157 | | - write_budget(fbin, spdis, text=" DATA-SPDIS", imeth=6, kstp=kstp + 1) |
158 | | - write_budget(fbin, sat, text=" DATA-SAT", imeth=6, kstp=kstp + 1) |
159 | | - fbin.close() |
| 152 | + budget_data = [ |
| 153 | + {"data": flowja, "text": " FLOW-JA-FACE", "imeth": 1, "kstp": 1, "kper": 1}, |
| 154 | + {"data": spdis, "text": " DATA-SPDIS", "imeth": 6, "kstp": 1, "kper": 1}, |
| 155 | + {"data": sat, "text": " DATA-SAT", "imeth": 6, "kstp": 1, "kper": 1}, |
| 156 | + ] |
| 157 | + CellBudgetFile.write( |
| 158 | + fname, budget_data, nlay=nlay, nrow=nrow, ncol=ncol, precision="double" |
| 159 | + ) |
160 | 160 |
|
161 | 161 | # flow model interface |
162 | 162 | packagedata = [ |
|
0 commit comments