Changeset 8812


Ignore:
Timestamp:
Apr 5, 2013, 5:26:18 PM (12 years ago)
Author:
steve
Message:

Fixed unit test in test_urs2sww.py to work with netcdf4 on windows

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

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file/netcdf.py

    r8810 r8812  
    4242    """
    4343
    44 
    45 
    46     try:
    47         from Scientific.IO.NetCDF import NetCDFFile
    48         return NetCDFFile(file_name, netcdf_mode)
    49     except:
    50         from netCDF4 import Dataset
    51         if netcdf_mode == 'wl' :
    52             return Dataset(file_name, 'w', format='NETCDF3_64BIT')
    53         else:
    54             return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
     44    from netCDF4 import Dataset
     45    if netcdf_mode == 'wl' :
     46        return Dataset(file_name, 'w', format='NETCDF3_64BIT')
     47    else:
     48        return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
     49
     50
     51#    try:
     52#        from Scientific.IO.NetCDF import NetCDFFile
     53#        return NetCDFFile(file_name, netcdf_mode)
     54#    except:
     55#        from netCDF4 import Dataset
     56#        if netcdf_mode == 'wl' :
     57#            return Dataset(file_name, 'w', format='NETCDF3_64BIT')
     58#        else:
     59#            return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
    5560
    5661#    from netCDF4 import Dataset
  • trunk/anuga_core/source/anuga/file_conversion/test_urs2sww.py

    r8780 r8812  
    191191                    [-20.5, 115.5],
    192192                    [-20.6, 115.4],
    193                    
    194                    
    195193                    [-21.5, 114.5],
    196194                    [-21.4, 114.6],
     
    213211        fid = NetCDFFile(sww_file)
    214212       
    215         volumes = fid.variables['volumes']
     213        volumes = fid.variables['volumes'][:]
    216214        #print "number_of_volumes",len(volumes)
    217215
     
    225223        fid = NetCDFFile(sww_file)
    226224       
    227         volumes_again = fid.variables['volumes']
     225        volumes_again = fid.variables['volumes'][:]
    228226        #print "number_of_volumes",len(volumes_again)
    229227        assert num.allclose(len(volumes_again),
Note: See TracChangeset for help on using the changeset viewer.