Skip to content

Commit

Permalink
GmMultiPolyIntersector for python - fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mkennard-aquaveo committed Jan 4, 2024
1 parent 175ac68 commit 67ad77a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ def _zeroed_z(self, points) -> list[list[float]]:
"""Returns the points with 0.0 for z values."""
return [[point[0], point[1], 0.0] for point in points]

def _run_test(self, x1, y1, x2, y2, points, polys, expected_poly_ids, expected_t_values, expected_points):
def _run_test(self, x1, y1, x2, y2, points, polys, expected_poly_ids, expected_t_vals, expected_points):
"""Runs the test."""
mpi = grid.geometry.MultiPolyIntersector(points, polys)
poly_ids, t_values, pts = mpi.traverse_line_segment(x1, y1, x2, y2)
poly_ids, t_vals, pts = mpi.traverse_line_segment(x1, y1, x2, y2)
assert poly_ids == expected_poly_ids, str(f'Expected {expected_poly_ids}. Got {poly_ids}.')
assert (np.testing.assert_allclose(t_values, expected_t_values),
str(f'Expected {expected_t_values}. Got {t_values}.'))
assert np.testing.assert_allclose(t_vals, expected_t_vals), str(f'Expected {expected_t_vals}. Got {t_vals}.')
for point, expected_point in zip(self._zeroed_z(pts), self._zeroed_z(expected_points)):
assert np.testing.assert_allclose(point, expected_point)

Expand Down

0 comments on commit 67ad77a

Please sign in to comment.