Package specific_analyses :: Module parameter_object :: 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='all', conv_factor=None, grace_string=None, err=False, sim=False)
Add a parameter to the list.
source code
 
_add_align_data(self)
Add the PCS and RDC data.
source code
 
_add_csa(self, default=None, set='fixed', err=False, sim=False)
Add the CSA parameter 'csa'.
source code
 
_add_diffusion_params(self)
Add the Brownian rotational diffusion parameters to the list.
source code
 
_add_min_data(self, min_stats_global=False, min_stats_spin=False)
Add minimisation specific objects.
source code
 
_add_model_info(self, scope='spin', model_flag=True, equation_flag=False)
Add model specific objects 'model' and 'params'.
source code
 
_add_peak_intensity(self)
Add the peak intensity structure 'peak_intensity'.
source code
 
_set_uf_title(self, title)
Set the title for the user function documentation.
source code
Desc_container instance
_uf_doc_loop(self, tables=None)
Generator method for looping over and yielding the user function parameter documentation.
source code
Desc_container instance
_uf_param_table(self, label=None, caption=None, scope='spin', sets=['params', 'fixed'], default=False, units=False, type=False)
"Create the parameter documentation for the user function docstrings.
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
conversion_factor(self, name)
Return the conversion factor.
source code
list of str
data_names(self, set='all', scope=None, error_names=False, sim_names=False)
Return a list of names of data structures.
source code
None or str
default_value(self, name)
Return the default value of the parameter.
source code
None or str
description(self, name)
Return the description of the parameter.
source code
bool
error_flag(self, name)
Return the error flag for the parameter.
source code
str
grace_string(self, name)
Return the Grace string for the parameter.
source code
bool
is_spin_param(self, name)
Determine whether the given parameter is spin specific.
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
str
scope(self, name)
Return the parameter scope.
source code
str
set(self, name)
Return the parameter set that the parameter belongs to.
source code
bool
simulation_flag(self, name)
Return the Monte Carlo simulation flag for the parameter.
source code
Python type object
type(self, name)
Return the Python type for the parameter.
source code
Python type object
type_string(self, name)
Return the Python type for the parameter as a string representation.
source code
Desc_container instance
uf_doc(self, label=None, caption=None, scope='spin', default=False, units=False, type=False)
"Create the parameter documentation for the user function docstrings.
source code
str
units(self, name)
Return the units string for the parameter.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *args, **kargs)
Replacement function for implementing the singleton design pattern.
source code
Properties [hide private]

Inherited from object: __class__

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.
Overrides: object.__init__

__new__(cls, *args, **kargs)
Static Method

source code 

Replacement function for implementing the singleton design pattern.

Returns: a new object with type S, a subtype of T
Overrides: object.__new__

_add(self, name, scope=None, string=None, default=None, units=None, desc=None, py_type=None, set='all', 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 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, 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_csa(self, default=None, set='fixed', err=False, sim=False)

source code 

Add the CSA parameter 'csa'.

Parameters:
  • default (float) - The default CSA value.
  • set (str) - The set of object names. This can be set to 'all' for all names, to 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, or to 'min' for minimisation specific object names.
  • err (bool) - A flag which if True indicates that the 'csa_err' error data structure can exist.
  • sim (bool) - A flag which if True indicates that the 'csa_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.

The parameter scope is defined by the keyword arguments.

Parameters:
  • min_stats_global (bool) - A flag which if True will cause the parameters to be global.
  • min_stats_spin (bool) - A flag which if True will cause the parameters to be spin specific.

_add_model_info(self, scope='spin', model_flag=True, equation_flag=False)

source code 

Add model specific objects 'model' and 'params'.

Parameters:
  • 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.
  • model_flag (bool) - A flag which if True will cause the 'model' structure to be added.

_set_uf_title(self, title)

source code 

Set the title for the user function documentation.

Parameters:
  • title (str) - The title to use in the user function docstrings.

_uf_doc_loop(self, tables=None)

source code 

Generator method for looping over and yielding the user function parameter documentation.

Parameters:
  • tables (list of str or None) - The list of tables to loop over. If None, then all tables will be yielded.
Returns: Desc_container instance
The user function documentation for each table.

_uf_param_table(self, label=None, caption=None, scope='spin', sets=['params', 'fixed'], default=False, units=False, type=False)

source code 

"Create the parameter documentation for the user function docstrings.

Parameters:
  • label (str) - The label of the table. This is used to identify replicated tables, and is also used in the table referencing in the LaTeX compilation of the user manual. If this label is already used, the corresponding pre-constructed documentation object will be returned.
  • caption (str) - The caption for the table.
  • scope (str or None) - The parameter scope to restrict the table to, defaulting to 'spin'.
  • sets (list of str) - The parameter sets to restrict the table to. If not given, then all parameters of the 'params' and 'fixed' sets will be added. This can be set to 'all' for all names, to 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, or to 'min' for minimisation specific object names.
  • default (bool) - A flag which if True will cause the default parameter value to be included in the table.
  • units (bool) - A flag which if True will cause the units to be included in the table.
  • type (bool) - A flag which if True will cause the parameter type to be included in the table.
Returns: Desc_container instance
The parameter documentation.

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. This can be set to 'all' for all names, to 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, 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.

conversion_factor(self, name)

source code 

Return the conversion factor.

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

data_names(self, set='all', scope=None, error_names=False, sim_names=False)

source code 

Return a list of names of data structures.

Parameters:
  • set (str) - The set of object names. This can be set to 'all' for all names, to 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, 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: list of str
The list of object names.

default_value(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.

description(self, name)

source code 

Return the description of the parameter.

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

error_flag(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.

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.

is_spin_param(self, name)

source code 

Determine whether the given parameter is spin specific.

Parameters:
  • name (str) - The name of the parameter.
Returns: bool
True if the parameter is spin specific, False otherwise.

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. This can be set to 'all' for all names, to 'fixed' for parameter of the model which are permanently fixed, to 'params' for parameter of the model which are optimised or calculated, 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.

scope(self, name)

source code 

Return the parameter scope.

Parameters:
  • name (str) - The name of the parameter.
Returns: str
The scope. This is 'global' for parameters located within the global scope of the current data pipe. Or 'spin' for spin specific parameters. Alternatively the value 'both' indicates that there are both global and specific versions of this parameter.

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.

simulation_flag(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.

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.

type_string(self, name)

source code 

Return the Python type for the parameter as a string representation.

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

uf_doc(self, label=None, caption=None, scope='spin', default=False, units=False, type=False)

source code 

"Create the parameter documentation for the user function docstrings.

Parameters:
  • label (str) - The label of the table to return.
Returns: Desc_container instance
The parameter documentation.

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.