mailr10301 - /1.3/specific_fns/n_state_model.py


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

Header


Content

Posted by edward on January 25, 2010 - 12:40:
Author: bugman
Date: Mon Jan 25 12:40:54 2010
New Revision: 10301

URL: http://svn.gna.org/viewcvs/relax?rev=10301&view=rev
Log:
Fixes for the N-state model for when only NOEs are present.

This fixes a bug introduced at r10243.


Modified:
    1.3/specific_fns/n_state_model.py

Modified: 1.3/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=10301&r1=10300&r2=10301&view=diff
==============================================================================
--- 1.3/specific_fns/n_state_model.py (original)
+++ 1.3/specific_fns/n_state_model.py Mon Jan 25 12:40:54 2010
@@ -1267,6 +1267,10 @@
         # Determine if alignment tensors or RDCs are to be used.
         data_types = self._base_data_types()
 
+        # Nothing more to do!
+        if not param_vector:
+            return None, None, data_types, None
+
         # Diagonal scaling.
         scaling_matrix = 
self._assemble_scaling_matrix(data_types=data_types, scaling=scaling)
         param_vector = dot(inv(scaling_matrix), param_vector)
@@ -1408,11 +1412,13 @@
         # Set up the target function for direct calculation.
         model, param_vector, data_types, scaling_matrix = 
self._target_fn_setup()
 
-        # Make a function call.
-        chi2 = model.func(param_vector)
-
-        # Store the global chi-squared value.
-        cdp.chi2 = chi2
+        # Calculate the chi-squared value.
+        if model:
+            # Make a function call.
+            chi2 = model.func(param_vector)
+
+            # Store the global chi-squared value.
+            cdp.chi2 = chi2
 
         # NOE potential.
         if hasattr(cdp, 'noe_restraints'):




Related Messages


Powered by MHonArc, Updated Mon Jan 25 13:00:02 2010