Skip to content

Commit

Permalink
Updated path utility
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 9, 2019
1 parent f91af59 commit 1f6c4ae
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions holoviews/tests/plotting/matplotlib/testutils.py
Expand Up @@ -22,11 +22,15 @@ def test_polygon_to_path_patches(self):
polys = Polygons([{'x': xs, 'y': ys, 'holes': holes}])
paths = polygons_to_path_patches(polys)


self.assertEqual(len(paths), 1)
self.assertEqual(len(paths[0]), 3)
self.assertEqual(paths[0][0].get_verts(), np.array([(1, 2), (2, 0), (3, 7), (1, 2)]))
self.assertEqual(paths[0][0].get_path().codes, np.array([1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2], dtype='uint8'))
self.assertEqual(paths[0][1].get_verts(), np.array([(6, 7), (7, 5), (3, 2), (6, 7)]))
self.assertEqual(paths[0][1].get_path().codes, np.array([1, 2, 2, 2], dtype='uint8'))
self.assertEqual(paths[0][2].get_verts(), np.array([(0, 0), (0, 1), (0, 0)]))
self.assertEqual(paths[0][1].get_path().codes, np.array([1, 2, 2, 2], dtype='uint8'))
self.assertEqual(paths[0][0].get_path().vertices, np.array([
(1, 2), (2, 0), (3, 7), (1, 2),
(1.5, 2), (2, 3), (1.6, 1.6), (1.5, 2),
(2.1, 4.5), (2.5, 5), (2.3, 3.5), (2.1, 4.5)]))
self.assertEqual(paths[0][0].get_path().codes, np.array([1, 2, 2, 79, 1, 2, 2, 79, 1, 2, 2, 79], dtype='uint8'))
self.assertEqual(paths[0][1].get_path().vertices, np.array([(6, 7), (7, 5), (3, 2), (6, 7)]))
self.assertEqual(paths[0][1].get_path().codes, np.array([1, 2, 2, 79], dtype='uint8'))
self.assertEqual(paths[0][2].get_path().vertices, np.array([(0, 0), (0, 1), (0, 0)]))
self.assertEqual(paths[0][1].get_path().codes, np.array([1, 2, 2, 79], dtype='uint8'))

0 comments on commit 1f6c4ae

Please sign in to comment.