Changeset 3334


Ignore:
Timestamp:
08/02/08 20:06:19 (12 years ago)
Author:
astephen
Message:
 
Location:
nappy/trunk/nappy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/Plans for re-factoring 2008.txt

    r3324 r3334  
    160160cdms_map is not all done in the config file dict. 
    161161 
     162Unit tests 
     163========== 
    162164 
     1651001 appears to be done. Others are there as stubs but all need writing. 
     166 
     167We then need a set of nc_interface tests as well! Need NetCDF files to convert the other way as well. Need to be small. 
  • nappy/trunk/nappy/__init__.py

    r3321 r3334  
    1  
     1from nappy_api import * 
  • nappy/trunk/nappy/nappy_api.py

    r3321 r3334  
    1  
    2  
    31""" 
    42nappy_api.py 
     
    108""" 
    119 
    12 from na_error import * 
    13 from na_file import * 
     10# Import standard library modules 
    1411 
    15 """ 
    16 what to expose? 
    17 =============== 
    1812 
    19 convertNetCDFToNASAAmes() 
    20 convertNASAAmesToNetCDF() 
    21 convertNetCDFToCSV() 
    22 convertNASAAmesToCDMSObject() 
    23 convertCDMSObjectsToNASAAmes() 
     13# Import local modules 
     14from nappy.utils.common_utils import * 
    2415 
    25 """ 
     16def openNAFile(filename, mode="r", naDict=None, spacer="    ", floatFormat="%8.3f"): 
     17    """ 
     18    Function wrapper around the NASA Ames File classes. Any NASA Ames 
     19    file can be opened through this function and the appropriate read or 
     20    write NASA Ames File class instance is returned. 
     21    """ 
     22    if mode == "r": 
     23        ffi = readFFI(filename) 
     24        return apply(getNAFileClass(ffi), (filename, mode)) 
     25 
     26    elif mode == "w": 
     27        if naDict.has_key('FFI') and type(naDict['FFI']) == type(3): 
     28            ffi = naDict['FFI'] 
     29        else: 
     30            ffi = chooseFFI(naDict) 
     31            naDict['FFI'] = ffi 
     32            print "\nFormat identified as:", ffi     
     33        return apply(getNAFileClass(ffi), (filename,), {"mode":mode, "naDict":naDict, "spacer":spacer, "floatFormat":floatFormat}) 
     34    else: 
     35        raise Exception("File mode not recognised '" + mode + "'.") 
Note: See TracChangeset for help on using the changeset viewer.