Package diffpy :: Package srrietveld :: Package convert :: Module strategyfile :: Class StrategyFile
[frames] | no frames]

Class StrategyFile

source code

Parse the strategy file into a list of dictionaries for later refinement [{method: [[fullpath, value, constrain formula], ...]}, {...}, ...]

Instance Methods
 
ResetVariableId(self)
When input strategylist, need to reset variableid.
source code
 
__init__(self, fit, strategyfile=None, strategy=None)
Initialization
source code
 
addNewStep(self, step, method, paramlist)
Addd new strategystep
source code
 
addParam(self, step, posid, fullpath, value='', formula=None)
Add the fullpath into parameter list
source code
 
addPosParam(self, id, param)
Add the parameter into paramlist
source code
 
clear(self)
Clean the strategy list
source code
 
getNewVariableId(self)
Get new variable id
source code
 
getNumStep(self)
Get total number of steps
source code
 
getPosParamFullPath(self, id)
Get Fullpath for id parameter in strategyeditor
source code
 
getPosParamListId(self, id)
Get corresponding paramlist to id of strategyeditor
source code
 
getStepMethod(self, step)
Get method for certain step
source code
 
getStepParamList(self, step)
Get strategy for certain step
source code
 
getStrategy(self)
Get the strategy list
source code
 
getStrategyId(self, stepstrategy)
Get the order of the stepstrategy
source code
 
getStrategyStep(self, step)
Get the step dict
source code
 
mergeParamList(self, newparam, paramlist)
Form a new paramlist
source code
 
parseStrategyFile(self)
Parse .txt format file...
source code
 
readFile(self)
Read file
source code
 
removePosParam(self, id)
Remove the position in strategyeditor from parameter list
source code
 
removeStep(self, step)
Remove the step from list
source code
 
setStrategy(self, strategylist)
Set new list to strategylist
source code
 
transRefinables(self, generalpath, generalformula)
Translate the generalpath and generalformula in strategyfile And return the pftuplelist containing the list of parameters for the project.
source code
 
writeToFile(self, fullpath)
write the strateg list to a local file.
source code
Method Details

parseStrategyFile(self)

source code 
Parse .txt format file
strateylist = [{method: [[fullpath, value, constrain formula], ...]}, {...}, ...]
       method: 'Rietveld' or 'Lebail'
       fullpath: full path of parameter;
       value: initial value of refined parameter;
       formula of constraint: 1.0*Var_paramname

writeToFile(self, fullpath)

source code 

write the strateg list to a local file. The strategy is read from the strategy member variable, no the lines fullpath - the file path to write into return