Ignore:
Timestamp:
12/12/15 18:52:35 (6 years ago)
Author:
mjuckes
Message:

removed unset floats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/workbook/importShDreq2.py

    r526 r527  
    183183    for d in dil: 
    184184      thiss.removeChild(d) 
    185     kk =  ['tables','label','altLabel','description','standardName','title','axis','units','isIndex','coords','bounds','direction','validMin','validMax','type','positive','value','boundsValues','requested','boundsRequested','tolRequested','isGrid' ] 
     185    kk =  ['tables','label','altLabel','description','standardName','title','axis','units','isIndex','coords','bounds','direction','valid_min','valid_max','type','positive','value','boundsValues','requested','boundsRequested','tolRequested','isGrid' ] 
    186186    for j in self.cmDims.ss.keys(): 
    187187      item = self.doc.createElement( 'item' ) 
    188188      for i in range(len(kk)): 
    189         item.setAttribute( kk[i], str( self.cmDims.ss[j][i] ) ) 
     189        if kk[i] in ['valid_min','valid_max']: 
     190          if str( self.cmDims.ss[j][i] ) != '': 
     191            item.setAttribute( kk[i], str( self.cmDims.ss[j][i] ) ) 
     192        else: 
     193          item.setAttribute( kk[i], str( self.cmDims.ss[j][i] ) ) 
    190194      uid = 'dim:%s' % str( self.cmDims.ss[j][1] ) 
    191195      item.setAttribute( 'uid', uid ) 
     
    15971601                    thisl = string.replace( r[k], '_', '' ) 
    15981602                    item.setAttribute( n, thisl ) 
     1603                  elif n in ["valid_min","valid_max"]: 
     1604                    if str(r[k]) != "": 
     1605                      item.setAttribute( n, str(r[k]) ) 
    15991606                  elif n == "frequency": 
    16001607                    fr = freqmap.get( str(r[k]), str(r[k]) ) 
Note: See TracChangeset for help on using the changeset viewer.