Changeset 3382


Ignore:
Timestamp:
Jul 19, 2006, 2:59:00 PM (18 years ago)
Author:
duncan
Message:

checking in ...working on the tests

Location:
inundation/damage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/damage/inundation_damage.py

    r3356 r3382  
    5151    csv = Exposure_csv(exposure_file_in)
    5252    geospatial = csv.get_location()
     53    geospatial = ensure_absolute(geospatial)
    5354    max_depths, max_momentums = calc_max_depth_and_momentum(sww_file,
    5455                                    geospatial,
     
    99100    """
    100101    quantities =  ['stage', 'elevation', 'xmomentum', 'ymomentum']
     102    #print "points",points
    101103    points = ensure_absolute(points)
    102104    point_count = len(points)
  • inundation/damage/test_inundation_damage.py

    r3350 r3382  
    134134        writer = csv.writer(fd)
    135135        writer.writerow(['LONGITUDE','LATITUDE','STR_VALUE','C_VALUE','ROOF_TYPE','WALLS', 'SHORE_DIST'])
    136         writer.writerow(['151.5','-34','199770','130000','Metal','Timber',20])
    137         writer.writerow(['151','-34.5','150000','76000','Metal','Double Brick',200])
    138         writer.writerow(['151','-34.25','150000','76000','Metal','Brick Veneer',200])
     136        writer.writerow(['151.5','-34','199770','130000','Metal','Timber',20.])
     137        writer.writerow(['151','-34.5','150000','76000','Metal','Double Brick',200.])
     138        writer.writerow(['151','-34.25','150000','76000','Metal','Brick Veneer',200.])
     139        fd.close()
    139140
    140141       
     
    154155
    155156   
    156     def ztest_inundation_damage2(self):
     157    def test_inundation_damage2(self):
    157158
    158159        # create mesh
     
    162163        m.add_vertices(points)
    163164        m.autoSegment()
    164         m.generate_mesh(verbose=True) #False)
     165        m.generate_mesh(verbose=False)
    165166        m.export_mesh_file(mesh_file)
    166167       
     
    204205        fd = open(csv_file,'wb')
    205206        writer = csv.writer(fd)
    206         writer.writerow(['LONGITUDE','LATITUDE','STR_VALUE','C_VALUE','ROOF_TYPE','WALLS', 'SHORE_DIST'])
    207         writer.writerow(['151.5','-34','199770','130000','Metal','Timber',20])
    208         writer.writerow(['151','-34.5','150000','76000','Metal','Double Brick',200])
    209         writer.writerow(['151','-34.25','150000','76000','Metal','Brick Veneer',200])
     207        writer.writerow(['x','y','STR_VALUE','C_VALUE','ROOF_TYPE','WALLS', 'SHORE_DIST'])
     208        writer.writerow([5.5,0.5,'199770','130000','Metal','Timber',20])
     209        writer.writerow([4.5,1.0,'150000','76000','Metal','Double Brick',20])
     210        writer.writerow([4.5,1.5,'150000','76000','Metal','Brick Veneer',20])
     211        fd.close()
     212
     213        sww_file = domain.filename + "." + domain.format
     214        #print "sww_file",sww_file
     215        inundation_damage(sww_file, csv_file, verbose=False)
     216
    210217
    211218    def ztest_add_depth_and_momentum2csv(self):
     
    351358#-------------------------------------------------------------
    352359if __name__ == "__main__":
    353     #suite = unittest.makeSuite(Test_inundation_damage,'test_inundation_damage')
     360    #suite = unittest.makeSuite(Test_inundation_damage,'test_inundation_damage2')
    354361    suite = unittest.makeSuite(Test_inundation_damage,'test')
    355362    runner = unittest.TextTestRunner()
Note: See TracChangeset for help on using the changeset viewer.