Ignore:
Timestamp:
25/01/08 14:05:32 (13 years ago)
Author:
domlowe
Message:

Documenting CSML code - not complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/csmlutils.py

    r2741 r3267  
    1 '''csml utils contains useful  utility functions''' 
     1'''csml utils contains useful utility functions that don't belong anywhere else''' 
    22import csml 
    33 
    44def listify(item): 
    5     ''' listify checks if an item is a list, if it isn't it puts it inside a list and returns it. Always returns a list object''' 
     5    ''' listify checks if an item is a list, if it isn't it puts it inside a list and returns it.  
     6    @return:   A lways returns a list object''' 
    67    if type(item) is list: 
    78        return item 
    89    else: 
    9         return [item] 
     10        return [item]     
    1011     
    11      
    12      
    13 #deal with longitude requests 
    14 #if the request is in -ve,+ve eg (-30,30) but the data is in (0,360) need to handle this by changing the args. 
    1512def fixLongitude(request, kwargs): 
     13    ''' 
     14    deals with longitude requests 
     15    if the request is in -ve,+ve eg (-30,30) but the data is in (0,360) need to handle this by changing the args. 
     16    @param kwargs:   dictionary of kwargs representing a selection e.g. {'longitude':(0,30), 'latitude':(-20,20)} 
     17    @return:    dictionary of kwargs, altered from input to fix longitude values 
     18    ''' 
    1619    def _anyitemlessthanzero(listofitems): 
    1720        for item in listofitems: 
     
    4750         
    4851        minBound and maxBound added as options. 
    49         If a value is outside of minBound or maxBound it is nudged so that it is within. 
     52        If a value is outside of minBound or maxBound it is nudged so that it is within.        
    5053         
    51         TODO - rewrite this so it is legible! 
    52          
     54        @param value:    value to check 
     55        @param axisValues:    array of values 
     56        @param minBound:    minimum return value 
     57        @param minBound:    maxmimum return value 
     58        @return:    nearest neighbour of value 
    5359        """ 
    5460        bounds=False 
    5561        reverseBounds=False 
    56          
     62        #TODO - rewrite this so it is legible! 
    5763        #determine if bounds have been provided and if they are of the form (-30,30)  or (330, 30) 
    5864        if minBound!=None: 
Note: See TracChangeset for help on using the changeset viewer.