mailr27561 - /trunk/specific_analyses/n_state_model/data.py


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

Header


Content

Posted by edward on February 05, 2015 - 18:47:
Author: bugman
Date: Thu Feb  5 18:47:41 2015
New Revision: 27561

URL: http://svn.gna.org/viewcvs/relax?rev=27561&view=rev
Log:
Big bug fix for the N-state model num_data_points() function.

This is from the specific_analyses.n_state_model.data module.  This code was 
very much out of date.
It was expecting an ancient behaviour where the spin container 'pcs' variable 
and interatomic data
container 'rdc' where lists of floats.  However these were converted many 
years ago to dictionaries
with keys set to the alignment IDs.  The result was that no RDCs nor PCSs 
were counted as a base
data point, so the function would in most cases return a value of zero.


Modified:
    trunk/specific_analyses/n_state_model/data.py

Modified: trunk/specific_analyses/n_state_model/data.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/n_state_model/data.py?rev=27561&r1=27560&r2=27561&view=diff
==============================================================================
--- trunk/specific_analyses/n_state_model/data.py       (original)
+++ trunk/specific_analyses/n_state_model/data.py       Thu Feb  5 18:47:41 
2015
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2014 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2015 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -26,6 +26,7 @@
 from numpy.linalg import norm
 
 # relax module imports.
+from lib.check_types import is_float
 from lib.errors import RelaxError
 from pipe_control.interatomic import interatomic_loop
 from pipe_control.mol_res_spin import return_spin, spin_loop
@@ -145,8 +146,8 @@
         # PCS data (skipping array elements set to None).
         if 'pcs' in data_types:
             if hasattr(spin, 'pcs'):
-                for pcs in spin.pcs:
-                    if isinstance(pcs, float):
+                for id in spin.pcs:
+                    if is_float(spin.pcs[id]):
                         n = n + 1
 
     # Interatomic data loop.
@@ -154,8 +155,8 @@
         # RDC data (skipping array elements set to None).
         if 'rdc' in data_types:
             if hasattr(interatom, 'rdc'):
-                for rdc in interatom.rdc:
-                    if isinstance(rdc, float):
+                for id in interatom.rdc:
+                    if is_float(interatom.rdc[id]):
                         n = n + 1
 
     # Alignment tensors.




Related Messages


Powered by MHonArc, Updated Thu Feb 05 19:00:02 2015