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)


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to