Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Xylar Asay-Davis <xylarstorm@gmail.com>
  • Loading branch information
andrewdnolan and xylar committed Aug 29, 2024
1 parent eb1920d commit 4cca3ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mosaic/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4cca3ba

Please sign in to comment.