Changeset 591 for CMIP6dreqbuild/trunk/src/framework/scanDreq.py
- Timestamp:
- 04/02/16 19:29:33 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/src/framework/scanDreq.py
r583 r591 562 562 self.doc = xml.dom.minidom.parse( src ) 563 563 self.dreq = dreq 564 self.removedUids = set()564 self.removedUids = {} 565 565 this = self.doc.getElementsByTagName('var')[0] 566 566 dil = this.getElementsByTagName('item') … … 576 576 dil = this.getElementsByTagName('item') 577 577 578 578 579 filterStr = True 579 580 for item in dil: … … 583 584 print 'UNUSED STRUCTURE: %s, %s' % (lab,uid) 584 585 this.removeChild( item ) 586 self.removedUids[uid] = 'structure: %s' % lab 585 587 else: 586 588 tmid = item.getAttribute( 'tmid' ) … … 603 605 for item in dil: 604 606 uid = item.getAttribute( 'uid' ) 605 if 'requestLink' not in dq.inx.iref_by_sect[uid].a: 607 if ('requestLink' not in dq.inx.iref_by_sect[uid].a) and ('tableSection' not in dq.inx.iref_by_sect[uid].a): 608 self.removedUids[ uid ] = 'requestVarGroup: %s' % item.getAttribute( 'label' ) 606 609 this.removeChild(item) 607 self.removedUids.add( uid )608 610 nn+=1 609 611 print 'Unused variable groups removed: %s' % nn … … 618 620 if vgid not in s1: 619 621 this.removeChild(item) 620 self.removedUids .add( uid)622 self.removedUids[ uid ] = 'requestVar: %s' % item.getAttribute( 'label' ) 621 623 nn+=1 622 624 print 'Unused request variables removed: %s' % nn … … 760 762 new2.setAttribute( 'mip', 'OMIP' ) 761 763 new2.setAttribute( 'table', 'OMIP-Omon' ) 764 ##if vid not in dq.inx.uid: 765 ##print 'ERROR.005.0001: vid %s not found' % vid 766 if omipOmonUid not in dq.inx.uid: 767 print 'ERROR.005.0001: vgid %s not found' % omipOmonUid 768 762 769 thisRqv.appendChild(new2) 763 770 764 771 765 def missingRefs(self,mrefs, clear=True):772 def missingRefs(self,mrefs,dq,clear=True): 766 773 this = self.doc.getElementsByTagName('remarks')[0] 767 774 if clear: … … 785 792 else: 786 793 tattr = '__multiple__' 787 if k not in self.removedUids:794 if tid == None or (tid not in self.removedUids): 788 795 item = self.doc.createElement( 'item' ) 789 796 item.setAttribute( 'uid', k ) … … 793 800 if tid != None: 794 801 item.setAttribute( 'tid', tid ) 802 if tid not in dq.inx.uid: 803 print 'ERROR.005.0002: tid %s not found' % tid 795 804 item.setAttribute( 'class', 'missingLink' ) 796 805 item.setAttribute( 'description', 'Missing links detected and marked for fixing' ) … … 818 827 an.rvgCheck(dq) 819 828 an.strTtl(dq) 820 an.missingRefs( dq.inx.missingIds ) 829 for k in an.removedUids: 830 print 'REMOVED: %s: %s' % (k,an.removedUids[k]) 831 an.missingRefs( dq.inx.missingIds, dq )
Note: See TracChangeset
for help on using the changeset viewer.