mailr26368 - /trunk/pipe_control/structure/main.py


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

Header


Content

Posted by edward on October 23, 2014 - 11:54:
Author: bugman
Date: Thu Oct 23 11:54:27 2014
New Revision: 26368

URL: http://svn.gna.org/viewcvs/relax?rev=26368&view=rev
Log:
Fix for the structure.load_spins user function when the from_mols argument is 
used.

The load_spins_multi_mol() function of the pipe_control.structure.main module 
was incorrectly
handling the atomic position returned by the internal structural object 
atom_loop() method.  This
position is a list of lists when multiple models are present.  But when only 
a single model is
present, it returns a simple list.


Modified:
    trunk/pipe_control/structure/main.py

Modified: trunk/pipe_control/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=26368&r1=26367&r2=26368&view=diff
==============================================================================
--- trunk/pipe_control/structure/main.py        (original)
+++ trunk/pipe_control/structure/main.py        Thu Oct 23 11:54:27 2014
@@ -29,6 +29,7 @@
 from warnings import warn
 
 # relax module imports.
+from lib.check_types import is_float
 from lib.checks import Check
 from lib.errors import RelaxError, RelaxFileError
 from lib.io import get_file_path, open_write_file, write_data
@@ -854,8 +855,11 @@
             # Generate a spin ID for the current atom.
             id = generate_spin_id_unique(mol_name=mol_name_target, 
res_num=res_num, res_name=res_name, spin_name=atom_name)
 
-            # Store the position info in all cases.
-            positions[mol_name][id] = pos[0]
+            # Store the position info in all cases, collapsing list of lists 
into single lists when needed.
+            if is_float(pos[0]):
+                positions[mol_name][id] = pos
+            else:
+                positions[mol_name][id] = pos[0]
 
             # Not a new ID.
             if id in ids:




Related Messages


Powered by MHonArc, Updated Thu Oct 23 12:00:03 2014