Ignore:
Timestamp:
Oct 11, 2006, 2:22:34 PM (18 years ago)
Author:
duncan
Message:

more error handling

Location:
anuga_core/source/anuga/shallow_water
Files:
2 edited

Legend:

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

    r3741 r3750  
    41914191    quantities = ['HA','UA','VA']
    41924192
     4193    for file_name in files_in:
     4194        if os.access(file_name, os.F_OK) == 0 :
     4195            msg = 'File %s does not exist or is not accessible' %file_name
     4196            raise IOError, msg
     4197       
    41934198    hashed_elevation = None
    41944199    for file_in, file_out, quantity in map(None, files_in,
     
    42474252   
    42484253    lon, lat = lon_lat2grid(lonlatdep)
     4254    lon_sorted = lon[:]
     4255    lon_sorted.sort()
     4256   
     4257    if not lon == lon_sorted:
     4258        msg = "Longitudes in mux file are not in ascending order"
     4259        raise IOError, msg
     4260    lat_sorted = lat[:]
     4261    lat_sorted.sort()   
     4262    if not lat == lat_sorted:
     4263        msg = "Latitudes in mux file are not in ascending order"
     4264   
    42494265    nc_file = Write_nc(quantity,
    42504266                       file_out,
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r3742 r3750  
    50755075        self.delete_mux(files)
    50765076       
     5077    def test_urs2sww_test_fail2(self):
     5078        base_name = 'Harry-high-pants'
     5079        try:
     5080            urs2sww(base_name)       
     5081        except IOError:
     5082            pass
     5083        else:
     5084            self.delete_mux(files)
     5085            msg = 'Should have raised exception'
     5086            raise msg
     5087           
    50775088    def test_urs2sww(self):
    50785089        tide = 1
    50795090        base_name, files = self.create_mux()
    5080         urs2sww(base_name, remove_nc_files=True, mean_stage=tide)
     5091        urs2sww(base_name, mean_stage=tide)
    50815092        sww_file = base_name + '.sww'
    50825093       
Note: See TracChangeset for help on using the changeset viewer.