Package specific_fns :: 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)
Set up the class.
source code
 
add(self, name, string=None, default=None, units=None, desc=None, conv_factor=None, grace_string=None)
Add a parameter to the list.
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
str
get_grace_string(self, name)
Return the Grace string for the parameter.
source code
str
get_units(self, name)
Return the units string for the parameter.
source code
Method Details [hide private]

add(self, name, string=None, default=None, units=None, desc=None, conv_factor=None, grace_string=None)

source code 

Add a parameter to the list.

Parameters:
  • name (str) - The name of the parameter. This will be used as the variable name.
  • 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.
  • 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.

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_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_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.