Skip to content

Commit

Permalink
fix(DeprecationWarning): related to numpy (#1058)
Browse files Browse the repository at this point in the history
* Passing None into shape arguments as an alias for () is deprecated.
* tostring() is deprecated. Use tobytes() instead.
  • Loading branch information
mwtoews committed Feb 15, 2021
1 parent 943ace4 commit 39c0ecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion flopy/discretization/structuredgrid.py
Expand Up @@ -195,7 +195,7 @@ def __init__(
if laycbd is not None:
self.__laycbd = laycbd
else:
self.__laycbd = np.zeros(self.__nlay, dtype=int)
self.__laycbd = np.zeros(self.__nlay or (), dtype=int)

####################
# Properties
Expand Down
8 changes: 2 additions & 6 deletions flopy/utils/utils_def.py
Expand Up @@ -38,12 +38,8 @@ def set_float(self, precision):
return

def read_text(self, nchar=20):
textvalue = self._read_values(self.character, nchar).tostring()
if not isinstance(textvalue, str):
textvalue = textvalue.decode().strip()
else:
textvalue = textvalue.strip()
return textvalue
bytesvalue = self._read_values(self.character, nchar).tobytes()
return bytesvalue.decode().strip()

def read_integer(self):
return self._read_values(self.integer, 1)[0]
Expand Down

0 comments on commit 39c0ecb

Please sign in to comment.