Changeset 4418


Ignore:
Timestamp:
Apr 24, 2007, 10:16:25 AM (17 years ago)
Author:
ole
Message:

Ran Duncan's verbose tests, verified problem with mint and maxt, and fixed it.
Also a bit of cosmetics.

Location:
anuga_core/source/anuga
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4416 r4418  
    24372437        swwname = basename_out + '.sww'
    24382438
    2439 #    Get dimensions of file_h
     2439    # Get dimensions of file_h
    24402440    for dimension in file_h.dimensions.keys():
    24412441        if dimension[:3] == 'LON':
     
    24542454    longitudes = file_h.variables[dim_h_longitude]
    24552455   
    2456 # get dimensions for file_e
     2456    # get dimensions for file_e
    24572457    for dimension in file_e.dimensions.keys():
    24582458        if dimension[:3] == 'LON':
     
    24612461            dim_e_latitude = dimension
    24622462
    2463 # get dimensions for file_u
     2463    # get dimensions for file_u
    24642464    for dimension in file_u.dimensions.keys():
    24652465        if dimension[:3] == 'LON':
     
    24702470            dim_u_time = dimension
    24712471           
    2472 # get dimensions for file_v
     2472    # get dimensions for file_v
    24732473    for dimension in file_v.dimensions.keys():
    24742474        if dimension[:3] == 'LON':
     
    24802480
    24812481
    2482     #Precision used by most for lat/lon is 4 or 5 decimals
     2482    # Precision used by most for lat/lon is 4 or 5 decimals
    24832483    e_lat = around(file_e.variables[dim_e_latitude][:], 5)
    24842484    e_lon = around(file_e.variables[dim_e_longitude][:], 5)
    24852485
    2486     #Check that files are compatible
     2486    # Check that files are compatible
    24872487    assert allclose(latitudes, file_u.variables[dim_u_latitude])
    24882488    assert allclose(latitudes, file_v.variables[dim_v_latitude])
     
    24932493    assert allclose(longitudes, e_lon)
    24942494
    2495     if mint == None:
     2495    if mint is None:
    24962496        jmin = 0
     2497        mint = times[0]       
    24972498    else:
    24982499        jmin = searchsorted(times, mint)
    24992500       
    2500     if maxt == None:
    2501         jmax=len(times)
     2501    if maxt is None:
     2502        jmax = len(times)
     2503        maxt = times[-1]
    25022504    else:
    25032505        jmax = searchsorted(times, maxt)
     
    25072509    kmin, kmax, lmin, lmax = _get_min_max_indexes(latitudes[:],
    25082510                                                  longitudes[:],
    2509                                                  minlat, maxlat,
    2510                                                  minlon, maxlon)
    2511 
    2512 
    2513 #    print' j', jmin, jmax
     2511                                                  minlat, maxlat,
     2512                                                  minlon, maxlon)
     2513
     2514
    25142515    times = times[jmin:jmax]
    25152516    latitudes = latitudes[kmin:kmax]
     
    27562757              %(geo_ref.get_xllcorner(), geo_ref.get_yllcorner())
    27572758        print ' Start time: %f' %starttime
    2758         #print '    Min time: %f' %mint
    2759         #print '    Max time: %f' %maxt
     2759        print '    Min time: %f' %mint
     2760        print '    Max time: %f' %maxt
    27602761        print '  Extent:'
    27612762        print '    x [m] in [%f, %f], len(x) == %d'\
  • anuga_core/source/anuga/test_all.py

    r4415 r4418  
    9393    load = unittest.defaultTestLoader.loadTestsFromModule
    9494    testCaseClasses = map(load, modules)
     95
     96   
    9597    if test_verbose is True:
    9698        # Test the code by setting verbose to True.
     
    99101        for test_suite in testCaseClasses:
    100102            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:
    104105                    # these are the test functions
    105106                    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])                       
    107110                        tests._tests[0].set_verbose()
    108111                    except:
Note: See TracChangeset for help on using the changeset viewer.