Ignore:
Timestamp:
30/11/16 10:00:03 (3 years ago)
Author:
mjuckes
Message:

added key VIACSAB integration code

File:
1 edited

Legend:

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

    r876 r884  
    808808    cc = collections.defaultdict(list) 
    809809    dd = collections.defaultdict(int) 
     810    mips = set() 
     811    for i in dq.coll['mip'].items: 
     812      mips.add( i.uid ) 
    810813    for i in dq.coll['var'].items: 
    811814      cc[i.prov].append( i.label ) 
     
    860863      kk += 1 
    861864      p = item.getAttribute( 'prov' )   
    862       assert ee.has_key(p), 'Unmatched key: %s' % p 
    863       item.setAttribute( 'provmip', ee[p] ) 
     865      p0 = item.getAttribute( 'provmip' )   
     866      if p0 not in mips: 
     867        if p in mips: 
     868          item.setAttribute( 'provmip', p ) 
     869        else: 
     870          assert ee.has_key(p), 'Unmatched key: %s' % p 
     871          assert ee[p] in mips, 'Unknown provenance: %s, %s' % (p,ee[p]) 
     872          item.setAttribute( 'provmip', ee[p] ) 
    864873       
    865874  def fixCellMethods(self,dq): 
Note: See TracChangeset for help on using the changeset viewer.