Ignore:
Timestamp:
19/11/15 09:53:53 (5 years ago)
Author:
mjuckes
Message:

test

File:
1 edited

Legend:

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

    r435 r489  
    5656 
    5757## set of vids associated with choices 
    58     s = {i.vid for i in self.dq.coll['varChoiceLinkC'].items} 
     58    s = set() 
     59    for i in self.dq.coll['varChoiceLinkC'].items: 
     60      s.add( i.vid ) 
    5961 
    6062## set of variables in current selection associated with choices 
    61     v1 = { u for u in cmv if u in s } 
     63    v1 = set( [ u for u in cmv if u in s ] ) 
    6264    if len(v1) == 0: 
    6365      ## print 'Nothing to do' 
     
    6567 
    6668## set of "rank" choice groups relevant to current selection 
    67     s1 = {i.cid for i in self.dq.coll['varChoiceLinkC'].items if i.vid in v1} 
     69    s1 = set( [i.cid for i in self.dq.coll['varChoiceLinkC'].items if i.vid in v1] ) 
    6870 
    6971    self.rejected = set() 
     
    7375## set of choice links in group s which relate to a variable in current selection 
    7476## 
    75       this = {i for i in self.dq.coll['varChoiceLinkC'].items if i.vid in v1 and i.cid == s} 
     77      this = set() 
     78      for i in self.dq.coll['varChoiceLinkC'].items: 
     79         if i.vid in v1 and i.cid == s: 
     80           set.add(i) 
    7681## 
    7782## value of configuration option (defaults to True here). 
     
    103108 
    104109## set of vids associated with choices 
    105     s = {i.vid for i in self.dq.coll['varChoiceLinkR'].items} 
     110    s = set( [i.vid for i in self.dq.coll['varChoiceLinkR'].items] ) 
    106111 
    107112## set of variables in current selection associated with choices 
    108     v1 = { u for u in cmv if u in s } 
     113    v1 = set( [ u for u in cmv if u in s ] ) 
    109114    if len(v1) == 0: 
    110115      ## print 'Nothing to do' 
     
    112117 
    113118## set of "rank" choice groups relevant to current selection 
    114     s1 = {i.cid for i in self.dq.coll['varChoiceLinkR'].items if i.vid in v1} 
     119    s1 = set( [i.cid for i in self.dq.coll['varChoiceLinkR'].items if i.vid in v1] ) 
    115120 
    116121    self.rejected = set() 
     
    120125## set of choice links in group s which relate to a variable in current selection 
    121126## 
    122       this = {i for i in self.dq.coll['varChoiceLinkR'].items if i.vid in v1 and i.cid == s} 
     127      this = set( [i for i in self.dq.coll['varChoiceLinkR'].items if i.vid in v1 and i.cid == s] ) 
    123128      if len(this) > 1: 
    124129        mr = max( [i.rank for i in this ] ) 
Note: See TracChangeset for help on using the changeset viewer.