Author: bugman Date: Wed Mar 2 11:17:34 2011 New Revision: 12698 URL: http://svn.gna.org/viewcvs/relax?rev=12698&view=rev Log: Updated temp_control_setup() 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=12698&r1=12697&r2=12698&view=diff ============================================================================== --- branches/relax_data/data/exp_info.py (original) +++ branches/relax_data/data/exp_info.py Wed Mar 2 11:17:34 2011 @@ -352,46 +352,22 @@ self.temp_calibration[ri_id] = temp_calibration - def temp_control_setup(self, ri_label, frq_label, method): + def temp_control_setup(self, ri_id, method): """Store the temperature control method. - @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_id: str @param method: The temperature control method. @type method: str """ # Initialise the container if needed. if not hasattr(self, "temp_control"): - # The list. - self.temp_control = RelaxListType() - - # The name of the container. - self.temp_control.container_name = "temp_control_list" - - # The description of the container. - self.temp_control.container_desc = "List of temperature control methods." + self.temp_control = {} # Find if the method has already been set. - for i in range(len(self.temp_control)): - if self.temp_control[i].ri_label == ri_label and self.temp_control[i].frq_label == frq_label: - raise RelaxError("The temperature control method for the '%s' ri_label and '%s' frq_label has already been set.") - - # Init the container. - temp_control = Element() - - # The name of the container. - temp_control.name = "temp_control" - - # The description of the container. - temp_control.desc = "Temperature control methods for the relaxation data." - - # Set the attributes. - temp_control.ri_label = ri_label - temp_control.frq_label = frq_label - temp_control.method = method - - # Append the container. - self.temp_control.append(temp_control) + if ri_id in self.temp_control.keys(): + raise RelaxError("The temperature control method for the '%s' relaxation data ID string has already been set.") + + # Set the method. + self.temp_control[ri_id] = method