Skip to content

Commit

Permalink
fix(MFFileAccessArray): read_text_data_from_file modified for non-lay…
Browse files Browse the repository at this point in the history
…ered (#2183)

* fix(MFFileAccessArray): read_text_data_from_file modified to work with non-layered input

* minor comment fix
  • Loading branch information
langevin-usgs authored May 6, 2024
1 parent 4968753 commit 344579b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions flopy/mf6/data/mfdatastorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,7 @@ def external_to_internal(
self._data_type,
self.get_data_dimensions(layer),
layer,
self.layered,
read_file,
)[0]
if apply_mult and self.layer_storage[layer].factor is not None:
Expand Down Expand Up @@ -2470,6 +2471,7 @@ def _build_full_data(self, apply_multiplier=False):
np_data_type,
self.get_data_dimensions(layer),
layer,
self.layered,
read_file,
)[0]
* mult
Expand Down
10 changes: 7 additions & 3 deletions flopy/mf6/data/mffileaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,17 @@ def read_text_data_from_file(
data_type,
data_dim,
layer,
layered,
fname=None,
fd=None,
data_item=None,
):
# determine line size
line_size = None
if isinstance(data_dim, list):
line_size = data_dim[-1]
if layered:
# if the array is layered (meaning a control record for
# each layer), then limit line size to number of columns
if isinstance(data_dim, list):
line_size = data_dim[-1]
# load variable data from file
current_size = 0
if layer is None:
Expand Down Expand Up @@ -894,6 +897,7 @@ def _load_layer(
data_type,
storage.get_data_dimensions(layer),
layer,
storage.layered,
fd=file_handle,
)
except Exception as ex:
Expand Down

0 comments on commit 344579b

Please sign in to comment.