mailr18867 - /trunk/generic_fns/structure/api_base.py


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

Header


Content

Posted by edward on March 19, 2013 - 10:18:
Author: bugman
Date: Tue Mar 19 10:18:19 2013
New Revision: 18867

URL: http://svn.gna.org/viewcvs/relax?rev=18867&view=rev
Log:
Proper fix for the pack_structs() structural API method.

This was incorrectly done in r18858, but now the index of the new molecule is 
handled correctly.


Modified:
    trunk/generic_fns/structure/api_base.py

Modified: trunk/generic_fns/structure/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/structure/api_base.py?rev=18867&r1=18866&r2=18867&view=diff
==============================================================================
--- trunk/generic_fns/structure/api_base.py (original)
+++ trunk/generic_fns/structure/api_base.py Tue Mar 19 10:18:19 2013
@@ -556,8 +556,12 @@
                 else:
                     print("Adding molecule '%s' to model %s (from the 
original molecule number %s of model %s)" % (set_mol_name[j], 
set_model_num[i], orig_mol_num[j], orig_model_num[i]))
 
+                # The index of the new molecule to add or merge.
+                index = len(model.mol)
+                if merge:
+                    index -= 1
+
                 # Consistency check.
-                index = len(model.mol)
                 if model.num != self.structural_data[0].num and 
self.structural_data[0].mol[index].mol_name != set_mol_name[j]:
                     raise RelaxError("The new molecule name of '%s' in model 
%s does not match the corresponding molecule's name of '%s' in model %s." % 
(set_mol_name[j], set_model_num[i], 
self.structural_data[0].mol[index].mol_name, self.structural_data[0].num))
 




Related Messages


Powered by MHonArc, Updated Tue Mar 19 11:20:03 2013