mailr23595 - in /trunk: ./ lib/dispersion/ test_suite/unit_tests/_lib/_dispersion/


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

Header


Content

Posted by edward on May 29, 2014 - 14:09:
Author: bugman
Date: Thu May 29 14:09:47 2014
New Revision: 23595

URL: http://svn.gna.org/viewcvs/relax?rev=23595&view=rev
Log:
Merged revisions 23333-23334,23338,23342 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/disp_speed

........
  r23333 | tlinnet | 2014-05-22 15:19:30 +0200 (Thu, 22 May 2014) | 7 lines
  
  Align math-domain catching for model NS CPMG 2-site expanded with trunk 
implementation.
  
  task #7793: (https://gna.org/task/?7793) Speed-up of dispersion models.
  
  This is to implement catching of math domain errors, before they occur.
  
  The catching of errors have to be more careful.
........
  r23334 | tlinnet | 2014-05-22 15:19:32 +0200 (Thu, 22 May 2014) | 18 lines
  
  Modified unit tests demonstrating edge case 'no Rex' failures of the model 
'NS CPMG 2-site expanded'.
  
  This is to align with the current return of data in the disp_speed branch.
  
  This follows from the ideas in the post 
http://article.gmane.org/gmane.science.nmr.relax.devel/5858.
  This is related to: task #7793: (https://gna.org/task/?7793) Speed-up of 
dispersion models.
  
  This is to implement catching of math domain errors, before they occur.
  
  These tests cover all parameter value combinations which result in no 
exchange:
  
      - dw = 0.0,
      - pA = 1.0,
      - kex = 0.0,
      - dw = 0.0 and pA = 1.0,
      - dw = 0.0 and kex = 0.0,
      - pA = 1.0 and kex = 0.0,
      - dw = 0.0, pA = 1.0, and kex = 0.0.
........
  r23338 | tlinnet | 2014-05-22 16:56:32 +0200 (Thu, 22 May 2014) | 16 lines
  
  Added 7 unit tests demonstrating edge case 'no Rex' failures of the model 
'DPL94'.
  
  This follows from the ideas in the post 
http://article.gmane.org/gmane.science.nmr.relax.devel/5858.
  This is related to: task #7793: (https://gna.org/task/?7793) Speed-up of 
dispersion models.
  
  This is to implement catching of math domain errors, before they occur.
  
  These tests cover all parameter value combinations which result in no 
exchange:
  
      - dw = 0.0,
      - pA = 1.0,
      - kex = 0.0,
      - dw = 0.0 and pA = 1.0,
      - dw = 0.0 and kex = 0.0,
      - pA = 1.0 and kex = 0.0,
      - dw = 0.0, pA = 1.0, and kex = 0.0.
........
  r23342 | tlinnet | 2014-05-22 17:46:50 +0200 (Thu, 22 May 2014) | 5 lines
  
  Unit test _lib/test_ns_cpmg_2site_expanded.py copied to _/test_lm63.py.
  
  They are both of CPMG type.
........

Added:
    trunk/test_suite/unit_tests/_lib/_dispersion/test_dpl94.py
      - copied unchanged from r23342, 
branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_dpl94.py
    trunk/test_suite/unit_tests/_lib/_dispersion/test_lm63.py
      - copied unchanged from r23342, 
branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_lm63.py
Modified:
    trunk/   (props changed)
    trunk/lib/dispersion/ns_cpmg_2site_expanded.py
    trunk/test_suite/unit_tests/_lib/_dispersion/__init__.py
    
trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py

Propchange: trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 29 14:09:47 2014
@@ -1 +1 @@
-/branches/disp_speed:1-23214,23216-23229,23239-23240,23246-23304
+/branches/disp_speed:1-23214,23216-23229,23239-23240,23246-23304,23333-23342

Modified: trunk/lib/dispersion/ns_cpmg_2site_expanded.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/dispersion/ns_cpmg_2site_expanded.py?rev=23595&r1=23594&r2=23595&view=diff
==============================================================================
--- trunk/lib/dispersion/ns_cpmg_2site_expanded.py      (original)
+++ trunk/lib/dispersion/ns_cpmg_2site_expanded.py      Thu May 29 14:09:47 
2014
@@ -271,9 +271,7 @@
 
     # Catch parameter values that will result in no exchange, returning flat 
R2eff = R20 lines (when kex = 0.0, k_AB = 0.0).
     if dw == 0.0 or pA == 1.0 or k_AB == 0.0:
-        for i in range(num_points):
-            back_calc[i] = r20
-        return
+        return array([r20]*num_points)
 
     # Repeditive calculations.
     half_tcp = 0.5 * tcp
@@ -345,29 +343,7 @@
     t116 = power(0.5*(t97_t99 + t112), t115)
     t118 = 1.0/t112
     t120 = t97_nt99 + t112
-
-    # Catch math domain error of coming power(half_t97_t99_m_t112, NR).
-    # This is when power function calculate above 1.e300 or under -1.e300 or 
represented as less than 1.-e300.
-    half_t97_t99_m_t112 = 0.5*(t97_t99 - t112)
-
-    # First find the index with the highest power.
-    index_max_t115 = argmax(t115)
-
-    # Store the power.
-    max_t115 = t115[index_max_t115]
-
-    # Match the value from half_t97_t99_m_t112.
-    val_half_t97_t99_m_t112 = half_t97_t99_m_t112[index_max_t115]
-
-    # Calculate lowest positive val, which raised to the power will not be 
represented less than 1.-e300.
-    low_pos_rep = power(1.e-300, 1./max_t115)
-
-    # Now test if value in array at the power position is less than this 
value.
-    if val_half_t97_t99_m_t112 < low_pos_rep:
-        R2eff = array([1e100]*num_points)
-        return R2eff
-
-    t122 = power(half_t97_t99_m_t112, t115)
+    t122 = power(0.5*(t97_t99 - t112), t115)
     t127 = 0.5/t108
     t120_t122 = t120*t122
     t139 = 0.5/(k_AB + k_BA) * ((t120_t122 - t113*t116)*t118*k_BA + 
(t120_t122 - t116*t120)*t127*t113*t118*k_AB)

Modified: trunk/test_suite/unit_tests/_lib/_dispersion/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/_dispersion/__init__.py?rev=23595&r1=23594&r2=23595&view=diff
==============================================================================
--- trunk/test_suite/unit_tests/_lib/_dispersion/__init__.py    (original)
+++ trunk/test_suite/unit_tests/_lib/_dispersion/__init__.py    Thu May 29 
14:09:47 2014
@@ -22,5 +22,6 @@
 
 __all__ = [
     'test___init__',
+    'test_ns_dpl94',
     'test_ns_cpmg_2site_expanded'
 ]

Modified: 
trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py?rev=23595&r1=23594&r2=23595&view=diff
==============================================================================
--- 
trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py 
(original)
+++ 
trunk/test_suite/unit_tests/_lib/_dispersion/test_ns_cpmg_2site_expanded.py 
Thu May 29 14:09:47 2014
@@ -53,11 +53,11 @@
         k_AB, k_BA = self.param_conversion(pA=self.pA, kex=self.kex)
 
         # Calculate the R2eff values.
-        r2eff_ns_cpmg_2site_expanded(r20=self.r20, pA=self.pA, dw=self.dw, 
k_AB=k_AB, k_BA=k_BA, relax_time=0.3, inv_relax_time=1/0.3, tcp=self.tcp, 
back_calc=self.R2eff, num_points=self.num_points, num_cpmg=self.num_cpmg)
+        R2eff = r2eff_ns_cpmg_2site_expanded(r20=self.r20, pA=self.pA, 
dw=self.dw, k_AB=k_AB, k_BA=k_BA, relax_time=0.3, inv_relax_time=1/0.3, 
tcp=self.tcp, num_points=self.num_points, num_cpmg=self.num_cpmg)
 
         # Check all R2eff values.
         for i in range(self.num_points):
-            self.assertAlmostEqual(self.R2eff[i], 2.0, 5)
+            self.assertAlmostEqual(R2eff[i], self.r20)
 
 
     def param_conversion(self, pA=None, kex=None):




Related Messages


Powered by MHonArc, Updated Thu May 29 14:20:03 2014