mailr17700 - /trunk/generic_fns/sequence.py


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

Header


Content

Posted by edward on October 04, 2012 - 19:02:
Author: bugman
Date: Thu Oct  4 19:02:08 2012
New Revision: 17700

URL: http://svn.gna.org/viewcvs/relax?rev=17700&view=rev
Log:
Fix for bug #20213 (https://gna.org/bugs/?20213).

The problem was that the generic_fns.sequence.generate() function was 
searching for a spin based on
its spin ID generated from the spin name and not spin number.  Hence two 
spins with the same name
but different numbers were treated as the same spin, and only data from one 
was being generated via
the copy() function.


Modified:
    trunk/generic_fns/sequence.py

Modified: trunk/generic_fns/sequence.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/sequence.py?rev=17700&r1=17699&r2=17700&view=diff
==============================================================================
--- trunk/generic_fns/sequence.py (original)
+++ trunk/generic_fns/sequence.py Thu Oct  4 19:02:08 2012
@@ -243,12 +243,13 @@
         create_molecule(mol_name=mol_name, pipe=pipe)
 
     # A new residue.
-    if not return_residue(generate_spin_id(mol_name=mol_name, 
res_num=res_num, res_name=res_name), pipe=pipe):
+    curr_res = return_residue(generate_spin_id(mol_name=mol_name, 
res_num=res_num, res_name=res_name), pipe=pipe)
+    if not curr_res or ((res_num != None and curr_res.num != res_num) or 
(res_name != None and curr_res.name != res_name)):
         create_residue(mol_name=mol_name, res_num=res_num, 
res_name=res_name, pipe=pipe)
 
     # A new spin.
     curr_spin = return_spin(generate_spin_id(mol_name=mol_name, 
res_num=res_num, res_name=res_name, spin_num=spin_num, spin_name=spin_name), 
pipe=pipe)
-    if not curr_spin:
+    if not curr_spin or ((spin_num != None and curr_spin.num != spin_num) or 
(spin_name != None and curr_spin.name != spin_name)):
         # Add the spin.
         curr_spin = create_spin(mol_name=mol_name, res_num=res_num, 
res_name=res_name, spin_num=spin_num, spin_name=spin_name, pipe=pipe)
 




Related Messages


Powered by MHonArc, Updated Fri Oct 05 19:00:02 2012