mailr28160 - /trunk/lib/structure/internal/object.py


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

Header


Content

Posted by edward on January 11, 2016 - 09:37:
Author: bugman
Date: Mon Jan 11 09:37:45 2016
New Revision: 28160

URL: http://svn.gna.org/viewcvs/relax?rev=28160&view=rev
Log:
Bug fix for the structure.read_pdb user function (bug #24300, 
https://gna.org/bugs/?24300).

When the merge flag is True, and both multiple structures and multiple models 
are present, the
structure.read_pdb user function would fail with a RelaxError.  The problem 
was that the molecule
index was simply not being updated correctly.


Modified:
    trunk/lib/structure/internal/object.py

Modified: trunk/lib/structure/internal/object.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=28160&r1=28159&r2=28160&view=diff
==============================================================================
--- trunk/lib/structure/internal/object.py      (original)
+++ trunk/lib/structure/internal/object.py      Mon Jan 11 09:37:45 2016
@@ -2506,6 +2506,7 @@
                 for k in range(len(model.mol)):
                     if model.mol[k].mol_name == set_mol_name[j]:
                         found = True
+                        index = k
                 if not found:
                     merge_new = False
 
@@ -2530,9 +2531,8 @@
                         print("Adding molecule '%s'%s (from the original 
molecule number %s%s)." % (set_mol_name[j], new_model_text, 
orig_mol_num[i][j], orig_model_text))
 
                 # The index of the new molecule to add or merge.
-                index = len(model.mol)
-                if merge_new:
-                    index -= 1
+                if not merge_new:
+                    index = len(model.mol)
 
                 # Store the index+1 as the new molecule number, and store 
the original molecule number.
                 store_mol_num_new[i].append(index+1)




Related Messages


Powered by MHonArc, Updated Mon Jan 11 16:20:18 2016