From 3e992582885e2c3c1a24a7c91bda4e75d40d94a5 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Tue, 6 May 2025 12:27:33 -0700 Subject: [PATCH] fix: update numpy array comparisons to use isin Signed-off-by: Emmanuel Ferdman --- flopy/utils/zonbud.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flopy/utils/zonbud.py b/flopy/utils/zonbud.py index 871046594f..e0eff84a16 100644 --- a/flopy/utils/zonbud.py +++ b/flopy/utils/zonbud.py @@ -1010,12 +1010,12 @@ def _compute_mass_balance(self, kstpkper, totim): rowidx = np.asarray( (self._budget["time_step"] == kstpkper[0]) & (self._budget["stress_period"] == kstpkper[1]) - & np.in1d(self._budget["name"], innames) + & np.isin(self._budget["name"], innames) ).nonzero() elif totim is not None: rowidx = np.asarray( (self._budget["totim"] == totim) - & np.in1d(self._budget["name"], innames) + & np.isin(self._budget["name"], innames) ).nonzero() a = _numpyvoid2numeric(self._budget[list(self._zonenamedict.values())][rowidx]) intot = np.array(a.sum(axis=0)) @@ -1028,12 +1028,12 @@ def _compute_mass_balance(self, kstpkper, totim): rowidx = np.asarray( (self._budget["time_step"] == kstpkper[0]) & (self._budget["stress_period"] == kstpkper[1]) - & np.in1d(self._budget["name"], outnames) + & np.isin(self._budget["name"], outnames) ).nonzero() elif totim is not None: rowidx = np.asarray( (self._budget["totim"] == totim) - & np.in1d(self._budget["name"], outnames) + & np.isin(self._budget["name"], outnames) ).nonzero() a = _numpyvoid2numeric(self._budget[list(self._zonenamedict.values())][rowidx]) outot = np.array(a.sum(axis=0))