mailr3898 - /1.3/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 November 25, 2007 - 12:12:
Author: bugman
Date: Sun Nov 25 12:12:43 2007
New Revision: 3898

URL: http://svn.gna.org/viewcvs/relax?rev=3898&view=rev
Log:
Big bug fix for the generic_fns.selection.exists_mol_res_spin_data() function.


Modified:
    1.3/generic_fns/selection.py

Modified: 1.3/generic_fns/selection.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/selection.py?rev=3898&r1=3897&r2=3898&view=diff
==============================================================================
--- 1.3/generic_fns/selection.py (original)
+++ 1.3/generic_fns/selection.py Sun Nov 25 12:12:43 2007
@@ -364,33 +364,43 @@
     if len(cdp.mol) > 1:
         return True
 
+    # The single molecule has been named.
+    if cdp.mol[0].name != None:
+        return True
+
     # More than 1 residue (hence data exists).
     if len(cdp.mol[0].res) > 1:
         return True
 
+    # The single residue has been named or numbered.
+    if cdp.mol[0].res[0].name != None or cdp.mol[0].res[0].num != None:
+        return True
+
     # More than 1 spin (hence data exists).
     if len(cdp.mol[0].res[0].spin) > 1:
         return True
 
-    # Test the name and number of the single spin.
-    if cdp.mol[0].res[0].spin[0].num == None and 
cdp.mol[0].res[0].spin[0].name == None:
-        # The object names in an empty container.
-        white_list = ['name', 'num', 'select'] 
-
-        # Loop over the objects in the spin container.
-        for name in dir(cdp.mol[0].res[0].spin[0]):
-            # Skip white listed objects.
-            if name in white_list:
-                continue
-
-            # Skip objects beginning with '__'.
-            if search('^__', name):
-                continue
-
-            # Found an object not in the white list (hence the spin 
container has been modified).
-            return True
-
-    # No data.
+    # The single spin has been named or numbered.
+    if cdp.mol[0].res[0].spin[0].name != None or 
cdp.mol[0].res[0].spin[0].num != None:
+        return True
+
+    # The object names in an empty spin container.
+    white_list = ['name', 'num', 'select'] 
+
+    # Loop over the objects in the spin container.
+    for name in dir(cdp.mol[0].res[0].spin[0]):
+        # Skip white listed objects.
+        if name in white_list:
+            continue
+
+        # Skip objects beginning with '__'.
+        if search('^__', name):
+            continue
+
+        # Found an object not in the white list (hence the spin container 
has been modified).
+        return True
+
+    # No data!
     return False
 
 




Related Messages


Powered by MHonArc, Updated Sun Nov 25 12:20:21 2007