Changeset 744 for trunk/delaunay/tests

Show
Ignore:
Timestamp:
01/16/08 23:52:16 (4 years ago)
Author:
rkern
Message:

Use numpy instead of scipy

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/delaunay/tests/test_triangulate.py

    r547 r744  
    11from scikits import delaunay as dlny 
    22from numpy import random 
    3 import scipy as sp 
     3import numpy as np 
    44 
    55def onright(x0, y0, x1, y1, x, y): 
     
    1313    with radius r. 
    1414    """ 
    15     r2 = sp.hypot(x-cx, y-cy) 
     15    r2 = np.hypot(x-cx, y-cy) 
    1616    assert r2 < r 
    1717 
     
    3232            assert tri.edge_db.shape == (nedges, 2) 
    3333            assert tri.circumcenters.shape == (ntriangles, 2) 
    34             assert sp.sum((tri.triangle_neighbors == -1).astype(sp.int32).flat) == k 
     34            assert np.sum((tri.triangle_neighbors == -1).astype(np.int32).flat) == k 
    3535 
    3636    def test_ccw_triangles(self): 
     
    6363            r2 = ((x[i] - tri.circumcenters[:,0])**2 
    6464                + (y[i] - tri.circumcenters[:,1])**2) 
    65             alldist2 = (sp.subtract.outer(x, tri.circumcenters[:,0])**2 
    66                       + sp.subtract.outer(y, tri.circumcenters[:,1])**2) 
     65            alldist2 = (np.subtract.outer(x, tri.circumcenters[:,0])**2 
     66                      + np.subtract.outer(y, tri.circumcenters[:,1])**2) 
    6767            good = (r2 <= (alldist2 + 1e-12)) 
    68             assert sp.alltrue(good) 
     68            assert np.alltrue(good)