Skip to content

Commit

Permalink
Fix issue with sorting last point in transect
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Aug 17, 2020
1 parent 262e53e commit 4bd7db6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions conda_package/mpas_tools/viz/transects.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def find_transect_cells_and_weights(lonTransect, latTransect, dsTris, dsMesh,
x, y, z = _lon_lat_to_cartesian(lonTransect, latTransect, earth_radius,
degrees)

nTriangles = dsTris.sizes['nTriangles']
nNodes = dsTris.sizes['nNodes']
nodeCellWeights = dsTris.nodeCellWeights.values
nodeCellIndices = dsTris.nodeCellIndices.values
Expand Down Expand Up @@ -283,7 +282,7 @@ def find_transect_cells_and_weights(lonTransect, latTransect, dsTris, dsMesh,
while len(indices) < len(sortIndices):
index = len(indices)
currentTri = trisSorted[indices[-1]]
if nodesAreSame[index]:
if index < len(nodesAreSame) and nodesAreSame[index]:
# the next two nodes are the same, so we need to know which
# corresponds to the current triangle
if trisSorted[index] == currentTri:
Expand Down
2 changes: 1 addition & 1 deletion conda_package/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "mpas_tools" %}
{% set version = "0.0.10" %}
{% set version = "0.0.11" %}

package:
name: '{{ name|lower }}'
Expand Down

0 comments on commit 4bd7db6

Please sign in to comment.