Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(binary file): Was writing binary file information twice to external files (#1925) #1928

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flopy/mf6/data/mffileaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def write_binary_file(
if data.size == modelgrid.nnodes:
write_multi_layer = False
if write_multi_layer:
# write data from each layer with a separate header
for layer, value in enumerate(data):
self._write_layer(
fd,
Expand All @@ -228,6 +229,7 @@ def write_binary_file(
layer + 1,
)
else:
# write data with a single header
self._write_layer(
fd,
data,
Expand All @@ -238,7 +240,6 @@ def write_binary_file(
text,
fname,
)
data.tofile(fd)
fd.close()

def _write_layer(
Expand Down