From 27e4191875a59c09a2339a481d84f1052c89f0f3 Mon Sep 17 00:00:00 2001 From: spaulins-usgs Date: Mon, 29 Jun 2020 14:53:54 -0700 Subject: [PATCH] fix(idomain): data checks now treat all positive idomain values as active (#929) --- autotest/t505_test.py | 2 +- flopy/mf6/data/mfdatalist.py | 2 +- flopy/utils/check.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/autotest/t505_test.py b/autotest/t505_test.py index e3114e275..8f3be94b5 100644 --- a/autotest/t505_test.py +++ b/autotest/t505_test.py @@ -378,7 +378,7 @@ def np002(): botm = {'filename': botm_file, 'factor': 1.0} dis_package = ModflowGwfdis(model, length_units='FEET', nlay=1, nrow=1, ncol=10, delr=500.0, delc=500.0, - top=top, botm=botm, + top=top, botm=botm, idomain=2, filename='{}.dis'.format(model_name)) ic_vals = [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0] diff --git a/flopy/mf6/data/mfdatalist.py b/flopy/mf6/data/mfdatalist.py index c0f11ba4e..a39a39c6b 100644 --- a/flopy/mf6/data/mfdatalist.py +++ b/flopy/mf6/data/mfdatalist.py @@ -366,7 +366,7 @@ def _check_valid_cellids(self): self._simulation_data.debug) idomain_val = idomain_val[cellid_part] # cellid should be at an active cell - if idomain_val != 1: + if idomain_val < 1: message = 'Cellid {} is outside of the ' \ 'active model grid' \ '.'.format(record[index]) diff --git a/flopy/utils/check.py b/flopy/utils/check.py index 47a08688e..96cbe4e9b 100644 --- a/flopy/utils/check.py +++ b/flopy/utils/check.py @@ -773,5 +773,4 @@ def get_active(self, include_cbd=False): if idomain is None: return np.ones(shape=mg.shape, dtype=bool) else: - id_active_zero = idomain - np.ones(shape=mg.shape, dtype=np.int32) - return np.invert(np.ma.make_mask(id_active_zero, shrink=False)) + return idomain > 0