Skip to content

Commit 1dd11ea

Browse files
committed
Fix test_voronoi on other architectures.
Floating point results shouldn't be checked exactly, as they might differ on other machines.
1 parent fcf8875 commit 1dd11ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libpysal/cg/tests/test_voronoi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import unittest
2+
3+
import numpy as np
4+
15
from ..voronoi import voronoi, voronoi_frames
26
from ..shapes import Polygon, asShape
3-
import unittest
47

58

69
class Voronoi(unittest.TestCase):
@@ -24,7 +27,7 @@ def test_voronoi(self):
2427
regions, vertices = voronoi(self.points)
2528
self.assertEqual(regions, [[1, 3, 2], [4, 5, 1, 0], [0, 1, 7, 6], [9, 0, 8]])
2629

27-
self.assertTrue(vertices.tolist() == self.vertices)
30+
np.testing.assert_array_almost_equal(vertices, self.vertices)
2831

2932
def test_voronoi_frames(self):
3033
r_df, p_df = voronoi_frames(self.points)

0 commit comments

Comments
 (0)