Changeset 425 for CMIP6dreq/trunk


Ignore:
Timestamp:
16/10/15 16:13:45 (5 years ago)
Author:
mjuckes
Message:

spurious files removed

Location:
CMIP6dreq/trunk/dreqPy
Files:
1 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreq/trunk/dreqPy/__init__.py

    r419 r425  
    11 
    22 
    3 __version__ = "01.beta.07" 
     3__version__ = "01.beta.08" 
    44__title__ = "dreqPy" 
    55__description__ = "CMIP6 Data Request Python API" 
  • CMIP6dreq/trunk/dreqPy/dreq.py

    r412 r425  
    9292                   m = '<li>%s: %s [missing link]</li>' % ( a, self.__dict__[a] ) 
    9393                 else: 
    94                    targ = self._base._inx.uid[ self.__dict__[a] ] 
     94                   try: 
     95                     targ = self._base._inx.uid[ self.__dict__[a] ] 
     96                   except: 
     97                     print a, self.__dict__[a], sect 
     98                     raise 
    9599                   m = '<li>%s: [%s] %s [%s]</li>' % ( a, targ._h.label, targ.label, targ.__href__() ) 
    96100               else: 
  • CMIP6dreq/trunk/dreqPy/scope.py

    r412 r425  
    44""" 
    55import dreq 
     6from utilities import cmvFilter 
    67import collections, string 
    78 
     
    5859      self.rlu[k] = i.uid 
    5960 
     61    self.cmvFilter = cmvFilter( self ) 
    6062    self.tierMax = tierMax 
    6163    self.mips = { i.mip for i in  self.dq.coll['requestItem'].items} 
     
    141143    return self.ntot 
    142144 
    143   def volByExpt( self, l1, ex, exptList, pmax=2, cc=None ): 
     145  def volByExpt( self, l1, ex, exptList, pmax=2, cc=None, retainRedundantRank=False ): 
    144146    """volByExpt: calculates the total data volume associated with an experiment/experiment group and a list of request items. 
    145147          The calculation has some approximations concerning the number of years in each experiment group.""" 
     
    169171    ##vars = {vid for vid in vars if inx.uid[vid][0] == u'CMORvar'} 
    170172    vars = {vid for vid in vars if inx.uid[vid]._h.label == u'CMORvar'} 
     173## 
     174## filter by configuration option and rank 
     175## 
     176    if not retainRedundantRank: 
     177      len1 = len(vars) 
     178      cmv = self.cmvFilter.filterByChoiceRank(cmv=vars) 
     179      ## print 'After filter: %s [%s]' % (len(cmv),len1) 
     180 
     181      vars = cmv 
     182     
     183    self.vars = vars 
    171184 
    172185    e = {} 
     
    269282      print ( '%12.12s: %6.2fTb' % (m,v*bytesPerFloat*1.e-12) ) 
    270283 
    271   def volByMip( self, mip, pmax=2): 
     284  def volByMip( self, mip, pmax=2, retainRedundantRank=False): 
    272285 
    273286    if type(mip) in {type( '' ),type( u'') }: 
     
    289302    vtot = 0 
    290303    cc = collections.defaultdict( col_count ) 
     304    self.allVars = set() 
    291305    for e in exps: 
    292306      expts = self.esid_to_exptList(e,deref=True) 
    293       self.volByE[e] = self.volByExpt( l1, e, expts, pmax=pmax, cc=cc ) 
     307      self.volByE[e] = self.volByExpt( l1, e, expts, pmax=pmax, cc=cc, retainRedundantRank=retainRedundantRank ) 
    294308      vtot += self.volByE[e][0] 
     309      self.allVars = self.allVars.union( self.vars ) 
    295310    self.indexedVol = cc 
    296311 
  • CMIP6dreq/trunk/dreqPy/simpleCheck.py

    r411 r425  
    4545    self.lab = lab 
    4646    self.ok = True 
     47 
     48#document directory 
     49    self.docdir = '../docs' 
     50#schema location 
     51    self.schema = '%s/dreq2Schema.xsd' % self.docdir 
     52#sample xml location 
     53    self.sampleXml = '%s/dreq2Sample.xml' % self.docdir 
     54#definition document xml location 
     55    self.defnXml = '%s/dreq2Defn.xml' % self.docdir 
     56 
    4757    ml = inspect.getmembers( self, predicate=inspect.ismethod )  
    4858    ok = True 
     
    6878  def _ch02_importSample(self): 
    6979    import dreq 
    70     rq = dreq.loadDreq( dreqXML='out/dreq2Sample.xml',configdoc='out/dreq2Defn.xml' ) 
     80    rq = dreq.loadDreq( dreqXML=self.sampleXml,configdoc=self.defnXml ) 
    7181    print 'Dreq sample load checked' 
    7282    self.ok = True 
     
    96106      return 
    97107 
    98 #schema location 
    99     schema = '../docs/dreq2Schema.xsd' 
    100 #xml location 
    101     xml = '../docs/dreq2Sample.xml' 
    102  
    103     cmd = 'xmllint --noout --schema %s %s  2> .simpleCheck_check2_err.txt 1>.simpleCheck_check2.txt' % (schema,xml)  
     108    cmd = 'xmllint --noout --schema %s %s  2> .simpleCheck_check2_err.txt 1>.simpleCheck_check2.txt' % (self.schema,self.sampleXml)  
    104109    os.popen( cmd ).readlines() 
    105110    ii = open( '.simpleCheck_check2_err.txt' ).readlines() 
Note: See TracChangeset for help on using the changeset viewer.