mailr12696 - /branches/relax_data/data/exp_info.py


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

Header


Content

Posted by edward on March 02, 2011 - 11:13:
Author: bugman
Date: Wed Mar  2 11:13:48 2011
New Revision: 12696

URL: http://svn.gna.org/viewcvs/relax?rev=12696&view=rev
Log:
Simplified the setup_peak_intensity_type() data.exp_info method for the new 
relax data ID string design.


Modified:
    branches/relax_data/data/exp_info.py

Modified: branches/relax_data/data/exp_info.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/data/exp_info.py?rev=12696&r1=12695&r2=12696&view=diff
==============================================================================
--- branches/relax_data/data/exp_info.py (original)
+++ branches/relax_data/data/exp_info.py Wed Mar  2 11:13:48 2011
@@ -186,13 +186,11 @@
                 return self.temp_control[i].method
 
 
-    def setup_peak_intensity_type(self, ri_label, frq_label, type):
+    def setup_peak_intensity_type(self, ri_id, type):
         """Store the peak intensity type.
 
-        @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 ri_id:       The relaxation data ID string.
+        @type ri_label:     str
         @param type:        The peak intensity type, one of 'height' or 
'volume'.
         @type type:         str
         """
@@ -200,35 +198,14 @@
         # Initialise the container if needed.
         if not hasattr(self, "peak_intensity_type"):
             # The list.
-            self.peak_intensity_type = RelaxListType()
-
-            # The name of the container.
-            self.peak_intensity_type.container_name = 
"peak_intensity_type_list"
-
-            # The description of the container.
-            self.peak_intensity_type.container_desc = "List of peak 
intensity types."
+            self.peak_intensity_type = {}
 
         # Find if the type has already been set.
-        for i in range(len(self.peak_intensity_type)):
-            if self.peak_intensity_type[i].ri_label == ri_label and 
self.peak_intensity_type[i].frq_label == frq_label:
-                raise RelaxError("The peak intensity type for the '%s' 
ri_label and '%s' frq_label has already been set.")
-
-        # Init the container.
-        peak_intensity_type = Element()
-
-        # The name of the container.
-        peak_intensity_type.name = "peak_intensity_type"
-
-        # The description of the container.
-        peak_intensity_type.desc = "Temperature control methods for the 
relaxation data."
-
-        # Set the attributes.
-        peak_intensity_type.ri_label = ri_label
-        peak_intensity_type.frq_label = frq_label
-        peak_intensity_type.type = type
-
-        # Append the container.
-        self.peak_intensity_type.append(peak_intensity_type)
+        if ri_id in self.peak_intensity_type.keys():
+            raise RelaxError("The peak intensity type for the '%s' 
relaxation data ID string has already been set.")
+
+        # Append the container.
+        self.peak_intensity_type[ri_id] = type
 
 
     def setup_thiol(self, state):




Related Messages


Powered by MHonArc, Updated Wed Mar 02 11:20:02 2011