mailr20342 - /branches/relax_disp/auto_analyses/relax_disp.py


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

Header


Content

Posted by edward on July 17, 2013 - 09:39:
Author: bugman
Date: Wed Jul 17 09:39:06 2013
New Revision: 20342

URL: http://svn.gna.org/viewcvs/relax?rev=20342&view=rev
Log:
Improvements to the nesting() method of the relaxation dispersion 
auto-analysis.

The use of the parameters of the simpler model in a nested pair now only 
works if the simpler model
is in the model list.


Modified:
    branches/relax_disp/auto_analyses/relax_disp.py

Modified: branches/relax_disp/auto_analyses/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/auto_analyses/relax_disp.py?rev=20342&r1=20341&r2=20342&view=diff
==============================================================================
--- branches/relax_disp/auto_analyses/relax_disp.py (original)
+++ branches/relax_disp/auto_analyses/relax_disp.py Wed Jul 17 09:39:06 2013
@@ -154,39 +154,38 @@
 
         # The simpler model.
         nested_pipe = None
-        if model == MODEL_CR72:
+        if model == MODEL_CR72 and MODEL_CR72_RED in self.models:
             nested_pipe = MODEL_CR72_RED
-        if model == MODEL_NS_2SITE_STAR:
+        if model == MODEL_NS_2SITE_STAR and MODEL_NS_2SITE_STAR_RED in 
self.models:
             nested_pipe = MODEL_NS_2SITE_STAR_RED
 
-        # The more complex of nested models.
-        if nested_pipe:
-            # Printout.
-            print("Model nesting detected, copying the optimised parameters 
from the '%s' model rather than performing a grid search." % nested_pipe)
-
-            # Loop over the spins to copy the parameters.
-            for spin, spin_id in spin_loop(return_id=True):
-                # Get the nested spin.
-                nested_spin = return_spin(spin_id=spin_id, pipe=nested_pipe)
-
-                # The R20 parameters.
-                if hasattr(nested_spin, 'r2'):
-                    setattr(spin, 'r2a', deepcopy(nested_spin.r2))
-                    setattr(spin, 'r2b', deepcopy(nested_spin.r2))
-
-                # All other spin parameters.
-                for param in spin.params:
-                    if param in ['r2', 'r2a', 'r2b']:
-                        continue
-
-                    # Copy the parameter.
-                    setattr(spin, param, deepcopy(getattr(nested_spin, 
param)))
-
-            # Nesting.
-            return True
-
         # No nesting.
-        return False
+        if not nested_pipe:
+            return False
+
+        # Printout.
+        print("Model nesting detected, copying the optimised parameters from 
the '%s' model rather than performing a grid search." % nested_pipe)
+
+        # Loop over the spins to copy the parameters.
+        for spin, spin_id in spin_loop(return_id=True):
+            # Get the nested spin.
+            nested_spin = return_spin(spin_id=spin_id, pipe=nested_pipe)
+
+            # The R20 parameters.
+            if hasattr(nested_spin, 'r2'):
+                setattr(spin, 'r2a', deepcopy(nested_spin.r2))
+                setattr(spin, 'r2b', deepcopy(nested_spin.r2))
+
+            # All other spin parameters.
+            for param in spin.params:
+                if param in ['r2', 'r2a', 'r2b']:
+                    continue
+
+                # Copy the parameter.
+                setattr(spin, param, deepcopy(getattr(nested_spin, param)))
+
+        # Nesting.
+        return True
 
 
     def optimise(self, model=None):




Related Messages


Powered by MHonArc, Updated Wed Jul 17 10:00:01 2013