Author: bugman
Date: Thu Dec 11 17:27:20 2014
New Revision: 27095

URL: http://svn.gna.org/viewcvs/relax?rev=27095&view=rev
Log:
Fix for the IDs returned by 
lib.structure.internal.coordinates.assemble_coord_array().

The list of unique structure IDs was being incorrectly constructed if multiple 
molecules are present
but the molecules argument was not supplied.  It would be of a different size 
to the coordinate data
structure.


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

Modified: trunk/lib/structure/internal/coordinates.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/coordinates.py?rev=27095&r1=27094&r2=27095&view=diff
==============================================================================
--- trunk/lib/structure/internal/coordinates.py (original)
+++ trunk/lib/structure/internal/coordinates.py Thu Dec 11 17:27:20 2014
@@ -77,6 +77,17 @@
             # Printout.
             print("        Model: %s" % model.num)
 
+            # Create a new structure ID for all the molecules of this model 
(if the molecules argument is not supplied).
+            if molecules == None:
+                if len(object_names) > 1 and num_models > 1:
+                    ids.append('%s, model %i' % (object_names[struct_index], 
model.num))
+                elif len(object_names) > 1:
+                    ids.append('%s' % (object_names[struct_index]))
+                elif num_models > 1:
+                    ids.append('model %i' % (model.num))
+                else:
+                    ids.append(None)
+
             # Extend the lists.
             if molecules == None:
                 atom_ids.append([])
@@ -115,14 +126,15 @@
                             elements.append({})
 
                     # Create a new structure ID.
-                    if len(object_names) > 1 and num_models > 1:
-                        ids.append('%s, model %i, %s' % 
(object_names[struct_index], model.num, mol_name))
-                    elif len(object_names) > 1:
-                        ids.append('%s, %s' % (object_names[struct_index], 
mol_name))
-                    elif num_models > 1:
-                        ids.append('model %i, %s' % (model.num, mol_name))
-                    else:
-                        ids.append('%s' % mol_name)
+                    if molecules != None:
+                        if len(object_names) > 1 and num_models > 1:
+                            ids.append('%s, model %i, %s' % 
(object_names[struct_index], model.num, mol_name))
+                        elif len(object_names) > 1:
+                            ids.append('%s, %s' % (object_names[struct_index], 
mol_name))
+                        elif num_models > 1:
+                            ids.append('model %i, %s' % (model.num, mol_name))
+                        else:
+                            ids.append('%s' % mol_name)
 
                 # A unique identifier.
                 if molecules != None:


_______________________________________________
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