Ignore:
Timestamp:
Nov 6, 2008, 3:41:41 PM (16 years ago)
Author:
rwilson
Message:

NumPy? conversion.

Location:
anuga_core/source_numpy_conversion/anuga/fit_interpolate
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/benchmark_least_squares.py

    r4872 r5905  
    2222import tempfile
    2323import profile , pstats
    24 from math import sqrt
    25 from Numeric import array
     24##from math import sqrt
     25##import numpy
    2626
    2727from anuga.fit_interpolate.search_functions import search_times, \
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/fit.py

    r5855 r5905  
    2828import types
    2929
    30 from Numeric import zeros, Float, ArrayType,take, Int
     30import numpy
    3131
    3232from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
     
    252252            if len(z.shape) > 1:
    253253                att_num = z.shape[1]
    254                 self.Atz = zeros((m,att_num), Float)
     254                self.Atz = numpy.zeros((m,att_num), numpy.float)
    255255            else:
    256256                att_num = 1
    257                 self.Atz = zeros((m,), Float)
     257                self.Atz = numpy.zeros((m,), numpy.float)
    258258            assert z.shape[0] == point_coordinates.shape[0]
    259259
     
    437437        # Convert input to Numeric arrays
    438438        if z is not None:
    439             z = ensure_numeric(z, Float)
     439            z = ensure_numeric(z, numpy.float)
    440440        else:
    441441            msg = 'z not specified'
     
    443443            z = point_coordinates.get_attributes(attribute_name)
    444444
    445         point_coordinates = ensure_numeric(point_coordinates, Float)
     445        point_coordinates = ensure_numeric(point_coordinates, numpy.float)
    446446        self._build_matrix_AtA_Atz(point_coordinates, z, verbose)
    447447
     
    584584           
    585585        #Convert input to Numeric arrays
    586         triangles = ensure_numeric(triangles, Int)
     586        triangles = ensure_numeric(triangles, numpy.int)
    587587        vertex_coordinates = ensure_absolute(vertex_coordinates,
    588588                                             geo_reference = mesh_origin)
     
    651651    vertex_coordinates = mesh_dict['vertices']
    652652    triangles = mesh_dict['triangles']
    653     if type(mesh_dict['vertex_attributes']) == ArrayType:
     653    if isinstance(mesh_dict['vertex_attributes'], numpy.ndarray):
    654654        old_point_attributes = mesh_dict['vertex_attributes'].tolist()
    655655    else:
    656656        old_point_attributes = mesh_dict['vertex_attributes']
    657657
    658     if type(mesh_dict['vertex_attribute_titles']) == ArrayType:
     658    if isinstance(mesh_dict['vertex_attribute_titles'], numpy.ndarray):
    659659        old_title_list = mesh_dict['vertex_attribute_titles'].tolist()
    660660    else:
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/general_fit_interpolate.py

    r5361 r5905  
    2121from warnings import warn
    2222
    23 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, \
    24      ArrayType, allclose, take, NewAxis, arange
     23import numpy
    2524
    2625from anuga.caching.caching import cache
     
    9796           
    9897                #Convert input to Numeric arrays
    99                 triangles = ensure_numeric(triangles, Int)
     98                triangles = ensure_numeric(triangles, numpy.int)
    10099                vertex_coordinates = ensure_absolute(vertex_coordinates,
    101100                                                 geo_reference = mesh_origin)
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/interpolate.py

    r5869 r5905  
    2424from csv import writer, DictWriter
    2525
    26 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, \
    27      ArrayType, allclose, take, NewAxis, arange
     26import numpy
    2827
    2928from anuga.caching.caching import cache
     
    116115
    117116    # Create interpolation object with matrix
    118     args = (ensure_numeric(vertex_coordinates, Float),
     117    args = (ensure_numeric(vertex_coordinates, numpy.float),
    119118            ensure_numeric(triangles))
    120119    kwargs = {'mesh_origin': mesh_origin,
     
    224223 
    225224        from utilities.polygon import point_on_line
    226         from Numeric import ones
    227         z=ones(len(point_coordinates),Float)
     225        z=numpy.ones(len(point_coordinates),numpy.float)
    228226
    229227        msg='point coordinates are not given (interpolate.py)'
     
    343341                # creating a dummy array to concatenate to.
    344342               
    345                 f = ensure_numeric(f, Float)
     343                f = ensure_numeric(f, numpy.float)
    346344                #print "f.shape",f.shape
    347345                if len(f.shape) > 1:
    348                     z = zeros((0,f.shape[1]))
     346                    z = numpy.zeros((0,f.shape[1]), numpy.float)
    349347                else:
    350                     z = zeros((0,))
     348                    z = numpy.zeros((0,), numpy.float)
    351349                   
    352350                for end in range(start_blocking_len,
     
    358356                    #print "t", t
    359357                    #print "z", z
    360                     z = concatenate((z,t))
     358                    z = numpy.concatenate((z,t))
    361359                    start = end
    362360                   
     
    364362                t = self.interpolate_block(f, point_coordinates[start:end],
    365363                                           verbose=verbose)
    366                 z = concatenate((z,t))
     364                z = numpy.concatenate((z,t))
    367365        return z
    368366   
     
    389387
    390388        # Convert lists to Numeric arrays if necessary
    391         point_coordinates = ensure_numeric(point_coordinates, Float)
    392         f = ensure_numeric(f, Float)               
     389        point_coordinates = ensure_numeric(point_coordinates, numpy.float)
     390        f = ensure_numeric(f, numpy.float)               
    393391
    394392        from anuga.caching import myhash
    395         from Numeric import alltrue
    396393        import sys
    397394        if use_cache is True:
     
    412409                if self.interpolation_matrices.has_key(key):
    413410                    X, stored_points = self.interpolation_matrices[key]
    414                     if alltrue(stored_points == point_coordinates):
     411                    if numpy.alltrue(stored_points == point_coordinates):
    415412                        reuse_A = True # Reuse interpolation matrix
    416413               
     
    487484
    488485        # Convert point_coordinates to Numeric arrays, in case it was a list.
    489         point_coordinates = ensure_numeric(point_coordinates, Float)
     486        point_coordinates = ensure_numeric(point_coordinates, numpy.float)
    490487       
    491488       
     
    752749        """
    753750
    754         from Numeric import array, zeros, Float, alltrue, concatenate,\
    755              reshape, ArrayType
    756 
    757 
    758751        from anuga.config import time_format
    759752        import types
    760 
    761753
    762754        # Check temporal info
     
    764756        msg = 'Time must be a monotonuosly '
    765757        msg += 'increasing sequence %s' %time
    766         assert alltrue(time[1:] - time[:-1] >= 0 ), msg
     758        assert numpy.alltrue(time[1:] - time[:-1] >= 0 ), msg
    767759
    768760
     
    795787        # Thin timesteps if needed
    796788        # Note array() is used to make the thinned arrays contiguous in memory
    797         self.time = array(time[::time_thinning])         
     789        self.time = numpy.array(time[::time_thinning])         
    798790        for name in quantity_names:
    799791            if len(quantities[name].shape) == 2:
    800                 quantities[name] = array(quantities[name][::time_thinning,:])
     792                quantities[name] = numpy.array(quantities[name][::time_thinning,:])
    801793             
    802794        # Save for use with statistics
    803795        self.quantities_range = {}
    804796        for name in quantity_names:
    805             q = quantities[name][:].flat
     797##            q = quantities[name][:].ravel()
     798            q = numpy.ravel(quantities[name][:])
    806799            self.quantities_range[name] = [min(q), max(q)]
    807800       
     
    863856                        if sys.platform == 'win32': # FIXME (Ole): Why only Windoze?
    864857                            from anuga.utilities.polygon import plot_polygons
    865                             #out_interp_pts = take(interpolation_points,[indices])
     858                            #out_interp_pts = numpy.take(interpolation_points,[indices], axis=0)
    866859                            title = 'Interpolation points fall outside specified mesh'
    867860                            plot_polygons([mesh_boundary_polygon,
     
    905898           
    906899            for name in quantity_names:
    907                 self.precomputed_values[name] = zeros((p, m), Float)
     900                self.precomputed_values[name] = numpy.zeros((p, m), numpy.float)
    908901
    909902            # Build interpolator
     
    995988
    996989        from math import pi, cos, sin, sqrt
    997         from Numeric import zeros, Float
    998990        from anuga.abstract_2d_finite_volumes.util import mean       
    999991
     
    10311023
    10321024        # Compute interpolated values
    1033         q = zeros(len(self.quantity_names), Float)
     1025        q = numpy.zeros(len(self.quantity_names), numpy.float)
    10341026        # print "self.precomputed_values", self.precomputed_values
    10351027        for i, name in enumerate(self.quantity_names):
     
    10861078                    return q
    10871079                else:
    1088                     from Numeric import ones, Float
    10891080                    # x is a vector - Create one constant column for each value
    10901081                    N = len(x)
     
    10921083                    res = []
    10931084                    for col in q:
    1094                         res.append(col*ones(N, Float))
     1085                        res.append(col*numpy.ones(N, numpy.float))
    10951086                       
    10961087                return res
     
    11291120            minq, maxq = self.quantities_range[name]
    11301121            str += '    %s in [%f, %f]\n' %(name, minq, maxq)           
    1131             #q = quantities[name][:].flat
     1122            #q = quantities[name][:].ravel()
    11321123            #str += '    %s in [%f, %f]\n' %(name, min(q), max(q))
    11331124
     
    11421133       
    11431134            for name in quantity_names:
    1144                 q = precomputed_values[name][:].flat
     1135##NumPy                q = precomputed_values[name][:].ravel()
     1136                q = numpy.ravel(precomputed_values[name][:])
    11451137                str += '    %s at interpolation points in [%f, %f]\n'\
    11461138                       %(name, min(q), max(q))
     
    11651157
    11661158    #Add the x and y together
    1167     vertex_coordinates = concatenate((x[:,NewAxis], y[:,NewAxis]),axis=1)
     1159    vertex_coordinates = numpy.concatenate((x[:,numpy.newaxis], y[:,numpy.newaxis]),axis=1)
    11681160
    11691161    #Will return the quantity values at the specified times and locations
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/search_functions.py

    r5775 r5905  
    66
    77"""
    8 from Numeric import dot
    98import time
    109
    11 from Numeric import array
     10import numpy
    1211
    1312from anuga.utilities.numerical_tools import get_machine_precision
     
    1918
    2019#FIXME test what happens if a
    21 LAST_TRIANGLE = [[-10,[(array([max_float,max_float]),
    22                         array([max_float,max_float]),
    23                         array([max_float,max_float])),
    24                        (array([1,1]),array([0,0]),array([-1.1,-1.1]))]]]
     20LAST_TRIANGLE = [[-10,[(numpy.array([max_float,max_float]),
     21                        numpy.array([max_float,max_float]),
     22                        numpy.array([max_float,max_float])),
     23                       (numpy.array([1,1]),numpy.array([0,0]),numpy.array([-1.1,-1.1]))]]]
    2524
    2625def search_tree_of_vertices(root, mesh, x):
     
    189188    # print "dot((xi0-xi1), n0)", dot((xi0-xi1), n0)
    190189   
    191     sigma0 = dot((x-xi1), n0)/dot((xi0-xi1), n0)
     190    sigma0 = numpy.dot((x-xi1), n0)/numpy.dot((xi0-xi1), n0)
    192191    if sigma0 < -epsilon:
    193192        return False,0,0,0
    194     sigma1 = dot((x-xi2), n1)/dot((xi1-xi2), n1)
     193    sigma1 = numpy.dot((x-xi2), n1)/numpy.dot((xi1-xi2), n1)
    195194    if sigma1 < -epsilon:
    196195        return False,0,0,0
    197     sigma2 = dot((x-xi0), n2)/dot((xi2-xi0), n2)
     196    sigma2 = numpy.dot((x-xi0), n2)/numpy.dot((xi2-xi0), n2)
    198197    if sigma2 < -epsilon:
    199198        return False,0,0,0
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/test_fit.py

    r5349 r5905  
    1212import tempfile
    1313import os
    14 from Numeric import zeros, take, compress, Float, Int, dot, concatenate, \
    15      ArrayType, allclose, array
     14
     15import numpy
    1616
    1717from fit import *
     
    2424
    2525def distance(x, y):
    26     return sqrt( sum( (array(x)-array(y))**2 ))
     26    return sqrt( sum( (numpy.array(x)-numpy.array(y))**2 ))
    2727
    2828def linear_function(point):
    29     point = array(point)
     29    point = numpy.array(point)
    3030    return point[:,0]+point[:,1]
    3131
     
    6464        #print "z",z
    6565
    66         assert allclose(fit.Atz, [2.8, 3.6, 3.6], atol=1e-7)
     66        assert numpy.allclose(fit.Atz, [2.8, 3.6, 3.6], atol=1e-7)
    6767
    6868        f = fit.fit()
     
    7373        #print "answer\n",answer
    7474
    75         assert allclose(f, answer, atol=1e-7)
     75        assert numpy.allclose(f, answer, atol=1e-7)
    7676
    7777    def test_smooth_att_to_meshII(self):
     
    9696        #print "answer\n",answer
    9797
    98         assert allclose(f, answer)
     98        assert numpy.allclose(f, answer)
    9999
    100100    def test_smooth_attributes_to_meshIII(self):
     
    132132        #print "f\n",f
    133133        #print "answer\n",answer
    134         assert allclose(f, answer)
     134        assert numpy.allclose(f, answer)
    135135
    136136   
     
    158158        f =  fit.fit(data_coords,z)
    159159        answer = [[0,0], [5., 10.], [5., 10.]]
    160         assert allclose(f, answer)
     160        assert numpy.allclose(f, answer)
    161161
    162162    def test_smooth_attributes_to_mesh_build_fit_subset(self):
     
    204204        #print "f\n",f
    205205        #print "answer\n",answer
    206         assert allclose(f, answer)
     206        assert numpy.allclose(f, answer)
    207207
    208208        # test fit 2 mesh as well.
     
    244244        #print "f\n",f
    245245        #print "answer\n",answer
    246         assert allclose(f, answer)
     246        assert numpy.allclose(f, answer)
    247247        os.remove(fileName)
    248248
     
    280280        #print "f",f
    281281        #print "answer",answer
    282         assert allclose(f, answer)
     282        assert numpy.allclose(f, answer)
    283283
    284284        # Delete file!
     
    323323        #print "f\n",f
    324324        #print "answer\n",answer
    325         assert allclose(f, answer)
     325        assert numpy.allclose(f, answer)
    326326        os.remove(fileName)
    327327       
     
    362362        #print "f\n",f
    363363        #print "answer\n",answer
    364         assert allclose(f, answer)
     364        assert numpy.allclose(f, answer)
    365365        os.remove(fileName)
    366366        os.remove(fileName_pts)
     
    402402        #print "f\n",f
    403403        #print "answer\n",answer
    404         assert allclose(f, answer)
     404        assert numpy.allclose(f, answer)
    405405        os.remove(fileName)
    406406        os.remove(fileName_pts)
     
    442442        #print "f\n",f
    443443        #print "answer\n",answer
    444         assert allclose(f, answer)
     444        assert numpy.allclose(f, answer)
    445445   
    446446        os.remove(fileName)
     
    483483        #print "f\n",f
    484484        #print "answer\n",answer
    485         assert allclose(f, answer)
     485        assert numpy.allclose(f, answer)
    486486        os.remove(fileName)
    487487       
     
    524524        #print "f",f
    525525        #print "answer",answer
    526         assert allclose(f, answer)
     526        assert numpy.allclose(f, answer)
    527527
    528528       
     
    562562        f = interp.fit(data_points,z)
    563563        #f will be different from answer due to smoothing
    564         assert allclose(f, answer,atol=5)
     564        assert numpy.allclose(f, answer,atol=5)
    565565
    566566
    567567    #Tests of smoothing matrix
    568568    def test_smoothing_matrix_one_triangle(self):
    569         from Numeric import dot
     569##        from numpy.oldnumeric import dot
    570570        a = [0.0, 0.0]
    571571        b = [0.0, 2.0]
     
    577577        interp = Fit(points, vertices)
    578578
    579         assert allclose(interp.get_D(), [[1, -0.5, -0.5],
     579        assert numpy.allclose(interp.get_D(), [[1, -0.5, -0.5],
    580580                                   [-0.5, 0.5, 0],
    581581                                   [-0.5, 0, 0.5]])
    582582
    583583        #Define f(x,y) = x
    584         f = array([0,0,2]) #Value at global vertex 2
     584        f = numpy.array([0,0,2]) #Value at global vertex 2
    585585
    586586        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    587587        #           int 1 dx dy = area = 2
    588         assert dot(dot(f, interp.get_D()), f) == 2
     588        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 2
    589589
    590590        #Define f(x,y) = y
    591         f = array([0,2,0])  #Value at global vertex 1
     591        f = numpy.array([0,2,0])  #Value at global vertex 1
    592592
    593593        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    594594        #           int 1 dx dy = area = 2
    595         assert dot(dot(f, interp.get_D()), f) == 2
     595        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 2
    596596
    597597        #Define f(x,y) = x+y
    598         f = array([0,2,2])  #Values at global vertex 1 and 2
     598        f = numpy.array([0,2,2])  #Values at global vertex 1 and 2
    599599
    600600        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    601601        #           int 2 dx dy = 2*area = 4
    602         assert dot(dot(f, interp.get_D()), f) == 4
     602        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 4
    603603
    604604
    605605    def test_smoothing_matrix_more_triangles(self):
    606         from Numeric import dot
     606##        from numpy.oldnumeric import dot
    607607
    608608        a = [0.0, 0.0]
     
    625625
    626626        #Define f(x,y) = x
    627         f = array([0,0,2,0,2,4]) #f evaluated at points a-f
     627        f = numpy.array([0,0,2,0,2,4]) #f evaluated at points a-f
    628628
    629629        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    630630        #           int 1 dx dy = total area = 8
    631         assert dot(dot(f, interp.get_D()), f) == 8
     631        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 8
    632632
    633633        #Define f(x,y) = y
    634         f = array([0,2,0,4,2,0]) #f evaluated at points a-f
     634        f = numpy.array([0,2,0,4,2,0]) #f evaluated at points a-f
    635635
    636636        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    637637        #           int 1 dx dy = area = 8
    638         assert dot(dot(f, interp.get_D()), f) == 8
     638        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 8
    639639
    640640        #Define f(x,y) = x+y
    641         f = array([0,2,2,4,4,4])  #f evaluated at points a-f
     641        f = numpy.array([0,2,2,4,4,4])  #f evaluated at points a-f
    642642
    643643        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    644644        #           int 2 dx dy = 2*area = 16
    645         assert dot(dot(f, interp.get_D()), f) == 16
     645        assert numpy.dot(numpy.dot(f, interp.get_D()), f) == 16
    646646
    647647
     
    709709        f1 = interp.fit(data_points1,z)
    710710
    711         assert allclose(f,f1), 'Fit should have been unaltered'
     711        assert numpy.allclose(f,f1), 'Fit should have been unaltered'
    712712
    713713
     
    736736        answer = [[0, 0], [5., 10.], [5., 10.]]
    737737
    738         assert allclose(f, answer)
     738        assert numpy.allclose(f, answer)
    739739
    740740    def test_fit_to_mesh_w_georef(self):
     
    773773                         mesh_origin = mesh_geo.get_origin(),
    774774                         alpha = 0)
    775         assert allclose( zz, [0,5,5] )
     775        assert numpy.allclose( zz, [0,5,5] )
    776776
    777777
     
    819819              [5.0, 10.0],
    820820              [5.0,10.0]]
    821         assert allclose(mesh_dic['vertex_attributes'],ans)
     821        assert numpy.allclose(mesh_dic['vertex_attributes'],ans)
    822822
    823823        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
     
    827827       
    828828        answer = [0., 5., 5.]
    829         assert allclose(domain.quantities['elevation'].vertex_values,
     829        assert numpy.allclose(domain.quantities['elevation'].vertex_values,
    830830                        answer)
    831831        #clean up
     
    878878              [5.0, 10.0],
    879879              [5.0,10.0]]
    880         assert allclose(mesh_dic['vertex_attributes'],ans)
     880        assert numpy.allclose(mesh_dic['vertex_attributes'],ans)
    881881
    882882        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
     
    929929        mesh_dic = import_mesh_file(mesh_output_file)
    930930
    931         assert allclose(mesh_dic['vertex_attributes'],
     931        assert numpy.allclose(mesh_dic['vertex_attributes'],
    932932                        [[1.0, 2.0,0.0, 0.0],
    933933                         [1.0, 2.0,5.0, 10.0],
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/test_interpolate.py

    r5775 r5905  
    1414
    1515from Scientific.IO.NetCDF import NetCDFFile
    16 from Numeric import allclose, array, transpose, zeros, Float, sometrue, \
    17      alltrue, take, where
    18 
     16import numpy
    1917
    2018# ANUGA code imports
     
    2826
    2927def distance(x, y):
    30     return sqrt( sum( (array(x)-array(y))**2 ))
     28    return sqrt( numpy.sum( (numpy.array(x)-numpy.array(y))**2 ))
    3129
    3230def linear_function(point):
    33     point = array(point)
     31    point = numpy.array(point)
    3432    return point[:,0]+point[:,1]
    3533
     
    6664
    6765        bed = domain.quantities['elevation'].vertex_values
    68         stage = zeros(bed.shape, Float)
     66        stage = numpy.zeros(bed.shape, numpy.float)
    6967
    7068        h = 0.3
     
    104102        interp = Interpolate(points, vertices)
    105103        A, _, _ = interp._build_interpolation_matrix_A(data)
    106         assert allclose(A.todense(),
     104        assert numpy.allclose(A.todense(),
    107105                        [[1./3, 1./3, 1./3]])
    108106
     
    113111        from mesh_factory import rectangular
    114112        from shallow_water import Domain
    115         from Numeric import zeros, Float
    116113        from abstract_2d_finite_volumes.quantity import Quantity
    117114
     
    130127
    131128        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    132         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     129        vertex_coordinates = numpy.concatenate( (x[:, numpy.newaxis], y[:, numpy.newaxis]), axis=1 )
    133130        # FIXME: This concat should roll into get_vertex_values
    134131
     
    140137        I = Interpolate(vertex_coordinates, triangles)
    141138        result = I.interpolate(vertex_values, interpolation_points)
    142         assert allclose(result, answer)
     139        assert numpy.allclose(result, answer)
    143140
    144141
     
    150147       
    151148        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    152         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     149        vertex_coordinates = numpy.concatenate( (x[:, numpy.newaxis], y[:, numpy.newaxis]), axis=1 )
    153150        # FIXME: This concat should roll into get_vertex_values
    154151
     
    160157        I = Interpolate(vertex_coordinates, triangles)
    161158        result = I.interpolate(vertex_values, interpolation_points)
    162         assert allclose(result, answer)       
     159        assert numpy.allclose(result, answer)       
    163160       
    164161
     
    167164        from mesh_factory import rectangular
    168165        from shallow_water import Domain
    169         from Numeric import zeros, Float
    170166        from abstract_2d_finite_volumes.quantity import Quantity
    171167
     
    184180
    185181        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    186         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     182        vertex_coordinates = numpy.concatenate( (x[:, numpy.newaxis], y[:, numpy.newaxis]), axis=1 )
    187183        # FIXME: This concat should roll into get_vertex_values
    188184
     
    193189
    194190        result = interpolate(vertex_coordinates, triangles, vertex_values, interpolation_points)
    195         assert allclose(result, answer)
     191        assert numpy.allclose(result, answer)
    196192
    197193
     
    203199       
    204200        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    205         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     201        vertex_coordinates = numpy.concatenate( (x[:, numpy.newaxis], y[:, numpy.newaxis]), axis=1 )
    206202        # FIXME: This concat should roll into get_vertex_values
    207203
     
    213209        result = interpolate(vertex_coordinates, triangles,
    214210                             vertex_values, interpolation_points)
    215         assert allclose(result, answer)       
     211        assert numpy.allclose(result, answer)       
    216212       
    217213       
     
    220216        from mesh_factory import rectangular
    221217        from shallow_water import Domain
    222         from Numeric import zeros, Float
    223218        from abstract_2d_finite_volumes.quantity import Quantity
    224219
     
    236231       
    237232        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    238         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     233        vertex_coordinates = numpy.concatenate( (x[:, numpy.newaxis], y[:, numpy.newaxis]), axis=1 )
    239234        # FIXME: This concat should roll into get_vertex_values
    240235
     
    248243                             use_cache=True,
    249244                             verbose=False)
    250         assert allclose(result, answer)               
     245        assert numpy.allclose(result, answer)               
    251246       
    252247        # Second call using the cache
     
    255250                             use_cache=True,
    256251                             verbose=False)
    257         assert allclose(result, answer)                       
     252        assert numpy.allclose(result, answer)                       
    258253       
    259254       
     
    289284
    290285        A,_,_ = interp._build_interpolation_matrix_A(data)
    291         assert allclose(A.todense(), answer)
     286        assert numpy.allclose(A.todense(), answer)
    292287       
    293288        #interp.set_point_coordinates([[-30, -30]]) #point outside of mesh
     
    298293       
    299294        A,_,_ = interp._build_interpolation_matrix_A(data)       
    300         assert allclose(A.todense(), answer)
     295        assert numpy.allclose(A.todense(), answer)
    301296
    302297
     
    309304                     
    310305        A,_,_ = interp._build_interpolation_matrix_A(data)       
    311         assert allclose(A.todense(), answer)
     306        assert numpy.allclose(A.todense(), answer)
    312307
    313308
     
    330325                   
    331326        A,_,_ = interp._build_interpolation_matrix_A(data)
    332         assert allclose(A.todense(), answer)
     327        assert numpy.allclose(A.todense(), answer)
    333328
    334329
     
    351346
    352347        A,_,_ = interp._build_interpolation_matrix_A(data)
    353         assert allclose(A.todense(), answer)
     348        assert numpy.allclose(A.todense(), answer)
    354349
    355350    def test_datapoints_on_edges(self):
     
    372367
    373368        A,_,_ = interp._build_interpolation_matrix_A(data)
    374         assert allclose(A.todense(), answer)
     369        assert numpy.allclose(A.todense(), answer)
    375370
    376371
     
    379374       
    380375
    381         from Numeric import sum
    382376
    383377        a = [0.0, 0.0]
     
    394388        A,_,_ = interp._build_interpolation_matrix_A(data)
    395389        results = A.todense()
    396         assert allclose(sum(results, axis=1), 1.0)
     390        assert numpy.allclose(numpy.sum(results, axis=1), 1.0)
    397391
    398392    def test_arbitrary_datapoints_some_outside(self):
     
    401395       
    402396
    403         from Numeric import sum
    404397
    405398        a = [0.0, 0.0]
     
    415408        A,_,_ = interp._build_interpolation_matrix_A(data)
    416409        results = A.todense()
    417         assert allclose(sum(results, axis=1), [1,1,1,0])
     410        assert numpy.allclose(numpy.sum(results, axis=1), [1,1,1,0])
    418411
    419412
     
    448441        for i in range(A.shape[0]):
    449442            for j in range(A.shape[1]):
    450                 if not allclose(A[i,j], answer[i][j]):
     443                if not numpy.allclose(A[i,j], answer[i][j]):
    451444                    print i,j,':',A[i,j], answer[i][j]
    452445
     
    454447        #results = interp._build_interpolation_matrix_A(data).todense()
    455448
    456         assert allclose(A, answer)
     449        assert numpy.allclose(A, answer)
    457450   
    458451    def test_geo_ref(self):
     
    481474        #print "z",z
    482475        #print "answer",answer
    483         assert allclose(z, answer)
     476        assert numpy.allclose(z, answer)
    484477
    485478       
     
    489482        #print "z",z
    490483        #print "answer",answer
    491         assert allclose(z, answer)
     484        assert numpy.allclose(z, answer)
    492485       
    493486     
     
    516509        #print "z",z
    517510        #print "answer",answer
    518         assert allclose(z, answer)
     511        assert numpy.allclose(z, answer)
    519512
    520513       
     
    524517        #print "z",z
    525518        #print "answer",answer
    526         assert allclose(z, answer)
     519        assert numpy.allclose(z, answer)
    527520
    528521       
     
    552545        #print "z",z
    553546        #print "answer",answer
    554         assert allclose(z, answer)
     547        assert numpy.allclose(z, answer)
    555548       
    556549        z = interp.interpolate(f, point_coords, start_blocking_len = 2)
     
    559552        #print "z",z
    560553        #print "answer",answer
    561         assert allclose(z, answer)
     554        assert numpy.allclose(z, answer)
    562555       
    563556    def test_interpolate_attributes_to_points(self):
     
    581574        #print "z",z
    582575        #print "answer",answer
    583         assert allclose(z, answer)
     576        assert numpy.allclose(z, answer)
    584577
    585578
     
    589582        #print "z",z
    590583        #print "answer",answer
    591         assert allclose(z, answer)
     584        assert numpy.allclose(z, answer)
    592585
    593586    def test_interpolate_attributes_to_pointsII(self):
     
    622615        #print "z",z
    623616        #print "answer",answer
    624         assert allclose(z, answer)
     617        assert numpy.allclose(z, answer)
    625618
    626619        z = interp.interpolate(f, point_coords, start_blocking_len = 2)
     
    629622        #print "z",z
    630623        #print "answer",answer
    631         assert allclose(z, answer)
     624        assert numpy.allclose(z, answer)
    632625       
    633626    def test_interpolate_attributes_to_pointsIII(self):
     
    683676        #print "***********"
    684677
    685         assert allclose(z, answer)
     678        assert numpy.allclose(z, answer)
    686679
    687680
     
    690683        #print "z",z
    691684        #print "answer",answer
    692         assert allclose(z, answer)
     685        assert numpy.allclose(z, answer)
    693686       
    694687    def test_interpolate_point_outside_of_mesh(self):
     
    718711
    719712        z = interp.interpolate(f, point_coords) #, verbose=True)
    720         answer = array([ [NAN, NAN, NAN, NAN]]) # (-1,-1)
     713        answer = numpy.array([ [NAN, NAN, NAN, NAN]]) # (-1,-1)
    721714
    722715        #print "***********"
     
    767760
    768761        interp = Interpolate(vertices, triangles)
    769         f = array([linear_function(vertices),2*linear_function(vertices) ])
    770         f = transpose(f)
     762        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     763        f = numpy.transpose(f)
    771764        #print "f",f
    772765        z = interp.interpolate(f, point_coords)
    773766        answer = [linear_function(point_coords),
    774767                  2*linear_function(point_coords) ]
    775         answer = transpose(answer)
     768        answer = numpy.transpose(answer)
    776769        #print "z",z
    777770        #print "answer",answer
    778         assert allclose(z, answer)
     771        assert numpy.allclose(z, answer)
    779772
    780773        z = interp.interpolate(f, point_coords, start_blocking_len = 2)
     
    782775        #print "z",z
    783776        #print "answer",answer
    784         assert allclose(z, answer)
     777        assert numpy.allclose(z, answer)
    785778
    786779    def test_interpolate_blocking(self):
     
    810803
    811804        interp = Interpolate(vertices, triangles)
    812         f = array([linear_function(vertices),2*linear_function(vertices) ])
    813         f = transpose(f)
     805        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     806        f = numpy.transpose(f)
    814807        #print "f",f
    815808        for blocking_max in range(len(point_coords)+2):
     
    820813            answer = [linear_function(point_coords),
    821814                      2*linear_function(point_coords) ]
    822             answer = transpose(answer)
     815            answer = numpy.transpose(answer)
    823816            #print "z",z
    824817            #print "answer",answer
    825             assert allclose(z, answer)
     818            assert numpy.allclose(z, answer)
    826819           
    827         f = array([linear_function(vertices),2*linear_function(vertices),
     820        f = numpy.array([linear_function(vertices),2*linear_function(vertices),
    828821                   2*linear_function(vertices) - 100  ])
    829         f = transpose(f)
     822        f = numpy.transpose(f)
    830823        #print "f",f
    831824        for blocking_max in range(len(point_coords)+2):
     
    834827            z = interp.interpolate(f, point_coords,
    835828                                   start_blocking_len=blocking_max)
    836             answer = array([linear_function(point_coords),
     829            answer = numpy.array([linear_function(point_coords),
    837830                      2*linear_function(point_coords) ,
    838831                      2*linear_function(point_coords)-100 ])
    839             z = transpose(z)
     832            z = numpy.transpose(z)
    840833            #print "z",z
    841834            #print "answer",answer
    842             assert allclose(z, answer)
     835            assert numpy.allclose(z, answer)
    843836
    844837    def test_interpolate_geo_spatial(self):
     
    872865       
    873866        interp = Interpolate(vertices, triangles)
    874         f = array([linear_function(vertices),2*linear_function(vertices) ])
    875         f = transpose(f)
     867        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     868        f = numpy.transpose(f)
    876869        #print "f",f
    877870        for blocking_max in range(14):
     
    884877                      2*linear_function(point_coords.get_data_points( \
    885878                      absolute = True)) ]
    886             answer = transpose(answer)
     879            answer = numpy.transpose(answer)
    887880            #print "z",z
    888881            #print "answer",answer
    889             assert allclose(z, answer)
     882            assert numpy.allclose(z, answer)
    890883           
    891         f = array([linear_function(vertices),2*linear_function(vertices),
     884        f = numpy.array([linear_function(vertices),2*linear_function(vertices),
    892885                   2*linear_function(vertices) - 100  ])
    893         f = transpose(f)
     886        f = numpy.transpose(f)
    894887        #print "f",f
    895888        for blocking_max in range(14):
     
    898891            z = interp.interpolate(f, point_coords,
    899892                                   start_blocking_len=blocking_max)
    900             answer = array([linear_function(point_coords.get_data_points( \
     893            answer = numpy.array([linear_function(point_coords.get_data_points( \
    901894                      absolute = True)),
    902895                      2*linear_function(point_coords.get_data_points( \
     
    904897                      2*linear_function(point_coords.get_data_points( \
    905898                      absolute = True))-100 ])
    906             z = transpose(z)
     899            z = numpy.transpose(z)
    907900            #print "z",z
    908901            #print "answer",answer
    909             assert allclose(z, answer)
     902            assert numpy.allclose(z, answer)
    910903
    911904        z = interp.interpolate(f, point_coords, start_blocking_len = 2)
     
    913906        #print "z",z
    914907        #print "answer",answer
    915         assert allclose(z, answer)
     908        assert numpy.allclose(z, answer)
    916909       
    917910    def test_interpolate_geo_spatial(self):
     
    945938       
    946939        interp = Interpolate(vertices, triangles)
    947         f = array([linear_function(vertices),2*linear_function(vertices) ])
    948         f = transpose(f)
     940        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     941        f = numpy.transpose(f)
    949942        #print "f",f
    950943        z = interp.interpolate_block(f, point_coords)
     
    953946                  2*linear_function(point_coords.get_data_points( \
    954947                      absolute = True)) ]
    955         answer = transpose(answer)
     948        answer = numpy.transpose(answer)
    956949        #print "z",z
    957950        #print "answer",answer
    958         assert allclose(z, answer)
     951        assert numpy.allclose(z, answer)
    959952           
    960953        z = interp.interpolate(f, point_coords, start_blocking_len = 2)
     
    962955        #print "z",z
    963956        #print "answer",answer
    964         assert allclose(z, answer)
     957        assert numpy.allclose(z, answer)
    965958
    966959       
     
    991984
    992985        interp = Interpolate(vertices, triangles)
    993         f = array([linear_function(vertices),2*linear_function(vertices) ])
    994         f = transpose(f)
     986        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     987        f = numpy.transpose(f)
    995988        z = interp.interpolate(f, point_coords,
    996989                               start_blocking_len=20)
    997990        answer = [linear_function(point_coords),
    998991                  2*linear_function(point_coords) ]
    999         answer = transpose(answer)
     992        answer = numpy.transpose(answer)
    1000993        #print "z",z
    1001994        #print "answer",answer
    1002         assert allclose(z, answer)
    1003         assert allclose(interp._A_can_be_reused, True)
     995        assert numpy.allclose(z, answer)
     996        assert numpy.allclose(interp._A_can_be_reused, True)
    1004997
    1005998        z = interp.interpolate(f)
    1006         assert allclose(z, answer)
     999        assert numpy.allclose(z, answer)
    10071000       
    10081001        # This causes blocking to occur.
    10091002        z = interp.interpolate(f, start_blocking_len=10)
    1010         assert allclose(z, answer)
    1011         assert allclose(interp._A_can_be_reused, False)
     1003        assert numpy.allclose(z, answer)
     1004        assert numpy.allclose(interp._A_can_be_reused, False)
    10121005
    10131006        #A is recalculated
    10141007        z = interp.interpolate(f)
    1015         assert allclose(z, answer)
    1016         assert allclose(interp._A_can_be_reused, True)
     1008        assert numpy.allclose(z, answer)
     1009        assert numpy.allclose(interp._A_can_be_reused, True)
    10171010       
    10181011        interp = Interpolate(vertices, triangles)
     
    10541047
    10551048        interp = Interpolate(vertices, triangles)
    1056         f = array([linear_function(vertices),2*linear_function(vertices) ])
    1057         f = transpose(f)
     1049        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     1050        f = numpy.transpose(f)
    10581051        z = interp.interpolate(f, point_coords)
    10591052        answer = [linear_function(point_coords),
    10601053                  2*linear_function(point_coords) ]
    1061         answer = transpose(answer)
    1062 
    1063         assert allclose(z, answer)
    1064         assert allclose(interp._A_can_be_reused, True)
     1054        answer = numpy.transpose(answer)
     1055
     1056        assert numpy.allclose(z, answer)
     1057        assert numpy.allclose(interp._A_can_be_reused, True)
    10651058
    10661059
    10671060        z = interp.interpolate(f)    # None
    1068         assert allclose(z, answer)       
     1061        assert numpy.allclose(z, answer)       
    10691062        z = interp.interpolate(f, point_coords) # Repeated (not really a test)       
    1070         assert allclose(z, answer)
     1063        assert numpy.allclose(z, answer)
    10711064       
    10721065
     
    10851078
    10861079        #One quantity
    1087         Q = zeros( (3,6), Float )
     1080        Q = numpy.zeros( (3,6), numpy.float )
    10881081
    10891082        #Linear in time and space
     
    11111104        #Check temporal interpolation
    11121105        for i in [0,1,2]:
    1113             assert allclose(I(time[i]), mean(Q[i,:]))
     1106            assert numpy.allclose(I(time[i]), mean(Q[i,:]))
    11141107
    11151108        #Midway   
    1116         assert allclose(I( (time[0] + time[1])/2 ),
     1109        assert numpy.allclose(I( (time[0] + time[1])/2 ),
    11171110                        (I(time[0]) + I(time[1]))/2 )
    11181111
    1119         assert allclose(I( (time[1] + time[2])/2 ),
     1112        assert numpy.allclose(I( (time[1] + time[2])/2 ),
    11201113                        (I(time[1]) + I(time[2]))/2 )
    11211114
    1122         assert allclose(I( (time[0] + time[2])/2 ),
     1115        assert numpy.allclose(I( (time[0] + time[2])/2 ),
    11231116                        (I(time[0]) + I(time[2]))/2 )                 
    11241117
    11251118        #1/3
    1126         assert allclose(I( (time[0] + time[2])/3 ),
     1119        assert numpy.allclose(I( (time[0] + time[2])/3 ),
    11271120                        (I(time[0]) + I(time[2]))/3 )                         
    11281121
     
    11911184        for j in range(50): #t in [1, 6]
    11921185            for id in range(len(interpolation_points)):
    1193                 assert allclose(I(t, id), answer[id])
     1186                assert numpy.allclose(I(t, id), answer[id])
    11941187            t += 0.1   
    11951188
     
    12321225
    12331226        #One quantity
    1234         Q = zeros( (3,6), Float )
     1227        Q = numpy.zeros( (3,6), numpy.float )
    12351228
    12361229        #Linear in time and space
     
    12501243        for j in range(50): #t in [1, 6]
    12511244            for id in range(len(interpolation_points)):
    1252                 assert allclose(I(t, id), t*answer[id])
     1245                assert numpy.allclose(I(t, id), t*answer[id])
    12531246            t += 0.1   
    12541247
     
    12921285
    12931286        #One quantity
    1294         Q = zeros( (8,6), Float )
     1287        Q = numpy.zeros( (8,6), numpy.float )
    12951288
    12961289        #Linear in time and space
     
    13121305        for j in range(50): #t in [1, 6]
    13131306            for id in range(len(interpolation_points)):
    1314                 assert allclose(I(t, id), t*answer[id])
     1307                assert numpy.allclose(I(t, id), t*answer[id])
    13151308            t += 0.1   
    13161309
     
    13261319
    13271320        assert len(I.time) == 4
    1328         assert( allclose(I.time, [1.0, 4.0, 7.0, 9.0] ))   
     1321        assert( numpy.allclose(I.time, [1.0, 4.0, 7.0, 9.0] ))   
    13291322
    13301323        answer = linear_function(interpolation_points)
     
    13331326        for j in range(50): #t in [1, 6]
    13341327            for id in range(len(interpolation_points)):
    1335                 assert allclose(I(t, id), t*answer[id])
     1328                assert numpy.allclose(I(t, id), t*answer[id])
    13361329            t += 0.1   
    13371330
     
    13611354
    13621355        #One quantity
    1363         Q = zeros( (2,6), Float )
     1356        Q = numpy.zeros( (2,6), numpy.float )
    13641357
    13651358        #Linear in time and space
     
    13711364       
    13721365        interp = Interpolate(points, triangles)
    1373         f = array([linear_function(points),2*linear_function(points) ])
    1374         f = transpose(f)
     1366        f = numpy.array([linear_function(points),2*linear_function(points) ])
     1367        f = numpy.transpose(f)
    13751368        #print "f",f
    13761369        z = interp.interpolate(f, interpolation_points)
    13771370        answer = [linear_function(interpolation_points),
    13781371                  2*linear_function(interpolation_points) ]
    1379         answer = transpose(answer)
     1372        answer = numpy.transpose(answer)
    13801373        #print "z",z
    13811374        #print "answer",answer
    1382         assert allclose(z, answer)
     1375        assert numpy.allclose(z, answer)
    13831376
    13841377
     
    13931386
    13941387        msg = 'Interpolation failed'
    1395         assert allclose(I.precomputed_values['Attribute'][1], [60, 60]), msg
     1388        assert numpy.allclose(I.precomputed_values['Attribute'][1], [60, 60]), msg
    13961389        #self.failUnless( I.precomputed_values['Attribute'][1] == 60.0,
    13971390        #                ' failed')
     
    14271420
    14281421        # One quantity
    1429         Q = zeros( (3,6), Float )
     1422        Q = numpy.zeros( (3,6), numpy.float )
    14301423
    14311424        # Linear in time and space
     
    14421435       
    14431436       
    1444         assert alltrue(I.precomputed_values['Attribute'][:,4] != NAN)
    1445         assert sometrue(I.precomputed_values['Attribute'][:,5] == NAN)
     1437        assert numpy.alltrue(I.precomputed_values['Attribute'][:,4] != NAN)
     1438        assert numpy.sometrue(I.precomputed_values['Attribute'][:,5] == NAN)
    14461439
    14471440        #X = I.precomputed_values['Attribute'][1,:]
     
    14551448        for j in range(50): #t in [1, 6]
    14561449            for id in range(len(interpolation_points)-1):
    1457                 assert allclose(I(t, id), t*answer[id])
     1450                assert numpy.allclose(I(t, id), t*answer[id])
    14581451            t += 0.1
    14591452           
     
    14771470       
    14781471
    1479         time = array(\
     1472        time = numpy.array(\
    14801473        [0.00000000e+00, 5.00000000e-02, 1.00000000e-01,   1.50000000e-01,
    14811474        2.00000000e-01,   2.50000000e-01,   3.00000000e-01,   3.50000000e-01,
     
    16161609
    16171610        #One quantity
    1618         Q = zeros( (len(time),6), Float )
     1611        Q = numpy.zeros( (len(time),6), numpy.float )
    16191612
    16201613        #Linear in time and space
     
    16611654
    16621655        interp = Interpolate(vertices, triangles)
    1663         f = array([linear_function(vertices),2*linear_function(vertices) ])
    1664         f = transpose(f)
     1656        f = numpy.array([linear_function(vertices),2*linear_function(vertices) ])
     1657        f = numpy.transpose(f)
    16651658        #print "f",f
    16661659        z = interp.interpolate(f, geo_data)
     
    16681661        answer = [linear_function(point_coords),
    16691662                  2*linear_function(point_coords) ]
    1670         answer = transpose(answer)
     1663        answer = numpy.transpose(answer)
    16711664        answer[2,:] = [NAN, NAN]
    16721665        answer[3,:] = [NAN, NAN]
     
    16741667        #print "z",z
    16751668        #print "answer _ fixed",answer
    1676         assert allclose(z[0:1], answer[0:1])
    1677         assert allclose(z[4:10], answer[4:10])
     1669        assert numpy.allclose(z[0:1], answer[0:1])
     1670        assert numpy.allclose(z[4:10], answer[4:10])
    16781671        for i in [2,3,11]:
    16791672            self.failUnless( z[i,1] == answer[11,1], 'Fail!')
     
    17651758                #print "velocity_answers_array", velocity_answers[i]
    17661759                msg = 'Interpolation failed'
    1767                 assert allclose(float(depths[i]), depth_answers[i]), msg
    1768                 assert allclose(float(velocitys[i]), velocity_answers[i]), msg
     1760                assert numpy.allclose(float(depths[i]), depth_answers[i]), msg
     1761                assert numpy.allclose(float(velocitys[i]), velocity_answers[i]), msg
    17691762
    17701763        velocity_y_file_handle = file(velocity_y_file)
     
    17801773                #print "velocity_answers_array", velocity_answers[i]
    17811774                msg = 'Interpolation failed'
    1782                 assert allclose(float(depths[i]), depth_answers[i]), msg
    1783                 assert allclose(float(velocitys[i]), velocity_answers[i]), msg
     1775                assert numpy.allclose(float(depths[i]), depth_answers[i]), msg
     1776                assert numpy.allclose(float(velocitys[i]), velocity_answers[i]), msg
    17841777               
    17851778        # clean up
     
    18521845        #print "z",z
    18531846        #print "answer",answer
    1854         assert allclose(z, answer)
     1847        assert numpy.allclose(z, answer)
    18551848
    18561849#-------------------------------------------------------------
  • anuga_core/source_numpy_conversion/anuga/fit_interpolate/test_search_functions.py

    r4859 r5905  
    55from search_functions import search_tree_of_vertices, set_last_triangle
    66from search_functions import _search_triangles_of_vertices
    7 
    8 
    9 from Numeric import zeros, array, allclose
    107
    118from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
Note: See TracChangeset for help on using the changeset viewer.