Changeset 4418
- Timestamp:
- Apr 24, 2007, 10:16:25 AM (18 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4416 r4418 2437 2437 swwname = basename_out + '.sww' 2438 2438 2439 #Get dimensions of file_h2439 # Get dimensions of file_h 2440 2440 for dimension in file_h.dimensions.keys(): 2441 2441 if dimension[:3] == 'LON': … … 2454 2454 longitudes = file_h.variables[dim_h_longitude] 2455 2455 2456 # get dimensions for file_e2456 # get dimensions for file_e 2457 2457 for dimension in file_e.dimensions.keys(): 2458 2458 if dimension[:3] == 'LON': … … 2461 2461 dim_e_latitude = dimension 2462 2462 2463 # get dimensions for file_u2463 # get dimensions for file_u 2464 2464 for dimension in file_u.dimensions.keys(): 2465 2465 if dimension[:3] == 'LON': … … 2470 2470 dim_u_time = dimension 2471 2471 2472 # get dimensions for file_v2472 # get dimensions for file_v 2473 2473 for dimension in file_v.dimensions.keys(): 2474 2474 if dimension[:3] == 'LON': … … 2480 2480 2481 2481 2482 # Precision used by most for lat/lon is 4 or 5 decimals2482 # Precision used by most for lat/lon is 4 or 5 decimals 2483 2483 e_lat = around(file_e.variables[dim_e_latitude][:], 5) 2484 2484 e_lon = around(file_e.variables[dim_e_longitude][:], 5) 2485 2485 2486 # Check that files are compatible2486 # Check that files are compatible 2487 2487 assert allclose(latitudes, file_u.variables[dim_u_latitude]) 2488 2488 assert allclose(latitudes, file_v.variables[dim_v_latitude]) … … 2493 2493 assert allclose(longitudes, e_lon) 2494 2494 2495 if mint ==None:2495 if mint is None: 2496 2496 jmin = 0 2497 mint = times[0] 2497 2498 else: 2498 2499 jmin = searchsorted(times, mint) 2499 2500 2500 if maxt == None: 2501 jmax=len(times) 2501 if maxt is None: 2502 jmax = len(times) 2503 maxt = times[-1] 2502 2504 else: 2503 2505 jmax = searchsorted(times, maxt) … … 2507 2509 kmin, kmax, lmin, lmax = _get_min_max_indexes(latitudes[:], 2508 2510 longitudes[:], 2509 minlat, maxlat, 2510 minlon, maxlon) 2511 2512 2513 # print' j', jmin, jmax 2511 minlat, maxlat, 2512 minlon, maxlon) 2513 2514 2514 2515 times = times[jmin:jmax] 2515 2516 latitudes = latitudes[kmin:kmax] … … 2756 2757 %(geo_ref.get_xllcorner(), geo_ref.get_yllcorner()) 2757 2758 print ' Start time: %f' %starttime 2758 #print ' Min time: %f' %mint2759 #print ' Max time: %f' %maxt2759 print ' Min time: %f' %mint 2760 print ' Max time: %f' %maxt 2760 2761 print ' Extent:' 2761 2762 print ' x [m] in [%f, %f], len(x) == %d'\ -
anuga_core/source/anuga/test_all.py
r4415 r4418 93 93 load = unittest.defaultTestLoader.loadTestsFromModule 94 94 testCaseClasses = map(load, modules) 95 96 95 97 if test_verbose is True: 96 98 # Test the code by setting verbose to True. … … 99 101 for test_suite in testCaseClasses: 100 102 for tests in test_suite._tests: 101 #tests is of class TestSuite 102 print "tests weak", tests.__weakref__ 103 if len(tests._tests) >1: 103 # tests is of class TestSuite 104 if len(tests._tests) > 1: 104 105 # these are the test functions 105 106 try: 106 # Calls set_verbose in the test case classes 107 # Calls class method set_verbose in the test case classes 108 # print 'Tests', tests._tests[0] 109 # print 'Type', type(tests._tests[0]) 107 110 tests._tests[0].set_verbose() 108 111 except:
Note: See TracChangeset
for help on using the changeset viewer.