Package ComboCode :: Package cc :: Package ivs :: Package sigproc :: Package lmfit :: Package uncertainties :: Class Variable
[hide private]
[frames] | no frames]

Class Variable

source code


Representation of a float-like scalar random variable, along with its uncertainty.

Objects are meant to represent variables that are independent from each other (correlations are handled through the AffineScalarFunc class).

Instance Methods [hide private]
 
__init__(self, value, std_dev, tag=None)
The nominal value and the standard deviation of the variable are set.
source code
 
set_std_dev(self, value)
Updates the standard deviation of the variable to a new value.
source code
 
_general_representation(self, to_string)
Uses the to_string() conversion function on both the nominal value and standard deviation and returns a string that describes the number.
source code
 
__hash__(self)
hash(x)
source code
 
__copy__(self)
Hook for the standard copy module.
source code
 
__deepcopy__(self, memo)
Hook for the standard copy module.
source code
 
__getstate__(self)
Hook for the standard pickle module.
source code
 
__setstate__(self, data_dict)
Hook for the standard pickle module.
source code

Inherited from AffineScalarFunc: __abs__, __add__, __complex__, __div__, __eq__, __float__, __floordiv__, __ge__, __gt__, __int__, __le__, __long__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __pos__, __pow__, __radd__, __rdiv__, __repr__, __rfloordiv__, __rmod__, __rmul__, __rpow__, __rsub__, __rtruediv__, __str__, __sub__, __truediv__, __trunc__, error_components, std_dev, std_score

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  _std_dev
  tag

Inherited from AffineScalarFunc: derivatives, nominal_value

Inherited from AffineScalarFunc (private): _nominal_value

Inherited from object: __class__

Method Details [hide private]

__init__(self, value, std_dev, tag=None)
(Constructor)

source code 

The nominal value and the standard deviation of the variable are set. These values must be scalars.

'tag' is a tag that the user can associate to the variable. This is useful for tracing variables.

The meaning of the nominal value is described in the main module documentation.

Overrides: object.__init__

_general_representation(self, to_string)

source code 

Uses the to_string() conversion function on both the nominal value and standard deviation and returns a string that describes the number.

to_string() is typically repr() or str().

Overrides: AffineScalarFunc._general_representation

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__deepcopy__(self, memo)

source code 

Hook for the standard copy module.

A new variable is created.

Overrides: AffineScalarFunc.__deepcopy__

__getstate__(self)

source code 

Hook for the standard pickle module.

Overrides: AffineScalarFunc.__getstate__

__setstate__(self, data_dict)

source code 

Hook for the standard pickle module.

Overrides: AffineScalarFunc.__setstate__