Skip to content

Commit

Permalink
fix(data storage): added numpy type check for consistent integer and …
Browse files Browse the repository at this point in the history
…float sizes (32-bit vs 64-bit) (modflowpy#2062)

* fix(data storage): added numpy type check for consistent integer and float sizes

* fix(numpy type check)
  • Loading branch information
scottrp authored Jan 17, 2024
1 parent 6899553 commit 97da396
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions flopy/mf6/data/mfdatastorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,16 @@ def store_internal(
message,
self._simulation_data.debug,
)
data_type = self.data_dimensions.structure.get_datum_type(True)
dt = self.layer_storage[layer].internal_data.dtype
if dt != data_type:
self.layer_storage[
layer
].internal_data = self.layer_storage[
layer
].internal_data.astype(
data_type
)
if not preserve_record:
self.layer_storage[layer].factor = multiplier
self.layer_storage[layer].iprn = print_format
Expand Down

0 comments on commit 97da396

Please sign in to comment.