mailr6877 - /branches/rdc_analysis/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 July 09, 2008 - 14:07:
Author: bugman
Date: Wed Jul  9 13:53:23 2008
New Revision: 6877

URL: http://svn.gna.org/viewcvs/relax?rev=6877&view=rev
Log:
Fixes for the __update_model() to prevent the model data being overwritten or 
too many params added.


Modified:
    branches/rdc_analysis/specific_fns/n_state_model.py

Modified: branches/rdc_analysis/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/specific_fns/n_state_model.py?rev=6877&r1=6876&r2=6877&view=diff
==============================================================================
--- branches/rdc_analysis/specific_fns/n_state_model.py (original)
+++ branches/rdc_analysis/specific_fns/n_state_model.py Wed Jul  9 13:53:23 
2008
@@ -65,21 +65,27 @@
             else:
                 return
 
-        # Add the probability or population weight parameters.
-        for i in xrange(cdp.N-1):
-            cdp.params.append('p' + `i`)
-
-        # Add the Euler angle parameters.
-        for i in xrange(cdp.N):
-            cdp.params.append('alpha' + `i`)
-            cdp.params.append('beta' + `i`)
-            cdp.params.append('gamma' + `i`)
+        # Set up the parameter array.
+        if not cdp.params:
+            # Add the probability or population weight parameters.
+            for i in xrange(cdp.N-1):
+                cdp.params.append('p' + `i`)
+
+            # Add the Euler angle parameters.
+            for i in xrange(cdp.N):
+                cdp.params.append('alpha' + `i`)
+                cdp.params.append('beta' + `i`)
+                cdp.params.append('gamma' + `i`)
 
         # Initialise the probability and Euler angle arrays.
-        cdp.probs = [None] * cdp.N
-        cdp.alpha = [None] * cdp.N
-        cdp.beta = [None] * cdp.N
-        cdp.gamma = [None] * cdp.N
+        if not hasattr(cdp, 'probs'):
+            cdp.probs = [None] * cdp.N
+        if not hasattr(cdp, 'alpha'):
+            cdp.alpha = [None] * cdp.N
+        if not hasattr(cdp, 'beta'):
+            cdp.beta = [None] * cdp.N
+        if not hasattr(cdp, 'gamma'):
+            cdp.gamma = [None] * cdp.N
 
 
     def assemble_param_vector(self, sim_index=None):




Related Messages


Powered by MHonArc, Updated Wed Jul 09 14:40:17 2008