From 6c407c0f32f63d039d80a7b802837defe5074ad7 Mon Sep 17 00:00:00 2001 From: Joshua Larsen Date: Fri, 16 Aug 2019 07:37:55 -0700 Subject: [PATCH] Fix(unstructured grid capabilities): fix array masking for CVFD grids and allow ncpl to be specified as a list (#631) * Fix(UnstructuredGrid): fix for ncpl provided as a list or numpy array * Fix(plot_array): fix for CVFD masked_values when plotting arrays --- flopy/discretization/unstructuredgrid.py | 2 +- flopy/plot/map.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flopy/discretization/unstructuredgrid.py b/flopy/discretization/unstructuredgrid.py index a3ae57e0d7..fbb4d6f0b0 100644 --- a/flopy/discretization/unstructuredgrid.py +++ b/flopy/discretization/unstructuredgrid.py @@ -51,7 +51,7 @@ def __init__(self, vertices=None, iverts=None, xcenters=None, ycenters=None, else: msg = ('Length of iverts must equal ncpl.sum ' '({} {})'.format(len(iverts), ncpl)) - assert len(iverts) == ncpl.sum(), msg + assert len(iverts) == np.sum(ncpl), msg assert np.array(self.xcellcenters).shape[0] == self.ncpl assert np.array(self.ycellcenters).shape[0] == self.ncpl diff --git a/flopy/plot/map.py b/flopy/plot/map.py index 365b4b9e5b..dd4b4668bb 100644 --- a/flopy/plot/map.py +++ b/flopy/plot/map.py @@ -170,7 +170,7 @@ def plot_array(self, a, masked_values=None, **kwargs): else: quadmesh = plotutil.plot_cvfd(self.mg._vertices, self.mg._iverts, - a=a, ax=ax) + a=plotarray, ax=ax) # set max and min if 'vmin' in kwargs: