mailr22611 - in /trunk/specific_analyses: consistency_tests/api.py jw_mapping/api.py model_free/api.py


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

Header


Content

Posted by edward on March 29, 2014 - 00:15:
Author: bugman
Date: Sat Mar 29 00:15:18 2014
New Revision: 22611

URL: http://svn.gna.org/viewcvs/relax?rev=22611&view=rev
Log:
Fix for the new singleton design of the specific analysis API objects.

The use of the class namespace as a storage space has been eliminated.  This 
was causing test suite
failures when checking the API objects.  For some reason, some of the target 
function objects were
being placed in 'self'.


Modified:
    trunk/specific_analyses/consistency_tests/api.py
    trunk/specific_analyses/jw_mapping/api.py
    trunk/specific_analyses/model_free/api.py

Modified: trunk/specific_analyses/consistency_tests/api.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/consistency_tests/api.py?rev=22611&r1=22610&r2=22611&view=diff
==============================================================================
--- trunk/specific_analyses/consistency_tests/api.py    (original)
+++ trunk/specific_analyses/consistency_tests/api.py    Sat Mar 29 00:15:18 
2014
@@ -201,10 +201,10 @@
                 r = interatoms[i].r
 
             # Initialise the function to calculate.
-            self.ct = Consistency(frq=cdp.ct_frq, gx=gx, gh=gh, mu0=mu0, 
h_bar=h_bar)
+            ct = Consistency(frq=cdp.ct_frq, gx=gx, gh=gh, mu0=mu0, 
h_bar=h_bar)
 
             # Calculate the consistency tests values.
-            j0, f_eta, f_r2 = self.ct.func(orientation=spin.orientation, 
tc=spin.tc, r=r, csa=spin.csa, r1=r1, r2=r2, noe=noe)
+            j0, f_eta, f_r2 = ct.func(orientation=spin.orientation, 
tc=spin.tc, r=r, csa=spin.csa, r1=r1, r2=r2, noe=noe)
 
             # Consistency tests values.
             if sim_index == None:

Modified: trunk/specific_analyses/jw_mapping/api.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/jw_mapping/api.py?rev=22611&r1=22610&r2=22611&view=diff
==============================================================================
--- trunk/specific_analyses/jw_mapping/api.py   (original)
+++ trunk/specific_analyses/jw_mapping/api.py   Sat Mar 29 00:15:18 2014
@@ -190,10 +190,10 @@
                 r = interatoms[i].r
 
             # Initialise the function to calculate.
-            self.jw = Mapping(frq=cdp.jw_frq, gx=gx, gh=gh, mu0=mu0, 
h_bar=h_bar)
+            jw = Mapping(frq=cdp.jw_frq, gx=gx, gh=gh, mu0=mu0, h_bar=h_bar)
 
             # Calculate the spectral density values.
-            j0, jwx, jwh = self.jw.func(r=r, csa=spin.csa, r1=r1, r2=r2, 
noe=noe)
+            j0, jwx, jwh = jw.func(r=r, csa=spin.csa, r1=r1, r2=r2, noe=noe)
 
             # Reduced spectral density values.
             if sim_index == None:

Modified: trunk/specific_analyses/model_free/api.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/model_free/api.py?rev=22611&r1=22610&r2=22611&view=diff
==============================================================================
--- trunk/specific_analyses/model_free/api.py   (original)
+++ trunk/specific_analyses/model_free/api.py   Sat Mar 29 00:15:18 2014
@@ -1449,7 +1449,7 @@
 
             # Initialise the function to minimise (for back-calculation and 
LM minimisation).
             if min_algor == 'back_calc' or match('[Ll][Mm]$', algor) or 
match('[Ll]evenburg-[Mm]arquardt$', algor):
-                self.mf = Mf(init_params=opt_params.param_vector, 
model_type=data_store.model_type, diff_type=data_store.diff_type, 
diff_params=data_store.diff_params, scaling_matrix=data_store.scaling_matrix, 
num_spins=data_store.num_spins, equations=data_store.equations, 
param_types=data_store.param_types, param_values=data_store.param_values, 
relax_data=data_store.ri_data, errors=data_store.ri_data_err, 
bond_length=data_store.r, csa=data_store.csa, num_frq=data_store.num_frq, 
frq=data_store.frq, num_ri=data_store.num_ri, 
remap_table=data_store.remap_table, noe_r1_table=data_store.noe_r1_table, 
ri_labels=data_store.ri_types, gx=data_store.gx, gh=data_store.gh, 
h_bar=data_store.h_bar, mu0=data_store.mu0, num_params=data_store.num_params, 
vectors=data_store.xh_unit_vectors)
+                mf = Mf(init_params=opt_params.param_vector, 
model_type=data_store.model_type, diff_type=data_store.diff_type, 
diff_params=data_store.diff_params, scaling_matrix=data_store.scaling_matrix, 
num_spins=data_store.num_spins, equations=data_store.equations, 
param_types=data_store.param_types, param_values=data_store.param_values, 
relax_data=data_store.ri_data, errors=data_store.ri_data_err, 
bond_length=data_store.r, csa=data_store.csa, num_frq=data_store.num_frq, 
frq=data_store.frq, num_ri=data_store.num_ri, 
remap_table=data_store.remap_table, noe_r1_table=data_store.noe_r1_table, 
ri_labels=data_store.ri_types, gx=data_store.gx, gh=data_store.gh, 
h_bar=data_store.h_bar, mu0=data_store.mu0, num_params=data_store.num_params, 
vectors=data_store.xh_unit_vectors)
 
             # Levenberg-Marquardt minimisation.
             if match('[Ll][Mm]$', algor) or 
match('[Ll]evenburg-[Mm]arquardt$', algor):
@@ -1465,11 +1465,11 @@
                     lm_error[index:index+len(ri_data_err[k])] = 
ri_data_err[k]
                     index = index + len(ri_data_err[k])
 
-                opt_params.min_options = opt_params.min_options + 
(self.mf.lm_dri, lm_error)
+                opt_params.min_options = opt_params.min_options + 
(mf.lm_dri, lm_error)
 
             # Back-calculation.
             if min_algor == 'back_calc':
-                return self.mf.calc_ri()
+                return mf.calc_ri()
 
             # Parallelised grid search for the diffusion parameter space.
             if match('^[Gg]rid', min_algor) and data_store.model_type == 
'diff':




Related Messages


Powered by MHonArc, Updated Mon Mar 31 08:40:01 2014