Ignore:
Timestamp:
Jan 15, 2009, 11:03:42 AM (16 years ago)
Author:
rwilson
Message:

Changed .array(A) to .array(A, num.Int) where appropriate. Helps when going to numpy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/mesh_engine/test_generate_mesh.py

    r6155 r6174  
    4343                              pointattlist,segattlist, mode, points)
    4444
    45         correct = num.array([(1, 0, 2), (2, 3, 1)])
     45        correct = num.array([(1, 0, 2), (2, 3, 1)], num.Int)      #array default#
    4646        self.failUnless(num.alltrue(data['generatedtrianglelist'].flat == \
    4747                                    correct.flat),
    4848                        'trianglelist is wrong!')
    49         correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)])
     49        correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)], num.Int)      #array default#
    5050        self.failUnless(num.alltrue(data['generatedsegmentlist'].flat == \
    5151                                    correct.flat),
     
    7474        data = generate_mesh(points,seglist,holelist,regionlist,
    7575                              pointattlist,segattlist, mode, points)
    76         correct = num.array([(1, 0, 2), (2, 3, 1)])
     76        correct = num.array([(1, 0, 2), (2, 3, 1)], num.Int)      #array default#
    7777        self.failUnless(num.alltrue(data['generatedtrianglelist'].flat == \
    7878                                    correct.flat),
    7979                        'trianglelist is wrong!')
    80         correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)])
     80        correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)], num.Int)      #array default#
    8181        self.failUnless(num.alltrue(data['generatedsegmentlist'].flat == \
    8282                                    correct.flat),
     
    154154                              pointattlist,segattlist, mode, points)
    155155
    156         correct = num.array([(1, 0, 2), (2, 3, 1)])
     156        correct = num.array([(1, 0, 2), (2, 3, 1)], num.Int)      #array default#
    157157        self.failUnless(num.alltrue(data['generatedtrianglelist'].flat == \
    158158                                    correct.flat),
    159159                        'trianglelist is wrong!')
    160         correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)])
     160        correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)], num.Int)      #array default#
    161161        self.failUnless(num.alltrue(data['generatedsegmentlist'].flat == \
    162162                                    correct.flat),
     
    170170       
    171171        self.failUnless(num.alltrue(data['generatedsegmentmarkerlist'] == \
    172                                     num.array([1,2,3,4])),
     172                                    num.array([1,2,3,4], num.Int)),      #array default#
    173173                        'Failed!')
    174174       
     
    388388
    389389     
    390         correct = num.array([(1, 0, 2), (2, 3, 1)])
     390        correct = num.array([(1, 0, 2), (2, 3, 1)], num.Int)      #array default#
    391391        self.failUnless(num.alltrue(data['generatedtrianglelist'].flat == \
    392392                                    correct.flat),
    393393                        'trianglelist is wrong!')
    394         correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)])
     394        correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)], num.Int)      #array default#
    395395        self.failUnless(num.alltrue(data['generatedsegmentlist'].flat == \
    396396                                    correct.flat),
     
    407407                                     correct.flat),
    408408                        'Failed')
    409         correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)])
     409        correct = num.array([(0, 1), (1, 3), (3, 2), (2, 0)], num.Int)      #array default#
    410410        self.failUnless(num.alltrue(data['generatedsegmentlist'].flat == \
    411411                                    correct.flat),
    412412                        'Failed!')
    413413       
    414         correct = num.array(segattlist)
     414        correct = num.array(segattlist, num.Int)      #array default#
    415415        self.failUnless(num.allclose(data['generatedsegmentmarkerlist'].flat,
    416416                                     correct.flat),
     
    418418       
    419419        # I copied these answers from the output, so bad test..
    420         correct = num.array([(-1, 1, -1), (-1, 0, -1)])
     420        correct = num.array([(-1, 1, -1), (-1, 0, -1)], num.Int)      #array default#
    421421        self.failUnless(num.alltrue(data['generatedtriangleneighborlist'].flat == \
    422422                                    correct.flat),
Note: See TracChangeset for help on using the changeset viewer.