diff options
Diffstat (limited to 'stsci/sphere/test')
-rw-r--r-- | stsci/sphere/test/test.py | 5 | ||||
-rw-r--r-- | stsci/sphere/test/test_union.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/stsci/sphere/test/test.py b/stsci/sphere/test/test.py index 8e6e270..5ab7bbb 100644 --- a/stsci/sphere/test/test.py +++ b/stsci/sphere/test/test.py @@ -19,8 +19,9 @@ graph.DEBUG = True def test_normalize_vector(): x, y, z = np.ogrid[-100:100:11,-100:100:11,-100:100:11] - xn, yn, zn = vector.normalize_vector(x.flatten(), y.flatten(), z.flatten()) - l = np.sqrt(xn ** 2 + yn ** 2 + zn ** 2) + xyz = np.dstack((x.flatten(), y.flatten(), z.flatten()))[0] + xyzn = vector.normalize_vector(xyz) + l = np.sqrt(np.sum(xyzn * xyzn, axis=-1)) assert_almost_equal(l, 1.0) diff --git a/stsci/sphere/test/test_union.py b/stsci/sphere/test/test_union.py index 60ea572..a6e5793 100644 --- a/stsci/sphere/test/test_union.py +++ b/stsci/sphere/test/test_union.py @@ -209,7 +209,7 @@ def test_difficult_unions(): poly = polygon.SphericalPolygon(points, inside) polys.append(poly) - polygon.SphericalPolygon.multi_union(polys) + polygon.SphericalPolygon.multi_union(polys[:len(polys)/2]) if __name__ == '__main__': |