Skip to content

Commit

Permalink
MNT: Avoid order-dependence in test_find_nn_triangles_point()
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Nov 1, 2023
1 parent f6773c2 commit 57082bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/interpolate/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ def test_find_nn_triangles_point():
tri = Delaunay(pts)

tri_match = tri.find_simplex([4.5, 4.5])
nn = find_nn_triangles_point(tri, tri_match, [4.5, 4.5])
nn = find_nn_triangles_point(tri, tri_match, (4.5, 4.5))

# Can't rely on simplex indices, so need to check point indices
truth = {(45, 55, 44), (55, 54, 44)}
assert {tuple(verts) for verts in tri.simplices[nn]} == truth
# Can't rely on simplex indices or the order of points that define them, so need to be a bit more involved to check
truth = [{45, 55, 44}, {55, 54, 44}]
found = [set(verts) for verts in tri.simplices[nn]]
for s in truth:
assert s in found


def test_find_local_boundary():
Expand Down

0 comments on commit 57082bb

Please sign in to comment.