Package specific_analyses :: Module api_objects :: Class Param_list
[hide private]
[frames] | no frames]

Class Param_list

source code

A special object for handling global and spin parameters.

Instance Methods [hide private]
 
__init__(self, spin_data=True)
Set up the class.
source code
 
add(self, name, scope=None, string=None, default=None, units=None, desc=None, py_type=None, set='generic', conv_factor=None, grace_string=None, err=False, sim=False)
Add a parameter to the list.
source code
 
add_min_data(self, min_stats_global=False, min_stats_spin=False)
Add minimisation specific objects.
source code
str
base_loop(self, set=None, scope=None)
An iterator method for looping over all the base parameters.
source code
 
check_param(self, name)
Check if the parameter exists.
source code
bool
contains(self, name)
Determine if the given name is within the parameter list.
source code
float
get_conv_factor(self, name)
Return the conversion factor.
source code
None or str
get_default(self, name)
Return the default value of the parameter.
source code
None or str
get_desc(self, name)
Return the description of the parameter.
source code
bool
get_err(self, name)
Return the error flag for the parameter.
source code
str
get_grace_string(self, name)
Return the Grace string for the parameter.
source code
str
get_set(self, name)
Return the parameter set that the parameter belongs to.
source code
bool
get_sim(self, name)
Return the Monte Carlo simulation flag for the parameter.
source code
Python type object
get_type(self, name)
Return the Python type for the parameter.
source code
str
get_units(self, name)
Return the units string for the parameter.
source code
str
loop(self, set=None, scope=None, error_names=False, sim_names=False)
An iterator method for looping over all the parameters.
source code
Method Details [hide private]

__init__(self, spin_data=True)
(Constructor)

source code 

Set up the class.

Parameters:
  • spin_data (bool) - A flag which if True indicates that the specific analysis operates with spins.

add(self, name, scope=None, string=None, default=None, units=None, desc=None, py_type=None, set='generic', conv_factor=None, grace_string=None, err=False, sim=False)

source code 

Add a parameter to the list.

Parameters:
  • name (str) - The name of the parameter. This will be used as the variable name.
  • scope (str) - The parameter scope. This can be set to 'global' for parameters located within the global scope of the current data pipe. Or set to 'spin' for spin specific parameters. Alternatively the value 'both' indicates that there are both global and specific versions of this parameter.
  • string (None or str) - The string representation of the parameter.
  • default (anything) - The default value of the parameter.
  • units (None or str) - A string representing the parameters units.
  • desc (None or str) - The text description of the parameter.
  • py_type (Python type object) - The Python type that this parameter should be.
  • set (str) - The set of object names. This can be set to 'all' for all names, to 'generic' for generic object names, 'params' for analysis specific parameter names, or to 'min' for minimisation specific object names.
  • conv_factor (None, float or func) - The factor of conversion between different parameter units.
  • grace_string (None or str) - The string used for the axes in Grace plots of the data.
  • err (bool) - A flag which if True indicates that the parameter name + '_err' error data structure can exist.
  • sim (bool) - A flag which if True indicates that the parameter name + '_sim' Monte Carlo simulation data structure can exist.

add_min_data(self, min_stats_global=False, min_stats_spin=False)

source code 

Add minimisation specific objects.

Parameters:
  • min_stats_global (bool) - A flag which if True will include the parameters 'chi2', 'iter', 'f_count', 'g_count', 'h_count', 'warning' in the list of global parameters.
  • min_stats_spin (bool) - A flag which if True will include the parameters 'chi2', 'iter', 'f_count', 'g_count', 'h_count', 'warning' in the list of spin parameters.

base_loop(self, set=None, scope=None)

source code 

An iterator method for looping over all the base parameters.

Parameters:
  • set (str) - The set of object names to return. This can be set to 'all' for all names, to 'generic' for generic object names, 'params' for analysis specific parameter names, or to 'min' for minimisation specific object names.
  • scope (str or None) - The scope of the parameter to return. If not set, then all will be returned. If set to 'global' or 'spin', then only the parameters within that scope will be returned.
Returns: str
The parameter names.

check_param(self, name)

source code 

Check if the parameter exists.

Parameters:
  • name (str) - The name of the parameter to search for.
Raises:

contains(self, name)

source code 

Determine if the given name is within the parameter list.

Parameters:
  • name (str) - The name of the parameter to search for.
Returns: bool
True if the parameter is within the list, False otherwise.

get_conv_factor(self, name)

source code 

Return the conversion factor.

Parameters:
  • name (str) - The name of the parameter.
Returns: float
The conversion factor.

get_default(self, name)

source code 

Return the default value of the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: None or str
The default value.

get_desc(self, name)

source code 

Return the description of the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: None or str
The description.

get_err(self, name)

source code 

Return the error flag for the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: bool
The error flag for the parameter.

get_grace_string(self, name)

source code 

Return the Grace string for the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: str
The Grace string.

get_set(self, name)

source code 

Return the parameter set that the parameter belongs to.

Parameters:
  • name (str) - The name of the parameter.
Returns: str
The parameter set.

get_sim(self, name)

source code 

Return the Monte Carlo simulation flag for the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: bool
The Monte Carlo simulation flag for the parameter.

get_type(self, name)

source code 

Return the Python type for the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: Python type object
The Python type.

get_units(self, name)

source code 

Return the units string for the parameter.

Parameters:
  • name (str) - The name of the parameter.
Returns: str
The units string.

loop(self, set=None, scope=None, error_names=False, sim_names=False)

source code 

An iterator method for looping over all the parameters.

Parameters:
  • set (str) - The set of object names to return. This can be set to 'all' for all names, to 'generic' for generic object names, 'params' for analysis specific parameter names, or to 'min' for minimisation specific object names.
  • scope (str or None) - The scope of the parameter to return. If not set, then all will be returned. If set to 'global' or 'spin', then only the parameters within that scope will be returned.
  • error_names (bool) - A flag which if True will add the error object names as well.
  • sim_names (bool) - A flag which if True will add the Monte Carlo simulation object names as well.
Returns: str
The parameter names.