mailr12664 - in /branches/relax_data: generic_fns/relax_data.py prompt/relax_data.py


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

Header


Content

Posted by edward on March 01, 2011 - 18:23:
Author: bugman
Date: Tue Mar  1 18:23:02 2011
New Revision: 12664

URL: http://svn.gna.org/viewcvs/relax?rev=12664&view=rev
Log:
Converted the relax_data.peak_intensity_type() user function back and front 
end to the new design.


Modified:
    branches/relax_data/generic_fns/relax_data.py
    branches/relax_data/prompt/relax_data.py

Modified: branches/relax_data/generic_fns/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/relax_data.py?rev=12664&r1=12663&r2=12664&view=diff
==============================================================================
--- branches/relax_data/generic_fns/relax_data.py (original)
+++ branches/relax_data/generic_fns/relax_data.py Tue Mar  1 18:23:02 2011
@@ -646,15 +646,13 @@
         spin.ri_data_err[ri_id] = errors[i]
 
 
-def peak_intensity_type(ri_label=None, frq_label=None, type=None):
+def peak_intensity_type(ri_id=None, type=None):
     """Set the type of intensity measured for the peaks.
 
-    @param ri_label:    The relaxation data type, ie 'R1', 'R2', or 'NOE'.
-    @type ri_label:     str
-    @param frq_label:   The field strength label.
-    @type frq_label:    str
-    @param type:        The peak intensity type, one of 'height' or 'volume'.
-    @type type:         str
+    @keyword ri_id: The relaxation data ID string.
+    @type ri_id:    str
+    @keyword type:  The peak intensity type, one of 'height' or 'volume'.
+    @type type:     str
     """
 
     # Test if the current pipe exists.
@@ -664,9 +662,9 @@
     if not exists_mol_res_spin_data():
         raise RelaxNoSequenceError
 
-    # Test if relaxation data corresponding to 'ri_label' and 'frq_label' 
already exists.
-    if not test_labels(ri_label, frq_label):
-        raise RelaxNoRiError(ri_label, frq_label)
+    # Test if data exists.
+    if not hasattr(cdp, 'ri_ids') or ri_id not in cdp.ri_ids:
+        raise RelaxNoRiError(ri_id)
 
     # Check the values, and warn if not in the list.
     valid = ['height', 'volume']
@@ -678,7 +676,7 @@
         cdp.exp_info = ExpInfo()
 
     # Store the type.
-    cdp.exp_info.setup_peak_intensity_type(ri_label, frq_label, type)
+    cdp.exp_info.setup_peak_intensity_type(ri_id, type)
 
 
 def read(ri_id=None, ri_type=None, frq=None, file=None, dir=None, 
file_data=None, spin_id_col=None, mol_name_col=None, res_num_col=None, 
res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, 
error_col=None, sep=None, spin_id=None):

Modified: branches/relax_data/prompt/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/prompt/relax_data.py?rev=12664&r1=12663&r2=12664&view=diff
==============================================================================
--- branches/relax_data/prompt/relax_data.py (original)
+++ branches/relax_data/prompt/relax_data.py Tue Mar  1 18:23:02 2011
@@ -184,15 +184,13 @@
         relax_data.display(ri_id=ri_id)
 
 
-    def peak_intensity_type(self, ri_label=None, frq_label=None, type=None):
+    def peak_intensity_type(self, ri_id=None, type=None):
         """Specify the type of peak intensity measurement used - i.e. height 
or volume.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
 
-        ri_label:  The relaxation data type, ie 'R1', 'R2', or 'NOE'.
-
-        frq_label:  The field strength label.
+        ri_id:  The relaxation data ID string.
 
         type:  The peak intensity type.
 
@@ -208,18 +206,16 @@
         # Function intro text.
         if self._exec_info.intro:
             text = self._exec_info.ps3 + "relax_data.peak_intensity_type("
-            text = text + "ri_label=" + repr(ri_label)
-            text = text + ", frq_label=" + repr(frq_label)
+            text = text + "ri_id=" + repr(ri_id)
             text = text + ", type=" + repr(type) + ")"
             print(text)
 
         # The argument checks.
-        arg_check.is_str(ri_label, 'relaxation label')
-        arg_check.is_str(frq_label, 'frequency label')
+        arg_check.is_str(ri_id, 'relaxation label')
         arg_check.is_str(type, 'peak intensity type')
 
         # Execute the functional code.
-        relax_data.peak_intensity_type(ri_label=ri_label, 
frq_label=frq_label, type=type)
+        relax_data.peak_intensity_type(ri_id=ri_id, type=type)
 
 
     def read(self, ri_id=None, ri_type=None, frq=None, file=None, dir=None, 
spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, 
spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, 
sep=None, spin_id=None):




Related Messages


Powered by MHonArc, Updated Tue Mar 01 18:40:01 2011