Changeset 6156


Ignore:
Timestamp:
Jan 13, 2009, 3:21:30 PM (10 years ago)
Author:
rwilson
Message:

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

Location:
anuga_core/source/anuga/pmesh
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/pmesh/mesh.py

    r5931 r6156  
    2222import types
    2323import exceptions
    24 from Numeric import array, Float, Int
    2524
    2625
  • anuga_core/source/anuga/pmesh/mesh_interface.py

    r5717 r6156  
    33from anuga.utilities.polygon import  point_in_polygon ,populate_polygon
    44from anuga.utilities.numerical_tools import ensure_numeric
    5 from Numeric import Float
     5import Numeric as num
    66from anuga.utilities.polygon import inside_polygon
    77
     
    150150
    151151    # Simple check
    152     bounding_polygon = ensure_numeric(bounding_polygon, Float)
     152    bounding_polygon = ensure_numeric(bounding_polygon, num.Float)
    153153    msg = 'Bounding polygon must be a list of points or an Nx2 array'
    154154    assert len(bounding_polygon.shape) == 2, msg
  • anuga_core/source/anuga/pmesh/test_mesh.py

    r5875 r6156  
    1515from anuga.utilities.polygon import  is_inside_polygon ### inside_polygon
    1616
    17 from Numeric import alltrue, allclose
     17import Numeric as num
    1818
    1919class meshTestCase(unittest.TestCase):
     
    16581658                         'test_Mesh2IOTriangulationDict failed. test 2')
    16591659
    1660         self.failUnless( alltrue(dict['vertices'].flat == verts.flat),
     1660        self.failUnless(num.alltrue(dict['vertices'].flat == verts.flat),
    16611661                         'test_Mesh2IOTriangulationDict failed. test vert')
    1662         self.failUnless( alltrue(dict['vertex_attributes'].flat == vert_as.flat),
     1662        self.failUnless(num.alltrue(dict['vertex_attributes'].flat == vert_as.flat),
    16631663                         'test_Mesh2IOTriangulationDict failed. test vert ats')
    16641664
    1665         self.failUnless( alltrue(dict['segments'][0] == [0,1]),
     1665        self.failUnless(num.alltrue(dict['segments'][0] == [0,1]),
    16661666                        'test_Mesh2IODict failed. test 3')
    16671667       
     
    16691669                        'test_Mesh2IODict failed. test 3')
    16701670        #print " dict['triangles'][0]", dict['triangles'][0]
    1671         self.failUnless( alltrue(dict['triangles'][0] == [3,2,4]),
     1671        self.failUnless(num.alltrue(dict['triangles'][0] == [3,2,4]),
    16721672                        'test_Mesh2IODict failed. test 5')
    1673         self.failUnless( alltrue(dict['triangle_neighbors'][0] == [-1,2,3]),
     1673        self.failUnless(num.alltrue(dict['triangle_neighbors'][0] == [-1,2,3]),
    16741674                        'test_Mesh2IODict failed. test 6')
    16751675        #print "dict['triangle_tags'][0]", dict['triangle_tags'][0]
     
    21812181        vert= m.get_user_vertices(absolute=True)
    21822182       
    2183         self.failUnless(allclose(vert, points_ab),
     2183        self.failUnless(num.allclose(vert, points_ab),
    21842184                        'FAILED!')       
    21852185
     
    21982198        vert = m.get_user_vertices(absolute=True)
    21992199       
    2200         self.failUnless(alltrue(vert.flat == array(points).flat),
     2200        self.failUnless(num.alltrue(vert.flat == num.array(points).flat),
    22012201                        'FAILED!')
    22022202   
     
    22162216        vert= m.get_user_vertices(absolute=True)
    22172217       
    2218         self.failUnless(allclose(vert, points_ab),
     2218        self.failUnless(num.allclose(vert, points_ab),
    22192219                        'FAILED!')
    22202220
     
    22332233        vert= m.get_user_vertices(absolute=True)
    22342234       
    2235         self.failUnless(allclose(vert, points_ab),
     2235        self.failUnless(num.allclose(vert, points_ab),
    22362236                        'FAILED!')
    22372237
     
    22542254                        'FAILED!')
    22552255        vert= m.get_user_vertices(absolute=True)
    2256         self.failUnless(allclose(vert, points_ab),
     2256        self.failUnless(num.allclose(vert, points_ab),
    22572257                        'FAILED!')
    22582258        vert= m.get_user_vertices(absolute=False)
    22592259        points_new = m.geo_reference.get_absolute(vert)
    22602260       
    2261         self.failUnless(allclose(points_ab, points_new),
     2261        self.failUnless(num.allclose(points_ab, points_new),
    22622262                        'FAILED!')
    22632263
  • anuga_core/source/anuga/pmesh/view_tsh.py

    r3564 r6156  
    1111from anuga.pyvolution.util import file_function
    1212from anuga.utilities.polygon import Polygon_function, read_polygon
    13 from Numeric import zeros, Float, maximum, minimum
    1413from realtime_visualisation_new import *
    1514
Note: See TracChangeset for help on using the changeset viewer.