mailr15237 - in /branches/frame_order_testing: ./ generic_fns/mol_res_spin.py


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

Header


Content

Posted by edward on January 24, 2012 - 19:37:
Author: bugman
Date: Tue Jan 24 19:37:56 2012
New Revision: 15237

URL: http://svn.gna.org/viewcvs/relax?rev=15237&view=rev
Log:
Merged revisions 15232,15236 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3

........
  r15232 | bugman | 2012-01-24 18:42:44 +0100 (Tue, 24 Jan 2012) | 6 lines
  
  Reordered the checks in Selection.__contains_mol_res_spin_containers().
  
  This cuts the number of function calls down by avoiding relax_re.search() 
calls if residue or spin
  numbers match.
........
  r15236 | bugman | 2012-01-24 19:25:14 +0100 (Tue, 24 Jan 2012) | 5 lines
  
  More speed ups for the Selection.__contains_mol_res_spin_containers() 
method.
  
  Certain unnecessary tests are now skipped.
........

Modified:
    branches/frame_order_testing/   (props changed)
    branches/frame_order_testing/generic_fns/mol_res_spin.py

Propchange: branches/frame_order_testing/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 24 19:37:56 2012
@@ -1,1 +1,1 @@
-/1.3:1-15230
+/1.3:1-15236

Modified: branches/frame_order_testing/generic_fns/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/mol_res_spin.py?rev=15237&r1=15236&r2=15237&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/mol_res_spin.py (original)
+++ branches/frame_order_testing/generic_fns/mol_res_spin.py Tue Jan 24 
19:37:56 2012
@@ -223,6 +223,10 @@
             # No molecule container sent in, therefore the molecule is 
assumed to match.
             select_mol = True
 
+        # Quick exit.
+        if not select_mol:
+            return False
+
         # Residue container.
         if res:
             # No residues in selection object, therefore default to a match.
@@ -230,11 +234,15 @@
                 select_res = True
 
             # A true match.
-            elif relax_re.search(self.residues, res.name) or res.num in 
self.residues:
+            elif res.num in self.residues or relax_re.search(self.residues, 
res.name):
                 select_res = True
         else:
             # No residue container sent in, therefore the residue is assumed 
to match.
             select_res = True
+
+        # Quick exit.
+        if not select_res:
+            return False
 
         # Spin container.
         if spin:
@@ -243,7 +251,7 @@
                 select_spin = True
 
             # A true match.
-            elif relax_re.search(self.spins, spin.name) or spin.num in 
self.spins:
+            elif spin.num in self.spins or relax_re.search(self.spins, 
spin.name):
                 select_spin = True
         else:
             # No spin container sent in, therefore the spin is assumed to 
match.




Related Messages


Powered by MHonArc, Updated Tue Jan 24 21:20:01 2012