mailr4722 - /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 - 11:21:
Author: bugman
Date: Tue Jan 15 11:21:38 2008
New Revision: 4722

URL: http://svn.gna.org/viewcvs/relax?rev=4722&view=rev
Log:
Wrote the model_setup() method, although more code may be necessary.


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=4722&r1=4721&r2=4722&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 11:21:38 
2008
@@ -213,6 +213,32 @@
         param_vector, func, iter_count, f_count, g_count, h_count, warning = 
results
 
 
+    def model_setup(self, N=None):
+        """Function for setting up the N-state model.
+
+        @param N:   The number of states.
+        @type N:    int
+        """
+
+        # Test if the current data pipe exists.
+        if not relax_data_store.current_pipe:
+            raise RelaxNoPipeError
+
+        # Alias the current data pipe.
+        cdp = relax_data_store[relax_data_store.current_pipe]
+
+        # Test if the pipe type is 'N-state'.
+        function_type = cdp.pipe_type
+        if function_type != 'N-state':
+            raise RelaxFuncSetupError, specific_fns.get_string(function_type)
+
+        # Initialise the data structures (if needed).
+        self.data_init()
+
+        # Set the value of N.
+        cdp.N = N
+        
+
     def return_data_name(self, name):
         """
         N-state model data type string matching patterns




Related Messages


Powered by MHonArc, Updated Tue Jan 15 11:40:06 2008