From 14a842a7e3d68d3b5d233cea31c74e9a4b307c46 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Fri, 7 May 2021 10:07:49 +1200 Subject: [PATCH] fix(numpy): aliases of builtin types is deprecated --- flopy/plot/crosssection.py | 12 ++++++------ flopy/plot/map.py | 4 ++-- flopy/utils/rasters.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flopy/plot/crosssection.py b/flopy/plot/crosssection.py index 57371f7e8d..13ee99a207 100644 --- a/flopy/plot/crosssection.py +++ b/flopy/plot/crosssection.py @@ -631,7 +631,7 @@ def plot_inactive(self, ibound=None, color_noflow="black", **kwargs): else: ibound = self.mg.idomain - plotarray = np.zeros(ibound.shape, dtype=np.int) + plotarray = np.zeros(ibound.shape, dtype=int) idx1 = ibound == 0 plotarray[idx1] = 1 plotarray = np.ma.masked_equal(plotarray, 0) @@ -685,7 +685,7 @@ def plot_ibound( ibound = self.mg.idomain - plotarray = np.zeros(ibound.shape, dtype=np.int) + plotarray = np.zeros(ibound.shape, dtype=int) idx1 = ibound == 0 idx2 = ibound < 0 plotarray[idx1] = 1 @@ -823,11 +823,11 @@ def plot_bc( idx = mflist["node"] if len(self.mg.shape) != 3: - plotarray = np.zeros((self._nlay, self._ncpl), dtype=np.int) + plotarray = np.zeros((self._nlay, self._ncpl), dtype=int) plotarray[tuple(idx)] = 1 else: plotarray = np.zeros( - (self.mg.nlay, self.mg.nrow, self.mg.ncol), dtype=np.int + (self.mg.nlay, self.mg.nrow, self.mg.ncol), dtype=int ) plotarray[idx[0], idx[1], idx[2]] = 1 @@ -1155,7 +1155,7 @@ def plot_discharge( # thickness by setting laytyp to zeros if head is None or laytyp is None: head = np.zeros(botm.shape, np.float32) - laytyp = np.zeros((nlay,), dtype=np.int) + laytyp = np.zeros((nlay,), dtype=int) head[0, :, :] = top if nlay > 1: head[1:, :, :] = botm[:-1, :, :] @@ -1170,7 +1170,7 @@ def plot_discharge( ) if qz is None: - qz = np.zeros(qx.shape, dtype=np.float) + qz = np.zeros(qx.shape, dtype=float) qx = qx.ravel() qy = qy.ravel() diff --git a/flopy/plot/map.py b/flopy/plot/map.py index efe545d049..93f667755f 100644 --- a/flopy/plot/map.py +++ b/flopy/plot/map.py @@ -485,9 +485,9 @@ def plot_bc( nlay = self.mg.nlay - plotarray = np.zeros(self.mg.shape, dtype=np.int) + plotarray = np.zeros(self.mg.shape, dtype=int) if plotAll and len(self.mg.shape) > 1: - pa = np.zeros(self.mg.shape[1:], dtype=np.int) + pa = np.zeros(self.mg.shape[1:], dtype=int) pa[tuple(idx[1:])] = 1 for k in range(nlay): plotarray[k] = pa.copy() diff --git a/flopy/utils/rasters.py b/flopy/utils/rasters.py index 6eb8150bde..ba4c739e0f 100644 --- a/flopy/utils/rasters.py +++ b/flopy/utils/rasters.py @@ -57,7 +57,7 @@ class Raster: FLOAT64 = (np.float64,) INT8 = (np.int8,) INT16 = (np.int16,) - INT32 = (int, np.int, np.int32, np.uint32) + INT32 = (int, np.int32, np.uint32) INT64 = (np.int64,) def __init__(