mailr5192 - /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 March 23, 2008 - 15:44:
Author: bugman
Date: Sun Mar 23 15:27:16 2008
New Revision: 5192

URL: http://svn.gna.org/viewcvs/relax?rev=5192&view=rev
Log:
Modified generate_spin_id() to handle None and int entries in the data array.


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=5192&r1=5191&r2=5192&view=diff
==============================================================================
--- 1.3/generic_fns/selection.py (original)
+++ 1.3/generic_fns/selection.py Sun Mar 23 15:27:16 2008
@@ -505,23 +505,23 @@
     id = ""
 
     # Molecule data.
-    if mol_name_col != None:
+    if mol_name_col != None and data[mol_name_col]:
         id = id + "#" + data[mol_name_col]
 
     # Residue data.
-    if res_num_col != None:
-        id = id + ":" + data[res_num_col]
-    if  res_num_col != None and res_name_col != None:
+    if res_num_col != None and data[res_num_col] != None:
+        id = id + ":" + str(data[res_num_col])
+    if (res_num_col != None and data[res_num_col] != None) and (res_name_col 
!= None and data[res_name_col]):
         id = id + "&:" + data[res_name_col]
-    elif res_name_col != None:
+    elif res_name_col != None and data[res_name_col]:
         id = id + ":" + data[res_name_col]
 
     # Spin data.
-    if spin_num_col != None:
-        id = id + "@" + data[spin_num_col]
-    if  spin_num_col != None and spin_name_col != None:
+    if spin_num_col != None and data[spin_num_col] != None:
+        id = id + "@" + str(data[spin_num_col])
+    if (spin_num_col != None and data[spin_num_col] != None) and 
(spin_name_col != None and data[spin_name_col]):
         id = id + "&@" + data[spin_name_col]
-    elif spin_name_col != None:
+    elif spin_name_col != None and data[spin_name_col]:
         id = id + "@" + data[spin_name_col]
 
     # Return the spin id string.




Related Messages


Powered by MHonArc, Updated Sun Mar 23 16:00:24 2008