Author: bugman Date: Fri Apr 11 08:12:53 2014 New Revision: 22706 URL: http://svn.gna.org/viewcvs/relax?rev=22706&view=rev Log: Renamed many of the specific analysis parameter list object methods to match the API names. This is to prepare for a decoupling of the parameter list object from the API object. Modified: trunk/specific_analyses/api_base.py trunk/specific_analyses/api_common.py trunk/specific_analyses/model_free/api.py trunk/specific_analyses/parameter_object.py Modified: trunk/specific_analyses/api_base.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/api_base.py?rev=22706&r1=22705&r2=22706&view=diff ============================================================================== --- trunk/specific_analyses/api_base.py (original) +++ trunk/specific_analyses/api_base.py Fri Apr 11 08:12:53 2014 @@ -194,7 +194,7 @@ """ # Return the type. - return self._PARAMS.get_type(param) + return self._PARAMS.type(param) def default_value(self, param): @@ -210,7 +210,7 @@ """ # Return the value. - return self._PARAMS.get_default(param) + return self._PARAMS.default_value(param) def deselect(self, model_info, sim_index=None): @@ -520,7 +520,7 @@ """ # Return the factor. - return self._PARAMS.get_conv_factor(param) + return self._PARAMS.conversion_factor(param) def return_data(self, data_id=None): @@ -549,7 +549,7 @@ """ # Return the description. - return self._PARAMS.get_desc(name) + return self._PARAMS.description(name) def return_data_name(self, param): @@ -595,7 +595,7 @@ """ # The string. - return self._PARAMS.get_grace_string(param) + return self._PARAMS.grace_string(param) def return_units(self, param): @@ -608,7 +608,7 @@ """ # Return the name. - return self._PARAMS.get_units(param) + return self._PARAMS.units(param) def return_value(self, spin, param, sim=None, bc=False): Modified: trunk/specific_analyses/api_common.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/api_common.py?rev=22706&r1=22705&r2=22706&view=diff ============================================================================== --- trunk/specific_analyses/api_common.py (original) +++ trunk/specific_analyses/api_common.py Fri Apr 11 08:12:53 2014 @@ -108,7 +108,7 @@ continue # The default value. - param_type = self._PARAMS.get_type(name) + param_type = self._PARAMS.type(name) if param_type == dict: value = {} elif param_type == list: Modified: trunk/specific_analyses/model_free/api.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/model_free/api.py?rev=22706&r1=22705&r2=22706&view=diff ============================================================================== --- trunk/specific_analyses/model_free/api.py (original) +++ trunk/specific_analyses/model_free/api.py Fri Apr 11 08:12:53 2014 @@ -648,7 +648,7 @@ # Set everything else initially to None or False. init_data = None - if self._PARAMS.get_type(name) == bool: + if self._PARAMS.type(name) == bool: init_data = False if name == 'select': init_data = True @@ -673,7 +673,7 @@ return diff_val # Model-free parameter. - return self._PARAMS.get_default(param) + return self._PARAMS.default_value(param) def deselect(self, model_info, sim_index=None): Modified: trunk/specific_analyses/parameter_object.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/parameter_object.py?rev=22706&r1=22705&r2=22706&view=diff ============================================================================== --- trunk/specific_analyses/parameter_object.py (original) +++ trunk/specific_analyses/parameter_object.py Fri Apr 11 08:12:53 2014 @@ -321,6 +321,30 @@ return False + def conversion_factor(self, name): + """Return the conversion factor. + + @param name: The name of the parameter. + @type name: str + @return: The conversion factor. + @rtype: float + """ + + # Parameter check. + self.check_param(name) + + # No factor. + if self._conv_factor[name] == None: + return 1.0 + + # Function. + if isinstance(self._conv_factor[name], FunctionType) or isinstance(self._conv_factor[name], MethodType): + return self._conv_factor[name]() + + # Value. + return self._conv_factor[name] + + def data_names(self, set='all', scope=None, error_names=False, sim_names=False): """Return a list of names of data structures. @@ -347,31 +371,7 @@ return names - def get_conv_factor(self, name): - """Return the conversion factor. - - @param name: The name of the parameter. - @type name: str - @return: The conversion factor. - @rtype: float - """ - - # Parameter check. - self.check_param(name) - - # No factor. - if self._conv_factor[name] == None: - return 1.0 - - # Function. - if isinstance(self._conv_factor[name], FunctionType) or isinstance(self._conv_factor[name], MethodType): - return self._conv_factor[name]() - - # Value. - return self._conv_factor[name] - - - def get_default(self, name): + def default_value(self, name): """Return the default value of the parameter. @param name: The name of the parameter. @@ -387,7 +387,7 @@ return self._defaults[name] - def get_desc(self, name): + def description(self, name): """Return the description of the parameter. @param name: The name of the parameter. @@ -407,7 +407,7 @@ return self._desc[name] - def get_err(self, name): + def error_flag(self, name): """Return the error flag for the parameter. @param name: The name of the parameter. @@ -423,7 +423,7 @@ return self._err[name] - def get_grace_string(self, name): + def grace_string(self, name): """Return the Grace string for the parameter. @param name: The name of the parameter. @@ -437,74 +437,6 @@ # Return the value. return self._grace_string[name] - - - def get_set(self, name): - """Return the parameter set that the parameter belongs to. - - @param name: The name of the parameter. - @type name: str - @return: The parameter set. - @rtype: str - """ - - # Parameter check. - self.check_param(name) - - # Return the type. - return self._set[name] - - - def get_sim(self, name): - """Return the Monte Carlo simulation flag for the parameter. - - @param name: The name of the parameter. - @type name: str - @return: The Monte Carlo simulation flag for the parameter. - @rtype: bool - """ - - # Parameter check. - self.check_param(name) - - # Return the type. - return self._sim[name] - - - def get_type(self, name): - """Return the Python type for the parameter. - - @param name: The name of the parameter. - @type name: str - @return: The Python type. - @rtype: Python type object - """ - - # Parameter check. - self.check_param(name) - - # Return the Python type. - return self._py_types[name] - - - def get_units(self, name): - """Return the units string for the parameter. - - @param name: The name of the parameter. - @type name: str - @return: The units string. - @rtype: str - """ - - # Parameter check. - self.check_param(name) - - # Function. - if isinstance(self._conv_factor[name], FunctionType) or isinstance(self._conv_factor[name], MethodType): - return self._units[name]() - - # Return the value. - return self._units[name] def loop(self, set=None, scope=None, error_names=False, sim_names=False): @@ -529,11 +461,79 @@ # Error names. if error_names: for name in self.base_loop(set=set): - if self.get_err(name): + if self.error_flag(name): yield name + '_err' # Sim names. if sim_names: for name in self.base_loop(set=set): - if self.get_sim(name): + if self.simulation_flag(name): yield name + '_sim' + + + def set(self, name): + """Return the parameter set that the parameter belongs to. + + @param name: The name of the parameter. + @type name: str + @return: The parameter set. + @rtype: str + """ + + # Parameter check. + self.check_param(name) + + # Return the type. + return self._set[name] + + + def simulation_flag(self, name): + """Return the Monte Carlo simulation flag for the parameter. + + @param name: The name of the parameter. + @type name: str + @return: The Monte Carlo simulation flag for the parameter. + @rtype: bool + """ + + # Parameter check. + self.check_param(name) + + # Return the type. + return self._sim[name] + + + def type(self, name): + """Return the Python type for the parameter. + + @param name: The name of the parameter. + @type name: str + @return: The Python type. + @rtype: Python type object + """ + + # Parameter check. + self.check_param(name) + + # Return the Python type. + return self._py_types[name] + + + def units(self, name): + """Return the units string for the parameter. + + @param name: The name of the parameter. + @type name: str + @return: The units string. + @rtype: str + """ + + # Parameter check. + self.check_param(name) + + # Function. + if isinstance(self._conv_factor[name], FunctionType) or isinstance(self._conv_factor[name], MethodType): + return self._units[name]() + + # Return the value. + return self._units[name]