Changeset 779
- Timestamp:
- 14/10/16 16:42:24 (4 years ago)
- Location:
- CMIP6dreqbuild/trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/src/framework/Makefile
r770 r779 65 65 cp htmlTemplates.py dreqPy/scope.py dreqPy/scope_utils.py dreqPy/utilities.py dreqPy/utilP3.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 66 66 cp dreqPy/utilP2/*.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/utilP2/ 67 cp dreqPy/dreqCmdl.py dreqPy/makeTables.py dreqPy/vrev.py dreqPy/ __init__.py dreqPy/simpleCheck.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy67 cp dreqPy/dreqCmdl.py dreqPy/makeTables.py dreqPy/vrev.py dreqPy/fgrid.py dreqPy/overviewTabs.py dreqPy/volsum.py dreqPy/__init__.py dreqPy/simpleCheck.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 68 68 cp dreqPy/misc_utils.py dreqPy/rvgExtraTable.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy 69 69 cp vocabDemo.py /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy … … 76 76 cp out/supplement_20150731.xml /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/docs/dreqSupp.xml 77 77 cp out/dreqManifest_dist.txt /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/docs/dreqManifest.txt 78 cp out/md5Manifest.txt /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/docs/78 cp out/md5Manifest.txt out/sfheadings.csv /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/docs/ 79 79 cp -r dreqPy/examples /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/ 80 80 cp out/BlockSchema.csv /data/tmp/svn3/exarch/CMIP6dreq/trunk/dreqPy/docs/ -
CMIP6dreqbuild/trunk/src/framework/dreqPy/fgrid.py
r773 r779 48 48 49 49 if len(i4) > 0: 50 print 'SEVERE.cmvgrid.00001: unidentified grids for %s variables' % len(i4)50 print ( 'SEVERE.cmvgrid.00001: unidentified grids for %s variables' % len(i4) ) 51 51 for i in i4: 52 print i.label, i.title, i.prov52 print ( '%s: %s %s' % (i.label, i.title, i.prov)) 53 53 54 54 return ee,i4 -
CMIP6dreqbuild/trunk/src/framework/dreqPy/makeTables.py
r770 r779 1 1 2 import collections, string,os, sys2 import collections, os, sys 3 3 import volsum 4 4 … … 51 51 mlab = list(m)[0] 52 52 else: 53 mlab= string.join( [ x[:2].lower() for x in m ], '.')53 mlab='.'.join( [ x[:2].lower() for x in m ] ) 54 54 return mlab 55 55 … … 102 102 103 103 if self.txt: 104 self.oo.write( string.join( ['Notes','','Notes on tables'], '\t') + '\n' )104 self.oo.write( '\t'.join( ['Notes','','Notes on tables']) + '\n' ) 105 105 for t in tableNotes: 106 self.oo.write( string.join( ['Notes',] + list(t), '\t') + '\n' )106 self.oo.write( '\t'.join( ['Notes',] + list(t)) + '\n' ) 107 107 108 108 if collected != None: 109 self.oo.write( string.join( ['Notes','Table','Reference Volume (1 deg. atmosphere, 0.5 deg. ocean)'], '\t') + '\n')109 self.oo.write( '\t'.join( ['Notes','Table','Reference Volume (1 deg. atmosphere, 0.5 deg. ocean)']) + '\n') 110 110 for k in sorted( collected.keys() ): 111 self.oo.write( string.join( ['Notes',k,vfmt( collected[k]*2. )], '\t') + '\n' )111 self.oo.write( '\t'.join( ['Notes',k,vfmt( collected[k]*2. )]) + '\n' ) 112 112 113 113 def cmvtabrec(self,j,t,orec): … … 117 117 118 118 if self.txt: 119 self.oo.write( string.join( [t,] + orec, '\t') + '\n' )119 self.oo.write( '\t'.join( [t,] + orec) + '\n' ) 120 120 121 121 def varrec(self,j,orec): … … 125 125 126 126 if self.txt: 127 self.oo.write( string.join( orec, '\t') + '\n' )127 self.oo.write( '\t'.join( orec, '\t') + '\n' ) 128 128 129 129 def var(self): … … 355 355 if ii._h.label == 'remarks': 356 356 ml.append( ['var','struct','time','spatial'][i] ) 357 print ( 'makeTables: skipping %s %s: %s' % (t,v.label, string.join( ml, ',')) )357 print ( 'makeTables: skipping %s %s: %s' % (t,v.label,','.join( ml)) ) 358 358 skipped.add( (t,v.label) ) 359 359 else: 360 360 dims = [] 361 dims += string.split( sshp.dimensions,'|' )362 dims += string.split( tshp.dimensions,'|' )363 dims += string.split( strc.odims,'|' )364 dims += string.split( strc.coords,'|' )365 dims = string.join( dims )361 dims += sshp.dimensions.split( '|' ) 362 dims += tshp.dimensions.split( '|' ) 363 dims += strc.odims.split( '|' ) 364 dims += strc.coords.split( '|' ) 365 dims = ' '.join( dims ) 366 366 if mode == 'c': 367 367 orec = [str(v.defaultPriority),cv.title, cv.units, cv.description, v.description, cv.label, cv.sn, strc.cell_methods, v.positive, v.type, dims, v.label, v.modeling_realm, v.frequency, strc.cell_measures, v.prov,v.provNote,str(v.rowIndex),v.uid,v.vid,v.stid,strc.title] … … 371 371 thismips = c.chkCmv( v.uid ) 372 372 thismips2 = c.chkCmv( v.uid, byExpt=True ) 373 orec.append( string.join( sorted( list( thismips) ),',') )374 orec.append( string.join( sorted( list( thismips2) ),',') )373 orec.append( ','.join( sorted( list( thismips) ) ) ) 374 orec.append( ','.join( sorted( list( thismips2) ) ) ) 375 375 376 376 if withoo: 377 oo.write( string.join(orec, '\t') + '\n' )377 oo.write( '\t'.join(orec ) + '\n' ) 378 378 j+=1 379 379 wb.cmvtabrec( j,t,orec ) … … 445 445 bdy.append( '</ul></body></html>\n' ) 446 446 oo = open( '%s/%s.html' % (self.odir,v.label), 'w' ) 447 oo.write( dq.pageTmpl % ( title, '', '../', '../index.html', string.join( bdy, '\n') ) )447 oo.write( dq.pageTmpl % ( title, '', '../', '../index.html', '\n'.join( bdy ) ) ) 448 448 oo.close() 449 449 self.anno[v.label] = '<a href="../t/%s.html">Usage</a>' % v.label … … 467 467 for k in ['sn','ln','u','var','d']: 468 468 469 if string.find( d[k],'"' ) != -1:469 if d[k].fin( '"' ) != -1: 470 470 print ( "WARNING ... quote in %s .. %s [%s]" % (k,var,d[k]) ) 471 d[k] = string.replace( d[k],'"', "'" )471 d[k] = d[k].replace( '"', "'" ) 472 472 print ( d[k] ) 473 473 … … 631 631 ks = sorted( list( cc0.keys() ) ) 632 632 if self.verbose: 633 print ('Experiment summary: %s %s' % (mlab, string.join( ['%s: %s' % (k,len(cc0[k])) for k in ks], ', ') ) )633 print ('Experiment summary: %s %s' % (mlab,', '.join( ['%s: %s' % (k,len(cc0[k])) for k in ks] ) ) ) 634 634 635 635 if m2 in [None, 'TOTAL']: -
CMIP6dreqbuild/trunk/src/framework/dreqPy/overviewTabs.py
r770 r779 238 238 if m2 == 'TOTAL': 239 239 sm = string.join( ['%s: %s' % (k,vfmt(cct[k]*2.)) for k in sorted( cct ) ], '; ' ) 240 print m,cct240 print ( '%s, %s' % (m,cct) ) 241 241 s1 = '<b><span title="%s">%s</span></b>' % (sm,s) 242 242 s = '<b>%s</b>' % s -
CMIP6dreqbuild/trunk/src/framework/dreqPy/scope.py
r774 r779 23 23 import sys, os 24 24 25 odsz = {' tau':7, 'scatratio':15, 'effectRadLi|tau':(28,'query pending'), 'vegtype':(8,'free'), 'sza5':5, 'site':(119,'73 for aquaplanet .. '), 'iceband':(5,'free'), 'dbze':15, 'spectband':(10,'free'), 'misrBands':(7,'query pending'), 'effectRadIc|tau':(28,'query pending')}25 odsz = {'landUse':(5,'free'), 'tau':7, 'scatratio':15, 'effectRadLi|tau':(28,'query pending'), 'vegtype':(8,'free'), 'sza5':5, 'site':(119,'73 for aquaplanet .. '), 'iceband':(5,'free'), 'dbze':15, 'spectband':(10,'free'), 'misrBands':(7,'query pending'), 'effectRadIc|tau':(28,'query pending')} 26 26 27 27 python2 = True … … 231 231 sf = odsz[i.odims] 232 232 else: 233 print 'SEVERE.odims.00001: no information on dimension size: %s' % i.odims233 ## print 'SEVERE.odims.00001: no information on dimension size: %s' % i.odims 234 234 sf = 5 235 235 if type( sf ) == type( () ): … … 439 439 for rl in rqll: 440 440 if 'requestItem' not in self.dq.inx.iref_by_sect[rl.uid].a: 441 print 'WARN.001.00001: no request items for: ',rl.uid, rl.title441 print ( 'WARN.001.00001: no request items for: %s, %s' % (rl.uid, rl.title) ) 442 442 else: 443 443 … … 451 451 grd = 'native' 452 452 else: 453 print 'INFO.grd.00001: defaulting to grid ..',rl.label,rl.title, rl.uid453 ## print ( 'INFO.grd.00001: defaulting to grid ..%s, %s, %s' % (rl.label,rl.title, rl.uid) ) 454 454 grd = 'DEF' 455 455 … … 909 909 ss = set() 910 910 for pr in ee: 911 if pr != -1:912 print 'INFO.preset.00101: ',pr,len(ee[pr])913 911 ### loop over request var groups. 914 912 for i in ee[pr]: … … 946 944 cc[(i1.vid,e,grd)].add( expys[i.uid][gf][e,grd] ) 947 945 else: 948 print 'SKIPPING %s: %s' % (i1.label,i1.vid)946 print ( 'SKIPPING %s: %s' % (i1.label,i1.vid) ) 949 947 ss.add( i1.vid ) 950 948 if includeYears: … … 959 957 for v,e in l2x: 960 958 if len( l2x[(v,e)].keys() ) == 1: 961 g,val = l 2x[(v,e)].items()[0]959 g,val = list( l2x[(v,e)].items() )[0] 962 960 else: 963 961 if 'native' in l2x[(v,e)].keys(): … … 1117 1115 net += ne 1118 1116 if len(eset) != ne: 1119 print 'WARNING: inconsistency in volume estimate ... possible duplication for %s,%s' % (cmvi,f)1117 print ( 'WARNING: inconsistency in volume estimate ... possible duplication for %s,%s' % (cmvi,f) ) 1120 1118 for e in eset: 1121 1119 elab = self.dq.inx.uid[e].label … … 1170 1168 sf = self.odsz[o] 1171 1169 else: 1172 print 'SEVERE.odims.00006: no information on dimension size: %s' % o1170 # print ( 'SEVERE.odims.00006: no information on dimension size: %s' % o ) 1173 1171 sf = 5 1174 1172 … … 1183 1181 szg = self.szss[s] 1184 1182 except: 1185 print 'Failed to get size for: ',g,g1,s1183 print ( 'Failed to get size for: %s, %s, %s' % (g,g1,s ) ) 1186 1184 raise 1187 1185 … … 1512 1510 if 'grdpol' in self.adict: 1513 1511 self.sc.gridPolicyDefaultNative = self.adict['grdpol'] == 'native' 1514 print 'SETTING grid policy: ', self.sc.gridPolicyDefaultNative1512 print ( 'SETTING grid policy: %s' % self.sc.gridPolicyDefaultNative ) 1515 1513 if 'allgrd' in self.adict: 1516 1514 self.sc.gridPolicyTopOnly = False 1517 print 'SETTING grid policy for multiple preferred grids: ', self.sc.gridPolicyTopOnly1515 print ( 'SETTING grid policy for multiple preferred grids: %s' % self.sc.gridPolicyTopOnly ) 1518 1516 if 'unique' in self.adict: 1519 1517 self.sc.uniqueRequest = True -
CMIP6dreqbuild/trunk/src/framework/dreqPy/volsum.py
r774 r779 76 76 self.run( m, '%s/requestVol_%s_%s_%s' % (self.odir,m,self.sc.tierMax,pmax), pmax=pmax ) 77 77 78 self.anal(olab=m,doUnique=True )78 self.anal(olab=m,doUnique=True, makeTabs=True) 79 79 ttl = sum( [x for k,x in self.res['vu'].items()] )*2.*1.e-12 80 80 print ( '%s volume: %8.2fTb' % (m,ttl) ) … … 121 121 return lex, vet, vf, vu, mvol 122 122 123 def anal(self,olab=None,doUnique=False ):123 def anal(self,olab=None,doUnique=False,makeTabs=False): 124 124 vmt = collections.defaultdict( int ) 125 125 vm = collections.defaultdict( int ) … … 143 143 sp = self.sc.dq.inx.uid[k[0]] 144 144 if k not in self.mvol: 145 print '%s missing from mvol: ' % str(k)145 print ( '%s missing from mvol: ' % str(k) ) 146 146 else: 147 147 if checkMvol > 1: … … 149 149 la = self.sc.dq.inx.uid[u].label 150 150 if self.mvol[k][u] != mvol[k][u]: 151 print 'MISMATCH IN %s (%s): %s:: %s,%s' % (str(k),sp.label,la,mvol[k][u],self.mvol[k][u])151 print ( 'MISMATCH IN %s (%s): %s:: %s,%s' % (str(k),sp.label,la,mvol[k][u],self.mvol[k][u]) ) 152 152 153 153 for e in lex: … … 177 177 cct[t] += cc[m][t] 178 178 ss = ss.union( lm[m] ) 179 makeTables.makeTab(self.sc.dq, subset=lm[m], dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,m,self.sc.tierMax,self.pmax,self.efnsfx), collected=cc[m]) 180 181 if olab != None: 182 makeTables.makeTab(self.sc.dq, subset=ss, dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,'TOTAL',self.sc.tierMax,self.pmax,self.efnsfx), collected=cct) 183 if olab != 'TOTAL' and doUnique: 184 makeTables.makeTab(self.sc.dq, subset=s_lm, dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,'Unique',self.sc.tierMax,self.pmax,self.efnsfx), collected=s_cc) 179 if makeTabs: 180 makeTables.makeTab(self.sc.dq, subset=lm[m], dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,m,self.sc.tierMax,self.pmax,self.efnsfx), collected=cc[m]) 181 182 if olab != None and makeTabs: 183 makeTables.makeTab(self.sc.dq, subset=ss, dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,'TOTAL',self.sc.tierMax,self.pmax,self.efnsfx), collected=cct) 184 if olab != 'TOTAL' and doUnique: 185 makeTables.makeTab(self.sc.dq, subset=s_lm, dest='%s/cmvmm_%s_%s_%s_%s%s' % (self.odir,olab,'Unique',self.sc.tierMax,self.pmax,self.efnsfx), collected=s_cc) 185 186 186 187 cc = collections.defaultdict( dict ) … … 190 191 cc[e][t] = vet[(e,t) ] 191 192 for e in sorted( ve.keys() ): 192 if olab != None :193 if olab != None and makeTabs: 193 194 el = self.sc.dq.inx.uid[e].label 194 195 makeTables.makeTab(self.sc.dq, subset=lex[e], dest='%s/cmvme_%s_%s_%s_%s%s' % (self.odir,olab,el,self.sc.tierMax,self.pmax,self.efnsfx), collected=cc[e]) … … 198 199 ucc[e][t] = s_vet[(e,t) ] 199 200 for e in sorted( uve.keys() ): 200 if olab != None :201 if olab != None and makeTabs: 201 202 el = self.sc.dq.inx.uid[e].label 202 203 makeTables.makeTab(self.sc.dq, subset=s_lex[e], dest='%s/cmvume_%s_%s_%s_%s%s' % (self.odir,olab,el,self.sc.tierMax,self.pmax,self.efnsfx), collected=ucc[e]) … … 207 208 cc8[t] += vet[(e,t)] 208 209 for f in sorted( vf.keys() ): 209 print 'Frequency: %s: %s' % (f,vf[f]*2.*1.e-12)210 print ( 'Frequency: %s: %s' % (f,vf[f]*2.*1.e-12 ) ) 210 211 211 212 def csvFreqStrSummary(self,mip,pmax=1): … … 279 280 self.sht.set_column(2,2,4) 280 281 self.sht.set_column(3,3,15) 281 for k in range( (len(oh)-3)/4):282 for k in range( int( (len(oh)-3)/4 ) ): 282 283 self.sht.set_column((k+1)*4,(k+1)*4,4) 283 284 self.sht.set_column((k+1)*4+1,(k+1)*4+1,8)
Note: See TracChangeset
for help on using the changeset viewer.