mailr4746 - /branches/N_state_model/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 15, 2008 - 14:41:
Author: bugman
Date: Tue Jan 15 14:41:18 2008
New Revision: 4746

URL: http://svn.gna.org/viewcvs/relax?rev=4746&view=rev
Log:
Started to implement the grid_search() method.


Modified:
    branches/N_state_model/specific_fns/n_state_model.py

Modified: branches/N_state_model/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4746&r1=4745&r2=4746&view=diff
==============================================================================
--- branches/N_state_model/specific_fns/n_state_model.py (original)
+++ branches/N_state_model/specific_fns/n_state_model.py Tue Jan 15 14:41:18 
2008
@@ -71,6 +71,24 @@
                             value, the greater the verbosity.
         @type verbosity:    int
         """
+
+        # Alias the current data pipe.
+        cdp = relax_data_store[relax_data_store.current_pipe]
+
+        # Test if the N-state model has been set up.
+        if not hasattr(cdp, 'N'):
+            raise RelaxNoModelError, 'N-state'
+
+        # The number of parameters.
+        n = self.param_num()
+
+        # Test the grid search options.
+        self.test_grid_ops(lower=lower, upper=upper, inc=inc, n=n)
+
+        # Make sure that the length of the parameter array is > 0.
+        if n == 0:
+            print "Cannot run a grid search on a model with zero parameters, 
skipping the grid search."
+            return
 
         # Minimisation.
         self.minimise(min_algor='grid', constraints=constraints, 
verbosity=verbosity, sim_index=sim_index)




Related Messages


Powered by MHonArc, Updated Tue Jan 15 15:00:14 2008