mailr19580 - in /branches/relax_disp: specific_analyses/ test_suite/unit_tests/_prompt/ user_functions/


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

Header


Content

Posted by edward on April 22, 2013 - 10:56:
Author: bugman
Date: Mon Apr 22 10:56:21 2013
New Revision: 19580

URL: http://svn.gna.org/viewcvs/relax?rev=19580&view=rev
Log:
Elimination of the relax_disp.calc_r2eff user function.

This user function, which is non-functional anyway, is not needed.  The 
calculation of the R2eff
values will occur with the optimisation of the 'R2eff' model (with a call to 
the calc user function
for the fixed time period experiment types) so direct calculation through a 
specific user function
is not needed.


Modified:
    branches/relax_disp/specific_analyses/relax_disp.py
    branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py
    branches/relax_disp/user_functions/relax_disp.py

Modified: branches/relax_disp/specific_analyses/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp.py?rev=19580&r1=19579&r2=19580&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp.py Mon Apr 22 10:56:21 
2013
@@ -495,39 +495,6 @@
 
         # Printout.
         print("Setting the '%s' spectrum CPMG frequency %s Hz." % 
(spectrum_id, cdp.cpmg_frqs[spectrum_id]))
-
-
-    def _calc_r2eff(self, exp_type='cpmg', id=None, delayT=None, 
int_cpmg=1.0, int_ref=1.0):
-        """Calculate the effective transversal relaxation rate from the peak 
intensities.
-        
-        The equation depends on the experiment type chosen, either 'cpmg' or 
'r1rho'.
-
-        @keyword exp_type:   The experiment type, either 'cpmg' or 'r1rho'.
-        @type exp_type:      str
-        @keyword id:         The experimental identification string 
(allowing for multiple experiments per data pipe).
-        @type id:            str
-        @keyword delayT:     The CPMG constant time delay (T) in s.
-        @type delayT:        float
-        @keyword int_cpmg:   The intensity of the peak in the CPMG spectrum.
-        @type int_cpmg:      float
-        @keyword int_ref:    The intensity of the peak in the reference 
spectrum.
-        @type int_ref:       float
-        """
-
-        # Avoid division by zero.
-        if int_ref == 0:
-            raise RelaxError("The reference peak intensity should not have a 
value of 0 (zero).")
-
-        # Avoid other inmpossible mathematical situation.
-        if int_cpmg == 0:
-            raise RelaxError("The CPMG peak intensity should not have a 
value of 0 (zero).")
-
-        if delayT == 0:
-            raise RelaxError("The CPMG constant time delay (T) should not 
have a value of 0 (zero).")
-
-        if exp_type == 'cpmg' and delayT != None:
-            r2eff = - ( 1 / delayT ) * log ( int_cpmg / int_ref )
-            return r2eff
 
 
     def _disassemble_param_vector(self, param_vector=None, key=None, 
spins=None, sim_index=None):

Modified: branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py?rev=19580&r1=19579&r2=19580&view=diff
==============================================================================
--- branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py 
(original)
+++ branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py Mon 
Apr 22 10:56:21 2013
@@ -47,71 +47,6 @@
 
         # Alias the user function class.
         self.relax_disp_fns = self.interpreter.relax_disp
-
-
-    def test_calc_r2eff_argfail_exp_type(self):
-        """The exp_type arg test of the relax_disp.calc_r2eff() user 
function."""
-
-        # Loop over the data types.
-        for data in DATA_TYPES:
-            # Catch the str arguments, and skip them.
-            if data[0] == 'str':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxStrError, self.relax_disp_fns.calc_r2eff, 
exp_type=data[1])
-
-
-    def test_calc_r2eff_argfail_id(self):
-        """The id arg test of the relax_disp.calc_r2eff() user function."""
-
-        # Loop over the data types.
-        for data in DATA_TYPES:
-            # Catch the str arguments, and skip them.
-            if data[0] == 'str':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxStrError, self.relax_disp_fns.calc_r2eff, 
id=data[1])
-
-
-    def test_calc_r2eff_argfail_delayT(self):
-        """The delayT arg test of the relax_disp.calc_r2eff() user 
function."""
-
-        # Loop over the data types.
-        for data in DATA_TYPES:
-            # Catch the float, int and bin arguments, and skip them.
-            if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, 
id='test', delayT=data[1])
-
-
-    def test_calc_r2eff_argfail_int_cpmg(self):
-        """The int_cpmg arg test of the relax_disp.calc_r2eff() user 
function."""
-
-        # Loop over the data types.
-        for data in DATA_TYPES:
-            # Catch the float, int and bin arguments, and skip them.
-            if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, 
id='test', int_cpmg=data[1])
-
-
-    def test_calc_r2eff_argfail_int_ref(self):
-        """The int_ref arg test of the relax_disp.calc_r2eff() user 
function."""
-
-        # Loop over the data types.
-        for data in DATA_TYPES:
-            # Catch the float, int and None arguments, and skip them.
-            if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin':
-                continue
-
-            # The argument test.
-            self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, 
id='test', int_cpmg=10, int_ref=data[1])
 
 
     def test_relax_cpmg_frq_argfail_cpmg_frq(self):

Modified: branches/relax_disp/user_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/user_functions/relax_disp.py?rev=19580&r1=19579&r2=19580&view=diff
==============================================================================
--- branches/relax_disp/user_functions/relax_disp.py (original)
+++ branches/relax_disp/user_functions/relax_disp.py Mon Apr 22 10:56:21 2013
@@ -50,72 +50,6 @@
 uf_class.title = "Class for relaxation curve fitting."
 uf_class.menu_text = "&relax_disp"
 uf_class.gui_icon = "relax.relax_disp"
-
-
-# The relax_disp.calc_r2eff user function.
-uf = uf_info.add_uf('relax_disp.calc_r2eff')
-uf.title = "Calculate the effective transversal relaxation rate from the 
peak intensities."
-uf.title_short = "R2eff calculation."
-uf.add_keyarg(
-    name = "exp_type",
-    default = "CPMG",
-    py_type = "str",
-    desc_short = "experiment type",
-    desc = "The relaxation dispersion experiment type, either 'cpmg' or 
'r1rho'.",
-    wiz_element_type = "combo",
-    wiz_combo_choices = [
-        "CPMG",
-        "R1rho"
-    ],
-    wiz_combo_data = [
-        "cpmg",
-        "r1rho"
-    ],
-    wiz_read_only = True
-)
-uf.add_keyarg(
-    name = "id",
-    py_type = "str",
-    desc_short = "experiment ID",
-    desc = "The experiment identification string."
-)
-uf.add_keyarg(
-    name = "delayT",
-    py_type = "num",
-    desc_short = "CPMG time delay",
-    desc = "The CPMG constant time delay (T) in s."
-)
-uf.add_keyarg(
-    name = "int_cpmg",
-    default = "1.0",
-    py_type = "num",
-    desc_short = "CPMG peak intensity",
-    desc = "Intensity of the peak in the CPMG spectrum.."
-)
-uf.add_keyarg(
-    name = "int_ref",
-    default = "1.0",
-    py_type = "num",
-    desc_short = "reference peak intensity",
-    desc = "Intensity of the peak in the reference spectrum.."
-)
-# Description.
-uf.desc.append(Desc_container())
-uf.desc[-1].add_paragraph("This allows one to extract 'r2eff' values from 
peak intensities.")
-uf.desc[-1].add_paragraph("If 'cpmg' is chosen, the equation used is:")
-uf.desc[-1].add_verbatim("""
-    r2eff = - ( 1 / delayT ) * log ( int_cpmg / int_ref )
-""")
-uf.desc[-1].add_paragraph("If 'r1rho' is chosen, nothing happens yet, as the 
code is not implemented.")
-# Prompt examples.
-uf.desc.append(Desc_container("Prompt examples"))
-uf.desc[-1].add_paragraph("To calculate r2eff from a CPMG experiment, for 
experiment named '600', a constant time delay T of 20 ms (0.020 s) and 
intensities of CPMG and reference peak of, respectively, 0.742 and 0.9641, 
type one of:")
-uf.desc[-1].add_prompt("relax> relax_disp.calc_r2eff('cpmg', '600', 0.020, 
0.742, 0.9641)")
-uf.desc[-1].add_prompt("relax> relax_disp.calc_r2eff(exp_type='cpmg', 
id='600', delayT=0.020, int_cpmg=0.742, int_ref=0.9641)")
-uf.desc[-1].add_paragraph("ANOTHER EXAMPLE FOR BATCH USE (FROM PEAK 
INTENSITY LISTS) WILL SOON BE ADDED.")
-uf.backend = relax_disp_obj._calc_r2eff
-uf.menu_text = "&calc_r2eff"
-uf.wizard_size = (900, 600)
 
 
 # The relax_disp.cluster user function.




Related Messages


Powered by MHonArc, Updated Mon Apr 22 14:20:02 2013