Package diffpy :: Package pdfgui :: Package control :: Module parameter :: Class Parameter
[hide private]
[frames] | no frames]

Class Parameter

source code

Parameter is class for value and properties of refined parameter.
Because the initial value of Parameter may come from another Fitting,
it is accessed by setInitial(), initialStr() and initialValue() methods.

Data members:
    idx       -- integer identifier of this parameter in PdfFit
    name      -- optional description
    refined   -- refined value of the parameter, float or None.
    fixed     -- flag for fixing the parameter in refinement [False]

Private members:
    __initial -- stores the initial value, float, or "=fitname:idx" string
    __fitrepr -- None or string representation of Fitting instance



Instance Methods [hide private]
 
__init__(self, idx, initial=0.0)
Initialize new parameter idx -- idx of this parameter in PdfFit initial -- optional initial value of the parameter.
source code
 
setInitial(self, initial)
set initial value to float or refined value from another Fitting.
source code
 
initialStr(self)
Convert initial value to string.
source code
 
initialValue(self)
Convert initial value to float.
source code
 
__getLinkedValue(self)
Private retrieval of parameter value from linked Fitting.
source code
 
__findLinkedFitting(self)
Private search for linked Fitting by name and by representation.
source code
Method Details [hide private]

__init__(self, idx, initial=0.0)
(Constructor)

source code 
Initialize new parameter

idx     -- idx of this parameter in PdfFit
initial -- optional initial value of the parameter. 
           It can be float, Fitting, "=fitname" or "=fitname:idx" string.

setInitial(self, initial)

source code 
set initial value to float or refined value from another Fitting.

initial -- initial value, it can be something convertible to float,
           Fitting reference or string in "=fitname" or
           "=fitname:idx" format.

initialStr(self)

source code 
Convert initial value to string. 

returns string in "=fitname:idx" or "%f" format

initialValue(self)

source code 
Convert initial value to float.
For linked parameters it may raise:
    ControlKeyError      if source Fitting does not exist
    KeyError             when parameter does not exist
    ControlRunTimeError  for self-dependent parameters

returns the initial value

__findLinkedFitting(self)

source code 
Private search for linked Fitting by name and by representation.
Should be called only when initial value is linked to another
Fitting.  Updates self.__initial and self.__fitrepr.

returns reference to Fitting when found or None