mailr18162 - /branches/frame_order_testing/generic_fns/selection.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 18, 2012 - 11:26:
Author: bugman
Date: Tue Dec 18 11:26:22 2012
New Revision: 18162

URL: http://svn.gna.org/viewcvs/relax?rev=18162&view=rev
Log:
The select.domain user function backend now uses the boolean_select() 
function.


Modified:
    branches/frame_order_testing/generic_fns/selection.py

Modified: branches/frame_order_testing/generic_fns/selection.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/selection.py?rev=18162&r1=18161&r2=18162&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/selection.py (original)
+++ branches/frame_order_testing/generic_fns/selection.py Tue Dec 18 11:26:22 
2012
@@ -414,21 +414,7 @@
 
         # Inside the domain.
         if spin_id in domain:
-            if boolean == 'OR':
-                print "OR: %s" % spin_id
-                spin.select = spin.select or True
-            elif boolean == 'NOR':
-                spin.select = not (spin.select or True)
-            elif boolean == 'AND':
-                spin.select = spin.select and True
-            elif boolean == 'NAND':
-                spin.select = not (spin.select and True)
-            elif boolean == 'XOR':
-                spin.select = not (spin.select and True) and (spin.select or 
True)
-            elif boolean == 'XNOR':
-                spin.select = (spin.select and True) or not (spin.select or 
True)
-            else:
-                raise RelaxError("Unknown boolean operator " + repr(boolean))
+            spin.select = boolean_select(current=spin.select, 
boolean=boolean)
 
     # Interatomic data loop.
     for interatom in interatomic_loop():
@@ -438,21 +424,7 @@
 
         # Inside the domain.
         if interatom.spin_id1 in domain or interatom.spin_id2 in domain:
-            if boolean == 'OR':
-                interatom.select = interatom.select or True
-            elif boolean == 'NOR':
-                interatom.select = not (interatom.select or True)
-            elif boolean == 'AND':
-                interatom.select = interatom.select and True
-            elif boolean == 'NAND':
-                interatom.select = not (interatom.select and True)
-            elif boolean == 'XOR':
-                interatom.select = not (interatom.select and True) and 
(interatom.select or True)
-            elif boolean == 'XNOR':
-                interatom.select = (interatom.select and True) or not 
(interatom.select or True)
-            else:
-                raise RelaxError("Unknown boolean operator " + repr(boolean))
-
+            interatom.select = boolean_select(current=interatom.select, 
boolean=boolean)
 
 
 def sel_interatom(spin_id1=None, spin_id2=None, boolean='OR', 
change_all=False):




Related Messages


Powered by MHonArc, Updated Tue Dec 18 11:40:02 2012