Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion flopy/mf6/data/mfdatalist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,10 @@ def data_type(self):
def dtype(self):
data = self.get_data()
if len(data) > 0:
return data[0].dtype
if 0 in data:
return data[0].dtype
else:
return next(iter(data.values())).dtype
else:
return None

Expand Down
14 changes: 12 additions & 2 deletions flopy/mf6/data/mfstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,11 @@ def set_value(self, line, common):
self.name_list.append(self.name)
if len(self.name) >= 6 and self.name[0:6] == "cellid":
self.is_cellid = True
if self.name and self.name[0:2] == "id":
if (
self.name
and self.name[0:2] == "id"
and self.type == DatumType.string
):
self.possible_cellid = True
self.python_name = self.name.replace("-", "_").lower()
# don't allow name to be a python keyword
Expand Down Expand Up @@ -961,6 +965,12 @@ def set_value(self, line, common):
)
self.type_string = type_line[0].lower()
self.type = self._str_to_enum_type(type_line[0])
if (
self.name
and self.name[0:2] == "id"
and self.type == DatumType.string
):
self.possible_cellid = True
if (
self.type == DatumType.recarray
or self.type == DatumType.record
Expand Down Expand Up @@ -1261,7 +1271,7 @@ def _str_to_enum_type(self, type_string):

def get_rec_type(self):
item_type = self.type_obj
if item_type == str or self.is_cellid:
if item_type == str or self.is_cellid or self.possible_cellid:
return object
return item_type

Expand Down