From 457db3570a50cf2d88fa5ac00d1ba1d5b119ea7a Mon Sep 17 00:00:00 2001 From: bsimon Date: Fri, 3 Apr 2015 20:08:07 +0000 Subject: Back ported changes from astropy and made python 2 to 3 modifications git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci.sphere/trunk@38800 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: c12c8fef5503caab2e2e57caac8f040597326589 --- stsci/sphere/test/test_union.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'stsci/sphere/test/test_union.py') diff --git a/stsci/sphere/test/test_union.py b/stsci/sphere/test/test_union.py index 5559c87..b172e0f 100644 --- a/stsci/sphere/test/test_union.py +++ b/stsci/sphere/test/test_union.py @@ -56,9 +56,7 @@ class union_test: permutation) unions.append(union) union_area = union.area() - print(union._points) - print(permutation[0]._points) - + if GRAPH_MODE: fig = plt.figure() m = Basemap(projection=self._proj, @@ -74,10 +72,11 @@ class union_test: plt.savefig(filename) fig.clear() - print(union_area, areas) assert np.all(union_area * 1.1 >= areas) - lengths = np.array([len(x._points) for x in unions]) + lengths = np.array([ + np.sum(len(x._points) for x in y.iter_polygons_flat()) + for y in unions]) assert np.all(lengths == [lengths[0]]) areas = np.array([x.area() for x in unions]) assert_array_almost_equal(areas, areas[0], 1) @@ -188,7 +187,8 @@ def test_union_empty(): p2 = p.union(polygon.SphericalPolygon([])) - assert_array_almost_equal(p2._points, p._points) + assert len(p2.polygons) == 1 + assert_array_almost_equal(p2.polygons[0].points, p.polygons[0].points) def test_difficult_unions(): -- cgit