Ignore:
Timestamp:
24/01/16 18:33:53 (5 years ago)
Author:
mjuckes
Message:

Adding hdldemo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/overviewTabs.py

    r555 r558  
    6363          for i in xx: 
    6464            self.doTable(m,l1,i.uid,self.cc,acc=False) 
     65          self.doTable(m,l1,m2,self.cc) 
    6566          self.makeMMhtml(m,m2) 
    66           self.doTable(m,l1,m2,self.cc) 
    6767        else: 
    6868          self.doTable(m,l1,m2,self.cc) 
     
    7272  def makeMMhtml(self,m,m2): 
    7373    fss = '%s-%s_%s_%s.html' % (m,m2,self.tiermax, self.pmax) 
     74    if len( self.cc[kc].a.keys() ) == 0: 
     75      return 
    7476    oo = open( 'tabs03/%s' % fss, 'w' ) 
    75     ttl = 'Date requested by %s from %s experiments (tier %s, priority %s' % (m,m2,self.tiermax,self.pmax) 
     77    ttl = 'Date requested by %s from %s experiments (tier %s, priority %s)' % (m,m2,self.tiermax,self.pmax) 
    7678    jsh = '' 
    77     bdy = '<h1>%s</h1>\n' % ttl 
    78     bdy += '<p>All variables in one <a href="../data/tabs02/%s-%s_%s_%s.xlsx">Excel file</a></p>\n' % (m,m2,self.tiermax, self.pmax) 
    79  
    80     bdy += '<table>\n' 
     79    pream = '<h1>%s</h1>\n' % ttl 
     80    pream += '<p>All variables in one <a href="../data/tabs02/%s-%s_%s_%s.xlsx">Excel file</a></p>\n' % (m,m2,self.tiermax, self.pmax) 
     81    pream += '<ul>' 
     82    kc = '_%s_%s' % (m,m2) 
     83    for k in sorted( self.cc[kc].a.keys() ): 
     84      pream += '<li>%s: %s</li>\n' % (k,vfmt(self.cc[kc].a[k]*2.) ) 
     85    pream += '</ul>' 
     86 
     87    bdy = pream + '<table>\n' 
    8188    bdy += '<tr><th>Experiment</th><th>Volume (and link to variable lists)</th></tr>\n' 
    8289    for i in self.cc[m].ee[m2]: 
    83       x = self.cc[m].a[i.uid]*2. 
    84       s = vfmt( x ) 
    85       bdy += '<tr><td>%s</td><td><a href="../data/tabs02/%s-%s_%s_%s.xlsx">%s</a></td></tr>\n' % (i.label,m,i.uid,self.tiermax, self.pmax,s) 
     90      if i.uid in self.cc[m].a: 
     91        x = self.cc[m].a[i.uid]*2. 
     92        if x > 0: 
     93          s = vfmt( x ) 
     94          bdy += '<tr><td>%s</td><td><a href="../data/tabs02/%s-%s_%s_%s.xlsx">%s</a></td></tr>\n' % (i.label,m,i.uid,self.tiermax, self.pmax,s) 
    8695    bdy += '</table>\n' 
    8796 
     
    8998    oo.close() 
    9099     
    91      
    92  
    93100  def writeMips(self,sss=False): 
    94101 
     
    170177 
    171178  def doTable(self,m,l1,m2,collector,acc=True): 
    172         """acc allows accumulation of values to be switched off when called in single expt mode""" 
     179      """acc allows accumulation of values to be switched off when called in single expt mode""" 
    173180         
    174         x = sc.volByExpt( l1, m2, expFullEx=(m2 in self.mips), pmax=self.pmax ) 
     181      x = sc.volByExpt( l1, m2, expFullEx=(m2 in self.mips), pmax=self.pmax ) 
     182      if x[0] > 0: 
    175183        collector[m].a[m2] += x[0] 
     184        im2 = self.dq.inx.uid[m2] 
    176185# 
    177186# create sum for each table 
     
    185194            collector['_%s_%s' % (m,m2)].a[i.mipTable] += xxx 
    186195        assert x[0] == xs, 'ERROR.0088: consistency problem %s  %s %s %s' % (m,m2,x[0],xs) 
    187         if m == 'FAFMIP' and m2 == 'DECK': 
    188           print ( 'FAFMIP [1]:: %s' % str(x[1].keys() ) ) 
    189           print ( 'FAFMIP [2]:: %s' % str( collector['_FAFMIP_DECK'].a.keys() ) ) 
     196        if x[0] == 0: 
     197          print 'Zero size:',m,m2 
     198          if len( x[2].keys() ) > 0: 
     199             print 'ERROR:zero: ',m,m2,x[2].keys() 
    190200 
    191201        if acc: 
     
    201211        if len( dd.keys() ) > 0: 
    202212          collector[m].dd[m2] = dd 
     213          if im2._h.label == 'experiment': 
     214            dothis = self.tiermax >= im2.tier 
     215### 
     216### BUT ... there is a treset in the request item .... it may be that some variables are excluded ... 
     217###         need the variable list itself ..... 
     218### 
    203219          makeTables.makeTab( subset=lll, dest='tab2/%s-%s_%s_%s.xlsx' % (m,m2,self.tiermax,self.pmax) ) 
    204220 
Note: See TracChangeset for help on using the changeset viewer.