Changeset 6215
- Timestamp:
- Jan 19, 2009, 5:39:55 PM (16 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r6162 r6215 3516 3516 other_quantities.remove('z') 3517 3517 other_quantities.remove('volumes') 3518 try:3519 other_quantities.remove('stage_range')3520 other_quantities.remove('xmomentum_range')3521 other_quantities.remove('ymomentum_range')3522 other_quantities.remove('elevation_range')3523 except:3524 pass3518 #try: 3519 # other_quantities.remove('stage_range') 3520 # other_quantities.remove('xmomentum_range') 3521 # other_quantities.remove('ymomentum_range') 3522 # other_quantities.remove('elevation_range') 3523 #except: 3524 # pass 3525 3525 3526 3526 conserved_quantities.remove('time') … … 5283 5283 j += 1 5284 5284 5285 if verbose: sww.verbose_quantities(outfile)5285 #if verbose: sww.verbose_quantities(outfile) 5286 5286 5287 5287 outfile.close() … … 5873 5873 ('number_of_points',)) 5874 5874 q = 'elevation' 5875 outfile.createVariable(q + Write_sww.RANGE, sww_precision,5876 ('numbers_in_range',))5877 5878 5879 # Initialise ranges with small and large sentinels.5880 # If this was in pure Python we could have used None sensibly5881 outfile.variables[q+Write_sww.RANGE][0] = max_float # Min5882 outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max5875 #outfile.createVariable(q + Write_sww.RANGE, sww_precision, 5876 # ('numbers_in_range',)) 5877 5878 5879 ## Initialise ranges with small and large sentinels. 5880 ## If this was in pure Python we could have used None sensibly 5881 #outfile.variables[q+Write_sww.RANGE][0] = max_float # Min 5882 #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max 5883 5883 5884 5884 # FIXME: Backwards compatibility … … 5895 5895 outfile.createVariable(q, sww_precision, ('number_of_timesteps', 5896 5896 'number_of_points')) 5897 outfile.createVariable(q + Write_sww.RANGE, sww_precision,5898 ('numbers_in_range',))5897 #outfile.createVariable(q + Write_sww.RANGE, sww_precision, 5898 # ('numbers_in_range',)) 5899 5899 5900 5900 # Initialise ranges with small and large sentinels. 5901 5901 # If this was in pure Python we could have used None sensibly 5902 outfile.variables[q+Write_sww.RANGE][0] = max_float # Min5903 outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max5902 #outfile.variables[q+Write_sww.RANGE][0] = max_float # Min 5903 #outfile.variables[q+Write_sww.RANGE][1] = -max_float # Max 5904 5904 5905 5905 if type(times) is list or type(times) is num.ArrayType: … … 6010 6010 q = 'elevation' 6011 6011 # This updates the _range values 6012 outfile.variables[q + Write_sww.RANGE][0] = min(elevation)6013 outfile.variables[q + Write_sww.RANGE][1] = max(elevation)6012 #outfile.variables[q + Write_sww.RANGE][0] = min(elevation) 6013 #outfile.variables[q + Write_sww.RANGE][1] = max(elevation) 6014 6014 6015 6015 … … 6062 6062 outfile.variables[q][slice_index] = \ 6063 6063 q_values.astype(sww_precision) 6064 6065 # This updates the _range values6066 q_range = outfile.variables[q + Write_sww.RANGE][:]6067 q_values_min = min(q_values)6068 if q_values_min < q_range[0]:6069 outfile.variables[q + Write_sww.RANGE][0] = q_values_min6070 q_values_max = max(q_values)6071 if q_values_max > q_range[1]:6072 outfile.variables[q + Write_sww.RANGE][1] = q_values_max6064 6065 # # This updates the _range values 6066 # q_range = outfile.variables[q + Write_sww.RANGE][:] 6067 # q_values_min = min(q_values) 6068 # if q_values_min < q_range[0]: 6069 # outfile.variables[q + Write_sww.RANGE][0] = q_values_min 6070 # q_values_max = max(q_values) 6071 # if q_values_max > q_range[1]: 6072 # outfile.variables[q + Write_sww.RANGE][1] = q_values_max 6073 6073 6074 6074 ## 6075 6075 # @brief Print the quantities in the underlying file. 6076 6076 # @param outfile UNUSED. 6077 def verbose_quantities(self, outfile):6078 print '------------------------------------------------'6079 print 'More Statistics:'6080 for q in Write_sww.sww_quantities:6081 print ' %s in [%f, %f]' % (q,6082 outfile.variables[q+Write_sww.RANGE][0],6083 outfile.variables[q+Write_sww.RANGE][1])6084 print '------------------------------------------------'6077 #def verbose_quantities(self, outfile): 6078 # print '------------------------------------------------' 6079 # print 'More Statistics:' 6080 # for q in Write_sww.sww_quantities: 6081 # print ' %s in [%f, %f]' % (q, 6082 # outfile.variables[q+Write_sww.RANGE][0], 6083 # outfile.variables[q+Write_sww.RANGE][1]) 6084 # print '------------------------------------------------' 6085 6085 6086 6086 … … 6433 6433 6434 6434 # This updates the _range values 6435 q_range = outfile.variables[q + Write_sts.RANGE][:]6436 q_values_min = min(q_values)6437 if q_values_min < q_range[0]:6438 outfile.variables[q + Write_sts.RANGE][0] = q_values_min6439 q_values_max = max(q_values)6440 if q_values_max > q_range[1]:6441 outfile.variables[q + Write_sts.RANGE][1] = q_values_max6435 #q_range = outfile.variables[q + Write_sts.RANGE][:] 6436 #q_values_min = min(q_values) 6437 #if q_values_min < q_range[0]: 6438 # outfile.variables[q + Write_sts.RANGE][0] = q_values_min 6439 #q_values_max = max(q_values) 6440 #if q_values_max > q_range[1]: 6441 # outfile.variables[q + Write_sts.RANGE][1] = q_values_max 6442 6442 6443 6443 -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r6191 r6215 251 251 252 252 # Get the variables 253 range = fid.variables['stage_range'][:]253 #range = fid.variables['stage_range'][:] 254 254 #print range 255 assert num.allclose(range,[-0.93519, 0.15]) or\256 num.allclose(range,[-0.9352743, 0.15]) or\257 num.allclose(range,[-0.93522203, 0.15000001]) # Old slope limiters258 259 range = fid.variables['xmomentum_range'][:]260 # print range261 assert num.allclose(range,[0,0.4695096]) or \262 num.allclose(range,[0,0.47790655]) or\263 num.allclose(range,[0,0.46941957]) or\264 num.allclose(range,[0,0.47769409])265 266 267 range = fid.variables['ymomentum_range'][:]268 # print range269 assert num.allclose(range,[0,0.02174380]) or\270 num.allclose(range,[0,0.02174439]) or\271 num.allclose(range,[0,0.02283983]) or\272 num.allclose(range,[0,0.0217342]) or\273 num.allclose(range,[0,0.0227564]) # Old slope limiters255 #assert num.allclose(range,[-0.93519, 0.15]) or\ 256 # num.allclose(range,[-0.9352743, 0.15]) or\ 257 # num.allclose(range,[-0.93522203, 0.15000001]) # Old slope limiters 258 259 #range = fid.variables['xmomentum_range'][:] 260 ##print range 261 #assert num.allclose(range,[0,0.4695096]) or \ 262 # num.allclose(range,[0,0.47790655]) or\ 263 # num.allclose(range,[0,0.46941957]) or\ 264 # num.allclose(range,[0,0.47769409]) 265 266 267 #range = fid.variables['ymomentum_range'][:] 268 ##print range 269 #assert num.allclose(range,[0,0.02174380]) or\ 270 # num.allclose(range,[0,0.02174439]) or\ 271 # num.allclose(range,[0,0.02283983]) or\ 272 # num.allclose(range,[0,0.0217342]) or\ 273 # num.allclose(range,[0,0.0227564]) # Old slope limiters 274 274 275 275 fid.close() … … 11251 11251 if __name__ == "__main__": 11252 11252 11253 #suite = unittest.makeSuite(Test_Data_Manager,'test')11254 suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_sts')11253 suite = unittest.makeSuite(Test_Data_Manager,'test') 11254 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_sts') 11255 11255 #suite = unittest.makeSuite(Test_Data_Manager,'test_get_flow_through_cross_section_with_geo') 11256 11256 #suite = unittest.makeSuite(Test_Data_Manager,'covered_') -
anuga_core/source/anuga/test_all.py
r6086 r6215 29 29 exclude_dirs = ['pypar_dist', #Special requirements 30 30 'props', 'wcprops', 'prop-base', 'text-base', '.svn', #Svn 31 'tmp' ]31 'tmp', 'lib'] 32 32 33 33 print "The following directories will be skipped over;" … … 84 84 print 'Testing path %s:' %('...'+path[-50:]) 85 85 print 86 print 'Paths searched:' 87 for path_file in path_files: 88 print path_file + ',', 89 print 90 print 86 91 print 'Files tested;' 87 92 for file in files: … … 89 94 print 90 95 print 96 print 97 91 98 if globals().has_key('exclude_files'): 92 99 for file in exclude_files: … … 103 110 moduleNames = map(filenameToModuleName, files) 104 111 modules = map(__import__, moduleNames) 112 105 113 106 114 # Fix up the system path -
anuga_core/source/anuga/utilities/test_polygon.py
r6189 r6215 1783 1783 if __name__ == "__main__": 1784 1784 suite = unittest.makeSuite(Test_Polygon,'test') 1785 # suite = unittest.makeSuite(Test_Polygon,'test_intersection_bug_20081111')1786 1785 runner = unittest.TextTestRunner() 1787 1786 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.