Changeset 582
- Timestamp:
- 02/02/16 15:01:04 (5 years ago)
- Location:
- CMIP6dreqbuild/trunk/src/framework/dreqPy
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/src/framework/dreqPy/dreq.py
r579 r582 307 307 elif self._a[a].type == u'xs:boolean': 308 308 v = v in ['true','1'] 309 elif self._a[a].type == u'aa:st__stringList': 310 if v.find(' ') != -1: 311 v = v.split() 312 else: 313 v = [v,] 309 314 elif self._a[a].type not in [u'xs:string']: 310 315 print ('ERROR: Type %s not recognised' % self._a[a].type ) -
CMIP6dreqbuild/trunk/src/framework/dreqPy/makeTables.py
r554 r582 1 1 2 from dreqPyimport dreq2 import dreq 3 3 import collections, string, os 4 4 import vrev … … 343 343 return '<li>%s {%s}: %s variables, %s request links</li>' % ( targ.__href__(odir='../u/', label=targ.label), targ.mip, gpsz, nlnk ) 344 344 345 class tables(object): 346 def __init__(self,sc, mips): 347 self.sc = sc 348 self.dq = sc.dq 349 self.mips = mips 350 351 def doTable(self,m,l1,m2,pmax,collector,acc=True): 352 """acc allows accumulation of values to be switched off when called in single expt mode""" 353 354 x = self.sc.volByExpt( l1, m2, expFullEx=(m2 in self.mips), pmax=pmax ) 355 if x[0] > 0: 356 collector[m].a[m2] += x[0] 357 im2 = self.dq.inx.uid[m2] 358 # 359 # create sum for each table 360 # 361 xs = 0 362 for k in x[2].keys(): 363 i = self.dq.inx.uid[k] 364 xxx = x[2][k] 365 xs += xxx 366 if xxx > 0: 367 collector['_%s_%s' % (m,m2)].a[i.mipTable] += xxx 368 assert x[0] == xs, 'ERROR.0088: consistency problem %s %s %s %s' % (m,m2,x[0],xs) 369 if x[0] == 0: 370 print 'Zero size:',m,m2 371 if len( x[2].keys() ) > 0: 372 print 'ERROR:zero: ',m,m2,x[2].keys() 373 374 if acc: 375 collector[m].a['TOTAL'] += x[0] 376 dd = collections.defaultdict( list ) 377 lll = set() 378 for v in x[2].keys(): 379 vi = self.sc.dq.inx.uid[v] 380 if vi._h.label != 'remarks': 381 f,t,l,tt,d,u = (vi.frequency,vi.mipTable,vi.label,vi.title,vi.description,vi.uid) 382 lll.add(u) 383 dd[t].append( (f,t,l,tt,d,u) ) 384 if len( dd.keys() ) > 0: 385 collector[m].dd[m2] = dd 386 if im2._h.label == 'experiment': 387 dothis = self.sc.tierMax >= im2.tier 388 ### 389 ### BUT ... there is a treset in the request item .... it may be that some variables are excluded ... 390 ### need the variable list itself ..... 391 ### 392 makeTab( subset=lll, dest='tab2/%s-%s_%s_%s.xlsx' % (m,m2,self.sc.tierMax,pmax) ) 393 345 394 styls = styles() 346 395 -
CMIP6dreqbuild/trunk/src/framework/dreqPy/packageConfig.py
r568 r582 15 15 16 16 __versionComment__ = "Added annex, improved content, various bug fixes" 17 __version__ = "01.beta.1 7"17 __version__ = "01.beta.19" 18 18 __title__ = "dreqPy" 19 19 __description__ = "CMIP6 Data Request Python API" -
CMIP6dreqbuild/trunk/src/framework/dreqPy/scope.py
r581 r582 790 790 for v in vl[:mx]: 791 791 mlg.prnt ( '%s: %7.2fTb' % (self.dq.inx.uid[v].label, cc[v]*2.*1.e-12) ) 792
Note: See TracChangeset
for help on using the changeset viewer.