From 4cca3bae6b88e935ee7707748a3e07c859924c99 Mon Sep 17 00:00:00 2001 From: Andrew Nolan <32367657+andrewdnolan@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:14:07 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Xylar Asay-Davis --- mosaic/descriptor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mosaic/descriptor.py b/mosaic/descriptor.py index 2be07be..84ed79b 100644 --- a/mosaic/descriptor.py +++ b/mosaic/descriptor.py @@ -77,11 +77,11 @@ def fix_outofbounds_indices(ds, array_name): NOTE: Assumes connectivity arrays are zero indexed """ # progamatically create the appropriate dimension name - dim = "n" + array.split("On")[0].title() + dim = "n" + array_name.split("On")[0].title() # get the maximum valid size for the array to be indexed too maxSize = ds.sizes[dim] # where index is out of bounds, set to invalid (i.e. -1) - ds[array] = xr.where(ds[array] == maxSize, -1, ds[array]) + ds[array_name] = xr.where(ds[array_name] == maxSize, -1, ds[array_name]) return ds @@ -251,8 +251,8 @@ def _compute_edge_patches(ds, latlon=False): verticesOnEdge = ds.verticesOnEdge # is this masking correct ?? - cellMask = cellsOnEdge <= 0 - vertexMask = verticesOnEdge <= 0 + cellMask = cellsOnEdge < 0 + vertexMask = verticesOnEdge < 0 # get the coordinates needed to patch construction xCell = ds.xCell