Changeset 165


Ignore:
Timestamp:
19/06/14 13:31:59 (6 years ago)
Author:
astephen
Message:

updated to allow for absent 'product' attribute in SPECS data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/utils_c4.py

    r155 r165  
    316316    assert self.completed, 'method getDrs should not be called if checks have not been completed successfully' 
    317317    ee = {} 
     318    if not self.globalAts.has_key('product'): 
     319        self.globalAts['product'] = 'output' 
    318320    for k in self.drsMappings: 
    319321      if self.drsMappings[k] == '@var': 
     
    473475         if self.globalAttributesInFn[i][0] == "@": 
    474476           if self.globalAttributesInFn[i][1:] == "mip_id": 
    475                thisVal = string.split( globalAts["table_id"] )[1] 
     477               bits = string.split( globalAts[ "table_id" ] )  
     478               if len( bits ) > 2 and bits[0] == "Table": 
     479                 thisVal = bits[1] 
     480               else: 
     481                 thisVal = globalAts[ "table_id" ] 
     482                 self.test( False, 'Global attribute table_id does not conform to CMOR pattern ["Table ......"]: %s' % thisVal, part=True) 
    476483           elif self.globalAttributesInFn[i][1:] == "experiment_family": 
    477484               thisVal = globalAts["experiment_id"][:-4] 
Note: See TracChangeset for help on using the changeset viewer.