Ignore:
Timestamp:
Apr 3, 2005, 3:58:16 PM (20 years ago)
Author:
prow
Message:

testing stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/test_data_manager.py

    r1178 r1188  
    15561556
    15571557    #def test_weed(self):
    1558         #from data_manager import weed
    1559 
    1560         #coordinates1 = [[0.,0.],[1.,0.],[1.,1.],[1.,0.],[2.,0.],[1.,1.]]
    1561         #volumes1 = [[0,1,2],[3,4,5]]
    1562         #boundary1= {(0,1): 'external',(1,2): 'not external',(2,0): 'external',(3,4): 'external',(4,5): 'external',(5,3): 'not external'}
    1563         #unique2,coordinates2,volumes2,boundary2=weed(coordinates1,volumes1,boundary1)
    1564         #print 'coordinates2'
    1565         #print coordinates2
    1566         #print 'volumes2'
    1567         #print volumes2
    1568         #print 'boundary2'
    1569         #print boundary2
    1570 
     1558        from data_manager import weed
     1559
     1560        coordinates1 = [[0.,0.],[1.,0.],[1.,1.],[1.,0.],[2.,0.],[1.,1.]]
     1561        volumes1 = [[0,1,2],[3,4,5]]
     1562        boundary1= {(0,1): 'external',(1,2): 'not external',(2,0): 'external',(3,4): 'external',(4,5): 'external',(5,3): 'not external'}
     1563        unique2,coordinates2,volumes2,boundary2=weed(coordinates1,volumes1,boundary1)
     1564
     1565        points2 = {(0.,0.):None,(1.,0.):None,(1.,1.):None,(2.,0.):None}       
     1566
     1567        assert len(points2)==len(coordinates2)
     1568        for i in range(len(coordinates2)):
     1569            coordinate = tuple(coordinates2[i])
     1570            assert points2.has_key(coordinate)
     1571            points2[coordinate]=i
     1572
     1573        for triangle in volumes1:
     1574            for coordinate in triangle:
     1575                assert coordinates2[points2[tuple(coordinates1[coordinate])]][0]==coordinates1[coordinate][0]
     1576                assert coordinates2[points2[tuple(coordinates1[coordinate])]][1]==coordinates1[coordinate][1]
     1577       
    15711578
    15721579#-------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.