Changeset 6152


Ignore:
Timestamp:
Jan 13, 2009, 2:20:31 PM (10 years ago)
Author:
rwilson
Message:

Change Numeric imports to general form - ready to change to NumPy?.

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

Legend:

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

    r4872 r6152  
    2323import profile , pstats
    2424from math import sqrt
    25 from Numeric import array
    2625
    2726from anuga.fit_interpolate.search_functions import search_times, \
     
    3837from anuga.fit_interpolate.general_fit_interpolate import \
    3938     get_build_quadtree_time
     39
    4040
    4141"""
  • anuga_core/source/anuga/fit_interpolate/fit.py

    r5855 r6152  
    2828import types
    2929
    30 from Numeric import zeros, Float, ArrayType,take, Int
    31 
    3230from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
    3331from anuga.caching import cache           
     
    4644class TooFewPointsError(exceptions.Exception): pass
    4745class VertsWithNoTrianglesError(exceptions.Exception): pass
     46
     47import Numeric as num
     48
    4849
    4950#DEFAULT_ALPHA = 0.001
     
    252253            if len(z.shape) > 1:
    253254                att_num = z.shape[1]
    254                 self.Atz = zeros((m,att_num), Float)
     255                self.Atz = num.zeros((m,att_num), num.Float)
    255256            else:
    256257                att_num = 1
    257                 self.Atz = zeros((m,), Float)
     258                self.Atz = num.zeros((m,), num.Float)
    258259            assert z.shape[0] == point_coordinates.shape[0]
    259260
     
    437438        # Convert input to Numeric arrays
    438439        if z is not None:
    439             z = ensure_numeric(z, Float)
     440            z = ensure_numeric(z, num.Float)
    440441        else:
    441442            msg = 'z not specified'
     
    443444            z = point_coordinates.get_attributes(attribute_name)
    444445
    445         point_coordinates = ensure_numeric(point_coordinates, Float)
     446        point_coordinates = ensure_numeric(point_coordinates, num.Float)
    446447        self._build_matrix_AtA_Atz(point_coordinates, z, verbose)
    447448
     
    584585           
    585586        #Convert input to Numeric arrays
    586         triangles = ensure_numeric(triangles, Int)
     587        triangles = ensure_numeric(triangles, num.Int)
    587588        vertex_coordinates = ensure_absolute(vertex_coordinates,
    588589                                             geo_reference = mesh_origin)
     
    651652    vertex_coordinates = mesh_dict['vertices']
    652653    triangles = mesh_dict['triangles']
    653     if type(mesh_dict['vertex_attributes']) == ArrayType:
     654    if type(mesh_dict['vertex_attributes']) == num.ArrayType:
    654655        old_point_attributes = mesh_dict['vertex_attributes'].tolist()
    655656    else:
    656657        old_point_attributes = mesh_dict['vertex_attributes']
    657658
    658     if type(mesh_dict['vertex_attribute_titles']) == ArrayType:
     659    if type(mesh_dict['vertex_attribute_titles']) == num.ArrayType:
    659660        old_title_list = mesh_dict['vertex_attribute_titles'].tolist()
    660661    else:
  • anuga_core/source/anuga/fit_interpolate/general_fit_interpolate.py

    r5361 r6152  
    2121from warnings import warn
    2222
    23 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, \
    24      ArrayType, allclose, take, NewAxis, arange
    25 
    2623from anuga.caching.caching import cache
    2724from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
     
    3734     ensure_absolute
    3835from anuga.fit_interpolate.search_functions import set_last_triangle
     36
     37import Numeric as num
     38
    3939
    4040# tests fail if 2 is used
     
    9797           
    9898                #Convert input to Numeric arrays
    99                 triangles = ensure_numeric(triangles, Int)
     99                triangles = ensure_numeric(triangles, num.Int)
    100100                vertex_coordinates = ensure_absolute(vertex_coordinates,
    101101                                                 geo_reference = mesh_origin)
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r6086 r6152  
    2424from math import sqrt
    2525from csv import writer, DictWriter
    26 
    27 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, \
    28      ArrayType, allclose, take, NewAxis, arange
    2926
    3027from anuga.caching.caching import cache
     
    4138from anuga.abstract_2d_finite_volumes.util import file_function
    4239from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
     40
     41import Numeric as num
     42
    4343
    4444# Interpolation specific exceptions
     
    130130
    131131    # Create interpolation object with matrix
    132     args = (ensure_numeric(vertex_coordinates, Float),
     132    args = (ensure_numeric(vertex_coordinates, num.Float),
    133133            ensure_numeric(triangles))
    134134    kwargs = {'mesh_origin': mesh_origin,
     
    253253 
    254254        from utilities.polygon import point_on_line
    255         from Numeric import ones
    256 
    257         z = ones(len(point_coordinates), Float)
     255
     256        z = num.ones(len(point_coordinates), num.Float)
    258257
    259258        # input sanity check
     
    379378                # creating a dummy array to concatenate to.
    380379               
    381                 f = ensure_numeric(f, Float)
     380                f = ensure_numeric(f, num.Float)
    382381                if len(f.shape) > 1:
    383                     z = zeros((0, f.shape[1]))
     382                    z = num.zeros((0, f.shape[1]))
    384383                else:
    385                     z = zeros((0,))
     384                    z = num.zeros((0,))
    386385                   
    387386                for end in range(start_blocking_len,
     
    390389                    t = self.interpolate_block(f, point_coordinates[start:end],
    391390                                               verbose=verbose)
    392                     z = concatenate((z, t))
     391                    z = num.concatenate((z, t))
    393392                    start = end
    394393
     
    396395                t = self.interpolate_block(f, point_coordinates[start:end],
    397396                                           verbose=verbose)
    398                 z = concatenate((z, t))
     397                z = num.concatenate((z, t))
    399398        return z
    400399   
     
    426425
    427426        # Convert lists to Numeric arrays if necessary
    428         point_coordinates = ensure_numeric(point_coordinates, Float)
    429         f = ensure_numeric(f, Float)               
     427        point_coordinates = ensure_numeric(point_coordinates, num.Float)
     428        f = ensure_numeric(f, num.Float)               
    430429
    431430        from anuga.caching import myhash
    432         from Numeric import alltrue
    433431        import sys
    434432         
     
    452450                if self.interpolation_matrices.has_key(key):
    453451                    X, stored_points = self.interpolation_matrices[key]
    454                     if alltrue(stored_points == point_coordinates):
     452                    if num.alltrue(stored_points == point_coordinates):
    455453                        reuse_A = True          # Reuse interpolation matrix
    456454               
     
    534532
    535533        # Convert point_coordinates to Numeric arrays, in case it was a list.
    536         point_coordinates = ensure_numeric(point_coordinates, Float)
     534        point_coordinates = ensure_numeric(point_coordinates, num.Float)
    537535
    538536        if verbose: print 'Getting indices inside mesh boundary'
     
    838836        """
    839837
    840         from Numeric import array, zeros, Float, alltrue, concatenate,\
    841              reshape, ArrayType
    842 
    843838        from anuga.config import time_format
    844839        import types
     
    847842        time = ensure_numeric(time)       
    848843        msg = 'Time must be a monotonuosly increasing sequence %s' % time
    849         assert alltrue(time[1:] - time[:-1] >= 0), msg
     844        assert num.alltrue(time[1:] - time[:-1] >= 0), msg
    850845
    851846        # Check if quantities is a single array only
     
    875870        # Thin timesteps if needed
    876871        # Note array() is used to make the thinned arrays contiguous in memory
    877         self.time = array(time[::time_thinning])         
     872        self.time = num.array(time[::time_thinning])         
    878873        for name in quantity_names:
    879874            if len(quantities[name].shape) == 2:
    880                 quantities[name] = array(quantities[name][::time_thinning,:])
     875                quantities[name] = num.array(quantities[name][::time_thinning,:])
    881876             
    882877        # Save for use with statistics
     
    941936                            # FIXME (Ole): Why only Windoze?
    942937                            from anuga.utilities.polygon import plot_polygons
    943                             #out_interp_pts = take(interpolation_points,[indices])
     938                            #out_interp_pts = num.take(interpolation_points,[indices])
    944939                            title = ('Interpolation points fall '
    945940                                     'outside specified mesh')
     
    986981           
    987982            for name in quantity_names:
    988                 self.precomputed_values[name] = zeros((p, m), Float)
     983                self.precomputed_values[name] = num.zeros((p, m), num.Float)
    989984
    990985            # Build interpolator
     
    10861081
    10871082        from math import pi, cos, sin, sqrt
    1088         from Numeric import zeros, Float
    10891083        from anuga.abstract_2d_finite_volumes.util import mean       
    10901084
     
    11221116
    11231117        # Compute interpolated values
    1124         q = zeros(len(self.quantity_names), Float)
     1118        q = num.zeros(len(self.quantity_names), num.Float)
    11251119        for i, name in enumerate(self.quantity_names):
    11261120            Q = self.precomputed_values[name]
     
    11661160                    return q
    11671161                else:
    1168                     from Numeric import ones, Float
    11691162                    # x is a vector - Create one constant column for each value
    11701163                    N = len(x)
     
    11721165                    res = []
    11731166                    for col in q:
    1174                         res.append(col*ones(N, Float))
     1167                        res.append(col*num.ones(N, num.Float))
    11751168                       
    11761169                return res
     
    12571250
    12581251    #Add the x and y together
    1259     vertex_coordinates = concatenate((x[:,NewAxis], y[:,NewAxis]),axis=1)
     1252    vertex_coordinates = num.concatenate((x[:,num.NewAxis], y[:,num.NewAxis]),axis=1)
    12601253
    12611254    #Will return the quantity values at the specified times and locations
  • anuga_core/source/anuga/fit_interpolate/search_functions.py

    r5775 r6152  
    66
    77"""
    8 from Numeric import dot
    98import time
    10 
    11 from Numeric import array
    129
    1310from anuga.utilities.numerical_tools import get_machine_precision
    1411from anuga.config import max_float
     12
     13import Numeric as num
     14
    1515
    1616initial_search_value = 'uncomment search_functions code first'#0
     
    1919
    2020#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]))]]]
     21LAST_TRIANGLE = [[-10,[(num.array([max_float,max_float]),
     22                        num.array([max_float,max_float]),
     23                        num.array([max_float,max_float])),
     24                       (num.array([1,1]),num.array([0,0]),num.array([-1.1,-1.1]))]]]
    2525
    2626def search_tree_of_vertices(root, mesh, x):
     
    189189    # print "dot((xi0-xi1), n0)", dot((xi0-xi1), n0)
    190190   
    191     sigma0 = dot((x-xi1), n0)/dot((xi0-xi1), n0)
     191    sigma0 = num.dot((x-xi1), n0)/num.dot((xi0-xi1), n0)
    192192    if sigma0 < -epsilon:
    193193        return False,0,0,0
    194     sigma1 = dot((x-xi2), n1)/dot((xi1-xi2), n1)
     194    sigma1 = num.dot((x-xi2), n1)/num.dot((xi1-xi2), n1)
    195195    if sigma1 < -epsilon:
    196196        return False,0,0,0
    197     sigma2 = dot((x-xi0), n2)/dot((xi2-xi0), n2)
     197    sigma2 = num.dot((x-xi0), n2)/num.dot((xi2-xi0), n2)
    198198    if sigma2 < -epsilon:
    199199        return False,0,0,0
  • anuga_core/source/anuga/fit_interpolate/test_fit.py

    r5349 r6152  
    1212import tempfile
    1313import os
    14 from Numeric import zeros, take, compress, Float, Int, dot, concatenate, \
    15      ArrayType, allclose, array
    1614
    1715from fit import *
     
    2321from anuga.shallow_water import Domain
    2422
     23import Numeric as num
     24
     25
    2526def distance(x, y):
    26     return sqrt( sum( (array(x)-array(y))**2 ))
     27    return sqrt( sum( (num.array(x)-num.array(y))**2 ))
    2728
    2829def linear_function(point):
    29     point = array(point)
     30    point = num.array(point)
    3031    return point[:,0]+point[:,1]
    3132
     
    6465        #print "z",z
    6566
    66         assert allclose(fit.Atz, [2.8, 3.6, 3.6], atol=1e-7)
     67        assert num.allclose(fit.Atz, [2.8, 3.6, 3.6], atol=1e-7)
    6768
    6869        f = fit.fit()
     
    7374        #print "answer\n",answer
    7475
    75         assert allclose(f, answer, atol=1e-7)
     76        assert num.allclose(f, answer, atol=1e-7)
    7677
    7778    def test_smooth_att_to_meshII(self):
     
    9697        #print "answer\n",answer
    9798
    98         assert allclose(f, answer)
     99        assert num.allclose(f, answer)
    99100
    100101    def test_smooth_attributes_to_meshIII(self):
     
    132133        #print "f\n",f
    133134        #print "answer\n",answer
    134         assert allclose(f, answer)
     135        assert num.allclose(f, answer)
    135136
    136137   
     
    158159        f =  fit.fit(data_coords,z)
    159160        answer = [[0,0], [5., 10.], [5., 10.]]
    160         assert allclose(f, answer)
     161        assert num.allclose(f, answer)
    161162
    162163    def test_smooth_attributes_to_mesh_build_fit_subset(self):
     
    204205        #print "f\n",f
    205206        #print "answer\n",answer
    206         assert allclose(f, answer)
     207        assert num.allclose(f, answer)
    207208
    208209        # test fit 2 mesh as well.
     
    244245        #print "f\n",f
    245246        #print "answer\n",answer
    246         assert allclose(f, answer)
     247        assert num.allclose(f, answer)
    247248        os.remove(fileName)
    248249
     
    280281        #print "f",f
    281282        #print "answer",answer
    282         assert allclose(f, answer)
     283        assert num.allclose(f, answer)
    283284
    284285        # Delete file!
     
    323324        #print "f\n",f
    324325        #print "answer\n",answer
    325         assert allclose(f, answer)
     326        assert num.allclose(f, answer)
    326327        os.remove(fileName)
    327328       
     
    362363        #print "f\n",f
    363364        #print "answer\n",answer
    364         assert allclose(f, answer)
     365        assert num.allclose(f, answer)
    365366        os.remove(fileName)
    366367        os.remove(fileName_pts)
     
    402403        #print "f\n",f
    403404        #print "answer\n",answer
    404         assert allclose(f, answer)
     405        assert num.allclose(f, answer)
    405406        os.remove(fileName)
    406407        os.remove(fileName_pts)
     
    442443        #print "f\n",f
    443444        #print "answer\n",answer
    444         assert allclose(f, answer)
     445        assert num.allclose(f, answer)
    445446   
    446447        os.remove(fileName)
     
    483484        #print "f\n",f
    484485        #print "answer\n",answer
    485         assert allclose(f, answer)
     486        assert num.allclose(f, answer)
    486487        os.remove(fileName)
    487488       
     
    524525        #print "f",f
    525526        #print "answer",answer
    526         assert allclose(f, answer)
     527        assert num.allclose(f, answer)
    527528
    528529       
     
    562563        f = interp.fit(data_points,z)
    563564        #f will be different from answer due to smoothing
    564         assert allclose(f, answer,atol=5)
     565        assert num.allclose(f, answer,atol=5)
    565566
    566567
    567568    #Tests of smoothing matrix
    568569    def test_smoothing_matrix_one_triangle(self):
    569         from Numeric 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],
    580                                    [-0.5, 0.5, 0],
    581                                    [-0.5, 0, 0.5]])
     579        assert num.allclose(interp.get_D(), [[1, -0.5, -0.5],
     580                                             [-0.5, 0.5, 0],
     581                                             [-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 = num.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 num.dot(num.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 = num.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 num.dot(num.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 = num.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 num.dot(num.dot(f, interp.get_D()), f) == 4
    603603
    604604
    605605    def test_smoothing_matrix_more_triangles(self):
    606         from Numeric import dot
    607 
    608606        a = [0.0, 0.0]
    609607        b = [0.0, 2.0]
     
    625623
    626624        #Define f(x,y) = x
    627         f = array([0,0,2,0,2,4]) #f evaluated at points a-f
     625        f = num.array([0,0,2,0,2,4]) #f evaluated at points a-f
    628626
    629627        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    630628        #           int 1 dx dy = total area = 8
    631         assert dot(dot(f, interp.get_D()), f) == 8
     629        assert num.dot(num.dot(f, interp.get_D()), f) == 8
    632630
    633631        #Define f(x,y) = y
    634         f = array([0,2,0,4,2,0]) #f evaluated at points a-f
     632        f = num.array([0,2,0,4,2,0]) #f evaluated at points a-f
    635633
    636634        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    637635        #           int 1 dx dy = area = 8
    638         assert dot(dot(f, interp.get_D()), f) == 8
     636        assert num.dot(num.dot(f, interp.get_D()), f) == 8
    639637
    640638        #Define f(x,y) = x+y
    641         f = array([0,2,2,4,4,4])  #f evaluated at points a-f
     639        f = num.array([0,2,2,4,4,4])  #f evaluated at points a-f
    642640
    643641        #Check that int (df/dx)**2 + (df/dy)**2 dx dy =
    644642        #           int 2 dx dy = 2*area = 16
    645         assert dot(dot(f, interp.get_D()), f) == 16
     643        assert num.dot(num.dot(f, interp.get_D()), f) == 16
    646644
    647645
     
    709707        f1 = interp.fit(data_points1,z)
    710708
    711         assert allclose(f,f1), 'Fit should have been unaltered'
     709        assert num.allclose(f,f1), 'Fit should have been unaltered'
    712710
    713711
     
    736734        answer = [[0, 0], [5., 10.], [5., 10.]]
    737735
    738         assert allclose(f, answer)
     736        assert num.allclose(f, answer)
    739737
    740738    def test_fit_to_mesh_w_georef(self):
     
    773771                         mesh_origin = mesh_geo.get_origin(),
    774772                         alpha = 0)
    775         assert allclose( zz, [0,5,5] )
     773        assert num.allclose( zz, [0,5,5] )
    776774
    777775
     
    819817              [5.0, 10.0],
    820818              [5.0,10.0]]
    821         assert allclose(mesh_dic['vertex_attributes'],ans)
     819        assert num.allclose(mesh_dic['vertex_attributes'],ans)
    822820
    823821        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
     
    827825       
    828826        answer = [0., 5., 5.]
    829         assert allclose(domain.quantities['elevation'].vertex_values,
    830                         answer)
     827        assert num.allclose(domain.quantities['elevation'].vertex_values,
     828                            answer)
    831829        #clean up
    832830        os.remove(mesh_file)
     
    878876              [5.0, 10.0],
    879877              [5.0,10.0]]
    880         assert allclose(mesh_dic['vertex_attributes'],ans)
     878        assert num.allclose(mesh_dic['vertex_attributes'],ans)
    881879
    882880        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
     
    929927        mesh_dic = import_mesh_file(mesh_output_file)
    930928
    931         assert allclose(mesh_dic['vertex_attributes'],
    932                         [[1.0, 2.0,0.0, 0.0],
    933                          [1.0, 2.0,5.0, 10.0],
    934                          [1.0, 2.0,5.0,10.0]])
     929        assert num.allclose(mesh_dic['vertex_attributes'],
     930                            [[1.0, 2.0,0.0, 0.0],
     931                             [1.0, 2.0,5.0, 10.0],
     932                             [1.0, 2.0,5.0,10.0]])
    935933
    936934        self.failUnless(mesh_dic['vertex_attribute_titles']  ==
  • anuga_core/source/anuga/fit_interpolate/test_interpolate.py

    r5775 r6152  
    1414
    1515from Scientific.IO.NetCDF import NetCDFFile
    16 from Numeric import allclose, array, transpose, zeros, Float, sometrue, \
    17      alltrue, take, where
     16
     17import Numeric as num
     18
    1819
    1920
     
    2829
    2930def distance(x, y):
    30     return sqrt( sum( (array(x)-array(y))**2 ))
     31    return sqrt( num.sum( (num.array(x)-num.array(y))**2 ))
    3132
    3233def linear_function(point):
    33     point = array(point)
     34    point = num.array(point)
    3435    return point[:,0]+point[:,1]
    3536
     
    6667
    6768        bed = domain.quantities['elevation'].vertex_values
    68         stage = zeros(bed.shape, Float)
     69        stage = num.zeros(bed.shape, num.Float)
    6970
    7071        h = 0.3
     
    104105        interp = Interpolate(points, vertices)
    105106        A, _, _ = interp._build_interpolation_matrix_A(data)
    106         assert allclose(A.todense(),
    107                         [[1./3, 1./3, 1./3]])
     107        assert num.allclose(A.todense(), [[1./3, 1./3, 1./3]])
    108108
    109109
     
    113113        from mesh_factory import rectangular
    114114        from shallow_water import Domain
    115         from Numeric import zeros, Float
    116115        from abstract_2d_finite_volumes.quantity import Quantity
    117116
     
    130129
    131130        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    132         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     131        vertex_coordinates = num.concatenate( (x[:, num.NewAxis], y[:, num.NewAxis]), axis=1 )
    133132        # FIXME: This concat should roll into get_vertex_values
    134133
     
    140139        I = Interpolate(vertex_coordinates, triangles)
    141140        result = I.interpolate(vertex_values, interpolation_points)
    142         assert allclose(result, answer)
     141        assert num.allclose(result, answer)
    143142
    144143
     
    150149       
    151150        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    152         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     151        vertex_coordinates = num.concatenate( (x[:, num.NewAxis], y[:, num.NewAxis]), axis=1 )
    153152        # FIXME: This concat should roll into get_vertex_values
    154153
     
    160159        I = Interpolate(vertex_coordinates, triangles)
    161160        result = I.interpolate(vertex_values, interpolation_points)
    162         assert allclose(result, answer)       
     161        assert num.allclose(result, answer)       
    163162       
    164163
     
    167166        from mesh_factory import rectangular
    168167        from shallow_water import Domain
    169         from Numeric import zeros, Float
    170168        from abstract_2d_finite_volumes.quantity import Quantity
    171169
     
    184182
    185183        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    186         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     184        vertex_coordinates = num.concatenate( (x[:, num.NewAxis], y[:, num.NewAxis]), axis=1 )
    187185        # FIXME: This concat should roll into get_vertex_values
    188186
     
    193191
    194192        result = interpolate(vertex_coordinates, triangles, vertex_values, interpolation_points)
    195         assert allclose(result, answer)
     193        assert num.allclose(result, answer)
    196194
    197195
     
    203201       
    204202        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    205         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     203        vertex_coordinates = num.concatenate( (x[:, num.NewAxis], y[:, num.NewAxis]), axis=1 )
    206204        # FIXME: This concat should roll into get_vertex_values
    207205
     
    213211        result = interpolate(vertex_coordinates, triangles,
    214212                             vertex_values, interpolation_points)
    215         assert allclose(result, answer)       
     213        assert num.allclose(result, answer)       
    216214       
    217215       
     
    220218        from mesh_factory import rectangular
    221219        from shallow_water import Domain
    222         from Numeric import zeros, Float
    223220        from abstract_2d_finite_volumes.quantity import Quantity
    224221
     
    236233       
    237234        x, y, vertex_values, triangles = quantity.get_vertex_values(xy=True, smooth=False)
    238         vertex_coordinates = concatenate( (x[:, NewAxis], y[:, NewAxis]), axis=1 )
     235        vertex_coordinates = num.concatenate( (x[:, num.NewAxis], y[:, num.NewAxis]), axis=1 )
    239236        # FIXME: This concat should roll into get_vertex_values
    240237
     
    248245                             use_cache=True,
    249246                             verbose=False)
    250         assert allclose(result, answer)               
     247        assert num.allclose(result, answer)               
    251248       
    252249        # Second call using the cache
     
    255252                             use_cache=True,
    256253                             verbose=False)
    257         assert allclose(result, answer)                       
     254        assert num.allclose(result, answer)                       
    258255       
    259256       
     
    289286
    290287        A,_,_ = interp._build_interpolation_matrix_A(data)
    291         assert allclose(A.todense(), answer)
     288        assert num.allclose(A.todense(), answer)
    292289       
    293290        #interp.set_point_coordinates([[-30, -30]]) #point outside of mesh
     
    298295       
    299296        A,_,_ = interp._build_interpolation_matrix_A(data)       
    300         assert allclose(A.todense(), answer)
     297        assert num.allclose(A.todense(), answer)
    301298
    302299
     
    309306                     
    310307        A,_,_ = interp._build_interpolation_matrix_A(data)       
    311         assert allclose(A.todense(), answer)
     308        assert num.allclose(A.todense(), answer)
    312309
    313310
     
    330327                   
    331328        A,_,_ = interp._build_interpolation_matrix_A(data)
    332         assert allclose(A.todense(), answer)
     329        assert num.allclose(A.todense(), answer)
    333330
    334331
     
    351348
    352349        A,_,_ = interp._build_interpolation_matrix_A(data)
    353         assert allclose(A.todense(), answer)
     350        assert num.allclose(A.todense(), answer)
    354351
    355352    def test_datapoints_on_edges(self):
     
    372369
    373370        A,_,_ = interp._build_interpolation_matrix_A(data)
    374         assert allclose(A.todense(), answer)
     371        assert num.allclose(A.todense(), answer)
    375372
    376373
     
    378375        #Try arbitrary datapoints
    379376       
    380 
    381         from Numeric import sum
    382377
    383378        a = [0.0, 0.0]
     
    394389        A,_,_ = interp._build_interpolation_matrix_A(data)
    395390        results = A.todense()
    396         assert allclose(sum(results, axis=1), 1.0)
     391        assert num.allclose(num.sum(results, axis=1), 1.0)
    397392
    398393    def test_arbitrary_datapoints_some_outside(self):
     
    400395        #That one should be ignored
    401396       
    402 
    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 num.allclose(num.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 num.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 num.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 num.allclose(z, answer)
    484477
    485478       
     
    489482        #print "z",z
    490483        #print "answer",answer
    491         assert allclose(z, answer)
     484        assert num.allclose(z, answer)
    492485       
    493486     
     
    516509        #print "z",z
    517510        #print "answer",answer
    518         assert allclose(z, answer)
     511        assert num.allclose(z, answer)
    519512
    520513       
     
    524517        #print "z",z
    525518        #print "answer",answer
    526         assert allclose(z, answer)
     519        assert num.allclose(z, answer)
    527520
    528521       
     
    552545        #print "z",z
    553546        #print "answer",answer
    554         assert allclose(z, answer)
     547        assert num.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 num.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 num.allclose(z, answer)
    584577
    585578
     
    589582        #print "z",z
    590583        #print "answer",answer
    591         assert allclose(z, answer)
     584        assert num.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 num.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 num.allclose(z, answer)
    632625       
    633626    def test_interpolate_attributes_to_pointsIII(self):
     
    683676        #print "***********"
    684677
    685         assert allclose(z, answer)
     678        assert num.allclose(z, answer)
    686679
    687680
     
    690683        #print "z",z
    691684        #print "answer",answer
    692         assert allclose(z, answer)
     685        assert num.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 = num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     763        f = num.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 = num.transpose(answer)
    776769        #print "z",z
    777770        #print "answer",answer
    778         assert allclose(z, answer)
     771        assert num.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 num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     806        f = num.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 = num.transpose(answer)
    823816            #print "z",z
    824817            #print "answer",answer
    825             assert allclose(z, answer)
     818            assert num.allclose(z, answer)
    826819           
    827         f = array([linear_function(vertices),2*linear_function(vertices),
    828                    2*linear_function(vertices) - 100  ])
    829         f = transpose(f)
     820        f = num.array([linear_function(vertices),2*linear_function(vertices),
     821                       2*linear_function(vertices) - 100  ])
     822        f = num.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),
    837                       2*linear_function(point_coords) ,
    838                       2*linear_function(point_coords)-100 ])
    839             z = transpose(z)
     829            answer = num.array([linear_function(point_coords),
     830                                2*linear_function(point_coords) ,
     831                                2*linear_function(point_coords)-100 ])
     832            z = num.transpose(z)
    840833            #print "z",z
    841834            #print "answer",answer
    842             assert allclose(z, answer)
     835            assert num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     868        f = num.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 = num.transpose(answer)
    887880            #print "z",z
    888881            #print "answer",answer
    889             assert allclose(z, answer)
     882            assert num.allclose(z, answer)
    890883           
    891         f = array([linear_function(vertices),2*linear_function(vertices),
    892                    2*linear_function(vertices) - 100  ])
    893         f = transpose(f)
     884        f = num.array([linear_function(vertices),2*linear_function(vertices),
     885                       2*linear_function(vertices) - 100  ])
     886        f = num.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( \
    901                       absolute = True)),
    902                       2*linear_function(point_coords.get_data_points( \
    903                       absolute = True)) ,
    904                       2*linear_function(point_coords.get_data_points( \
    905                       absolute = True))-100 ])
    906             z = transpose(z)
     893            answer = num.array([linear_function(point_coords.get_data_points( \
     894                                                              absolute = True)),
     895                                                              2*linear_function(point_coords.get_data_points( \
     896                                                              absolute = True)) ,
     897                                                              2*linear_function(point_coords.get_data_points( \
     898                                                              absolute = True))-100 ])
     899            z = num.transpose(z)
    907900            #print "z",z
    908901            #print "answer",answer
    909             assert allclose(z, answer)
     902            assert num.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 num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     941        f = num.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 = num.transpose(answer)
    956949        #print "z",z
    957950        #print "answer",answer
    958         assert allclose(z, answer)
     951        assert num.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 num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     987        f = num.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 = num.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 num.allclose(z, answer)
     996        assert num.allclose(interp._A_can_be_reused, True)
    1004997
    1005998        z = interp.interpolate(f)
    1006         assert allclose(z, answer)
     999        assert num.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 num.allclose(z, answer)
     1004        assert num.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 num.allclose(z, answer)
     1009        assert num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     1050        f = num.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 = num.transpose(answer)
     1055
     1056        assert num.allclose(z, answer)
     1057        assert num.allclose(interp._A_can_be_reused, True)
    10651058
    10661059
    10671060        z = interp.interpolate(f)    # None
    1068         assert allclose(z, answer)       
     1061        assert num.allclose(z, answer)       
    10691062        z = interp.interpolate(f, point_coords) # Repeated (not really a test)       
    1070         assert allclose(z, answer)
     1063        assert num.allclose(z, answer)
    10711064       
    10721065
     
    10851078
    10861079        #One quantity
    1087         Q = zeros( (3,6), Float )
     1080        Q = num.zeros( (3,6), num.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 num.allclose(I(time[i]), mean(Q[i,:]))
    11141107
    11151108        #Midway   
    1116         assert allclose(I( (time[0] + time[1])/2 ),
    1117                         (I(time[0]) + I(time[1]))/2 )
    1118 
    1119         assert allclose(I( (time[1] + time[2])/2 ),
    1120                         (I(time[1]) + I(time[2]))/2 )
    1121 
    1122         assert allclose(I( (time[0] + time[2])/2 ),
    1123                         (I(time[0]) + I(time[2]))/2 )                 
     1109        assert num.allclose(I( (time[0] + time[1])/2 ),
     1110                            (I(time[0]) + I(time[1]))/2 )
     1111
     1112        assert num.allclose(I( (time[1] + time[2])/2 ),
     1113                            (I(time[1]) + I(time[2]))/2 )
     1114
     1115        assert num.allclose(I( (time[0] + time[2])/2 ),
     1116                            (I(time[0]) + I(time[2]))/2 )                 
    11241117
    11251118        #1/3
    1126         assert allclose(I( (time[0] + time[2])/3 ),
    1127                         (I(time[0]) + I(time[2]))/3 )                         
     1119        assert num.allclose(I( (time[0] + time[2])/3 ),
     1120                            (I(time[0]) + I(time[2]))/3 )                         
    11281121
    11291122
     
    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 num.allclose(I(t, id), answer[id])
    11941187            t += 0.1   
    11951188
     
    12321225
    12331226        #One quantity
    1234         Q = zeros( (3,6), Float )
     1227        Q = num.zeros( (3,6), num.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 num.allclose(I(t, id), t*answer[id])
    12531246            t += 0.1   
    12541247
     
    12921285
    12931286        #One quantity
    1294         Q = zeros( (8,6), Float )
     1287        Q = num.zeros( (8,6), num.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 num.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( num.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 num.allclose(I(t, id), t*answer[id])
    13361329            t += 0.1   
    13371330
     
    13611354
    13621355        #One quantity
    1363         Q = zeros( (2,6), Float )
     1356        Q = num.zeros( (2,6), num.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 = num.array([linear_function(points),2*linear_function(points) ])
     1367        f = num.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 = num.transpose(answer)
    13801373        #print "z",z
    13811374        #print "answer",answer
    1382         assert allclose(z, answer)
     1375        assert num.allclose(z, answer)
    13831376
    13841377
     
    13931386
    13941387        msg = 'Interpolation failed'
    1395         assert allclose(I.precomputed_values['Attribute'][1], [60, 60]), msg
     1388        assert num.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 = num.zeros( (3,6), num.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 num.alltrue(I.precomputed_values['Attribute'][:,4] != NAN)
     1438        assert num.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 num.allclose(I(t, id), t*answer[id])
    14581451            t += 0.1
    14591452           
     
    14771470       
    14781471
    1479         time = array(\
     1472        time = num.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 = num.zeros( (len(time),6), num.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 = num.array([linear_function(vertices),2*linear_function(vertices) ])
     1657        f = num.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 = num.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 num.allclose(z[0:1], answer[0:1])
     1670        assert num.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 num.allclose(float(depths[i]), depth_answers[i]), msg
     1761                assert num.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 num.allclose(float(depths[i]), depth_answers[i]), msg
     1776                assert num.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 num.allclose(z, answer)
    18551848
    18561849#-------------------------------------------------------------
  • anuga_core/source/anuga/fit_interpolate/test_search_functions.py

    r4859 r6152  
    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.