Changeset 4588 for trunk


Ignore:
Timestamp:
Oct 11, 2020 12:07:42 PM (3 years ago)
Author:
toby
Message:

use G2VarObj for param limits; add more info to seq. ref. done dialog; show Frozen in show LS parameters

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4579 r4588  
    40554055        selectionsSizer.Add(varSizer,0)
    40564056        parmSizer.Add(selectionsSizer,0)
    4057         listSel = wx.RadioBox(self,wx.ID_ANY,'Parameter type:',
    4058             choices=['All','Refined'],
     4057        refChoices = ['All','Refined']
     4058        txt = ('"R" indicates a refined variable\n'+
     4059               '"C" indicates generated from a constraint')
     4060        if fcount:
     4061            refChoices += ['Frozen']
     4062            txt += '\n"F" indicates a variable that is Frozen due to exceeding min/max'
     4063       
     4064        listSel = wx.RadioBox(self,wx.ID_ANY,'Refinement Status:',
     4065            choices=refChoices,
    40594066            majorDimension=0,style=wx.RA_SPECIFY_COLS)
    40604067        listSel.SetStringSelection(self.listSel)
     
    40714078        mainSizer.Add(self.varBox,1,wx.ALL|wx.EXPAND,1)
    40724079
    4073         txt = ('"R" indicates a refined variable\n'+
    4074                '"C" indicates generated from a constraint\n'+
    4075                '"F" indicates a variable that is Frozen due to exceeding min/max')
    40764080        mainSizer.Add(
    40774081            wx.StaticText(self,label=txt),0, wx.ALL,0)
     
    40914095    def __init__(self, parent):
    40924096        self.parmWin = parent
     4097        #patch (added Oct 2020) convert variable names for parm limits to G2VarObj
     4098        G2sc.patchControls(self.parmWin.Controls)
     4099        # end patch
    40934100        wx.ListCtrl.__init__(
    40944101            self, parent, -1,
     
    41194126            if 'Refined' in parent.listSel and (name not in parent.fullVaryList
    41204127                                              ) and (name not in parent.varyList):
     4128                continue
     4129            if 'Frozen' in parent.listSel and not (
     4130                    name in self.parmWin.fullVaryList and
     4131                    name in self.parmWin.frozenList):
    41214132                continue
    41224133            if 'Phase' in parent.parmChoice:
     
    41604171        def delMafter(d,name):
    41614172            'Delete Max or Min limit once dialog is deleted'
    4162             n,val = G2obj.prmLookup(name,d) # is this a wild-card?
     4173            key,val = G2obj.prmLookup(name,d) # is this a wild-card?
    41634174            if val is not None:
    4164                 del d[n]
     4175                del d[key]
    41654176            self.OnRowSelected(None, row)
    41664177           
     
    41774188            'Add a Max or Min limit & redraw'
    41784189            try:
    4179                 d[name] = float(value)
     4190                d[G2obj.G2VarObj(name)] = float(value)
    41804191            except:
    4181                 d[name] = 0.0
     4192                pass
    41824193            self.OnRowSelected(None, row)
    41834194           
     
    42004211            'Set/clear item as wildcard & delete old name(s), redraw'
    42014212            n,val = G2obj.prmLookup(name,d) # is this a wild-card?
     4213            if val is None:
     4214                print('Error: Limit for parameter {} not found. Should not happen'.format(name))
     4215                return
    42024216            if mode: # make wildcard
    4203                 if n == name: # confirm not wildcard already
    4204                     d[wname] = d[name]
    42054217                for n in list(d.keys()): # delete names matching wildcard
    4206                     if n == wname: continue
    4207                     if G2obj.prmLookup(n,d)[0] == wname:
     4218                    if str(n) == wname: continue
     4219                    if n == wname: # respects wildcards
    42084220                        del d[n]
     4221                d[G2obj.G2VarObj(wname)] = val
    42094222            else:
    4210                 if n != name:
    4211                     d[name] = d[wname]               
    4212                     del d[wname]
     4223                del d[n]
     4224                d[G2obj.G2VarObj(name)] = val
    42134225            self.OnRowSelected(None, row)
    42144226
     4227        # start of OnRowSelected
    42154228        if event is not None:
    42164229            row = event.Index
    42174230        elif row is None:
    4218             print('Error: row and event should not be None!')
     4231            print('Error: row and event should not both be None!')
    42194232            return
    42204233        name = self.varList[row]
     
    42834296                subSizer.Add((5,-1),0,WACV)
    42844297                wild = wx.CheckBox(dlg,wx.ID_ANY,label='Match all histograms ')
    4285                 wild.SetValue(n.split(':')[1] == '*')
     4298                wild.SetValue(str(n).split(':')[1] == '*')
    42864299                wild.Bind(wx.EVT_CHECKBOX,SetWild)
    42874300                wild.hist = True
     
    42904303                subSizer.Add((5,-1),0,WACV)
    42914304                wild = wx.CheckBox(dlg,wx.ID_ANY,label='Match all atoms ')
    4292                 wild.SetValue(n.split(':')[3] == '*')
     4305                wild.SetValue(str(n).split(':')[3] == '*')
    42934306                wild.Bind(wx.EVT_CHECKBOX,SetWild)
    42944307                subSizer.Add(wild,0,WACV)
    42954308            mainSizer.Add(subSizer,0)
    4296 
    42974309        # draw max value widgets
    42984310        mainSizer.Add((-1,10),0)
     
    43154327                subSizer.Add((5,-1),0,WACV)
    43164328                wild = wx.CheckBox(dlg,wx.ID_ANY,label='Match all histograms ')
    4317                 wild.SetValue(n.split(':')[1] == '*')
     4329                wild.SetValue(str(n).split(':')[1] == '*')
    43184330                wild.Bind(wx.EVT_CHECKBOX,SetWild)
    43194331                wild.max = True
     
    43234335                subSizer.Add((5,-1),0,WACV)
    43244336                wild = wx.CheckBox(dlg,wx.ID_ANY,label='Match all atoms ')
    4325                 wild.SetValue(n.split(':')[3] == '*')
     4337                wild.SetValue(str(n).split(':')[3] == '*')
    43264338                wild.Bind(wx.EVT_CHECKBOX,SetWild)
    43274339                wild.max = True
  • trunk/GSASIIdataGUI.py

    r4583 r4588  
    51965196            wx.Yield()
    51975197        if OK:
    5198             dlg = wx.MessageDialog(self,'Load new result?','Refinement results',wx.OK|wx.CANCEL)
     5198            lst = os.path.splitext(os.path.abspath(self.GSASprojectfile))[0]
     5199            text = 'Detailed results are in ' + lst + '.lst\n'
     5200            if Msg.get('Frozen'):
     5201                text += '\n' +  Msg['Frozen']
     5202            if Msg.get('steepestNum',0) > 0:
     5203                text += '\nNote that {} histograms had extreme correlations where steepest descents dominates\n'.format(Msg['steepestNum'])
     5204            if len(Msg.get('maxshift/sigma',[])) > 0:
     5205                avg = np.average(Msg['maxshift/sigma'])
     5206                mx = np.max(Msg['maxshift/sigma'])
     5207                text += '\nBiggest Max shft/sig was {:.3f} (average across histograms {:.3f})\n'.format(mx,avg)
     5208            text += '\nLoad new result?'               
     5209            dlg = wx.MessageDialog(self,text,'Refinement results',wx.OK|wx.CANCEL)
    51995210            try:
    52005211                if dlg.ShowModal() == wx.ID_OK:
     
    65066517
    65076518    def ClearFrozen(event):
     6519        'Removes all frozen parameters by clearing the entire dict'
    65086520        Controls['parmFrozen'] = {}
    65096521        wx.CallAfter(UpdateControls,G2frame,data)
    65106522       
     6523    # start of UpdateControls
    65116524    if 'SVD' in data['deriv type']:
    65126525        G2frame.GetStatusBar().SetStatusText('Hessian SVD not recommended for initial refinements; use analytic Hessian or Jacobian',1)
     
    65306543    mainSizer.Add((5,5),0)
    65316544    Controls = data
    6532     if 'parmFrozen' not in Controls:
    6533         Controls['parmFrozen'] = {}
     6545    # count frozen variables (in appropriate place)
     6546    for key in ('parmMinDict','parmMaxDict','parmFrozen'):
     6547        if key not in Controls: Controls[key] = {}
    65346548    parmFrozen = Controls['parmFrozen']
    65356549    if G2frame.testSeqRefineMode():
  • trunk/GSASIIobj.py

    r4578 r4588  
    11871187either or both may be optionally specified. Parameters limits are specified in the Controls
    11881188tree entry in dicts named as ``Controls['parmMaxDict']`` and ``Controls['parmMinDict']``, where
    1189 the keys are named using the standard GSAS-II variable
    1190 (see :func:`getVarDescr` and :func:`CompileVarDesc`) or with a variable name, where a
    1191 wildcard ('*') is used for histogram number or atom number (phase number is intentionally not
    1192 allowed as a wildcard as it makes little sense to group together different phases). Note
    1193 that func:`prmLookup` is used to see if a name matches a wildcard. The upper or lower limit
     1189the keys are :class:`G2VarObj` objects corresponding to standard GSAS-II variable
     1190(see :func:`getVarDescr` and :func:`CompileVarDesc`) names, where a
     1191wildcard ('*') may optionally be used for histogram number or atom number
     1192(phase number is intentionally not  allowed as a wildcard as it makes little sense
     1193to group the same parameter together different phases). Note
     1194that :func:`prmLookup` is used to see if a name matches a wildcard. The upper or lower limit
    11941195is placed into these dicts as a float value. These values can be edited using the window
    11951196created by the Calculate/"View LS parms" menu command or in scripting with the
     
    12001201When a refinement is conducted, routine :func:`GSASIIstrMain.dropOOBvars` is used to
    12011202find parameters that have refined to values outside their limits. If this occurs, the parameter
    1202 is set to the limiting value and the variable name is added to a list of frozen variables kept in the
    1203 ``Controls['parmFrozen']`` dict. In a sequential refinement, this is kept as a list in
    1204 ``Controls['parmFrozen'][histogram]`` (where the key is the histogram name) or in
     1203is set to the limiting value and the variable name is added to a list of frozen variables
     1204(as a :class:`G2VarObj` objects) kept in a list in the
     1205``Controls['parmFrozen']`` dict. In a sequential refinement, this is kept separate for
     1206each histogram as a list in
     1207``Controls['parmFrozen'][histogram]`` (where the key is the histogram name) or as a list in
    12051208``Controls['parmFrozen']['FrozenList']`` for a non-sequential fit.
    12061209This allows different variables
     
    12111214future refinements unless the the variable is removed (manually) from the list. This can also
    12121215be done with the Calculate/"View LS parms" menu window or ...
     1216
     1217.. seealso::
     1218  :class:`G2VarObj`
     1219  :func:`getVarDescr`
     1220  :func:`CompileVarDesc`
     1221  :func:`prmLookup`
     1222  :class:`GSASIIctrlGUI.ShowLSParms`
     1223  :class:`GSASIIctrlGUI.VirtualVarBox`
     1224  :func:`GSASIIstrIO.SetUsedHistogramsAndPhases`
     1225  :func:`GSASIIstrIO.SaveUpdatedHistogramsAndPhases`
     1226  :func:`GSASIIstrIO.SetSeqResult`
     1227  :func:`GSASIIstrMain.dropOOBvars`
     1228  :meth:`GSASIIscriptable.G2Project.set_Controls`
    12131229
    12141230*Classes and routines*
     
    14521468        return cif.ReadCif(URLorFile)
    14531469
     1470def TestIndexAll():
     1471    '''Test if :func:`IndexAllIds` has been called to index all phases and
     1472    histograms (this is needed before :func:`G2VarObj` can be used.
     1473
     1474    :returns: Returns True if indexing is needed.
     1475    '''
     1476    if PhaseIdLookup or AtomIdLookup or HistIdLookup:
     1477        return False
     1478    return True
     1479       
    14541480def IndexAllIds(Histograms,Phases):
    14551481    '''Scan through the used phases & histograms and create an index
     
    20002026
    20012027def prmLookup(name,prmDict):
    2002     '''looks for a parameter in a min/max dictionary, optionally
    2003     considering a wild card for histogram & atom number
    2004     '''
    2005     sn = name.split(':')
    2006     if sn[1] != '': sn[1] = '*'
    2007     if len(sn) >= 4 and sn[3] != '': sn[3] = '*'
    2008     wname = ':'.join(sn)
    2009     if wname in prmDict:
    2010         return wname,prmDict[wname]
    2011     elif name in prmDict:
    2012         return name,prmDict[name]
     2028    '''Looks for a parameter in a min/max dictionary, optionally
     2029    considering a wild card for histogram or atom number (use of
     2030    both will never occur at the same time).
     2031
     2032    :param name: a GSAS-II parameter name (str, see :func:`getVarDescr`
     2033      and :func:`CompileVarDesc`) or a :class:`G2VarObj` object.
     2034      If this contains a wildcard (* for
     2035      histogram or atom number) only the exact same name (with
     2036      that wildcard) will be matched in parmDict
     2037    :param dict prmDict: a min/max dictionary, (parmMinDict
     2038      or parmMaxDict in Controls) where keys are :class:`G2VarObj`
     2039      objects.
     2040    :returns: Two values, (**matchname**, **value**), are returned where:
     2041
     2042       * **matchname** *(str)* is the :class:`G2VarObj` object
     2043         corresponding to the actual matched name,
     2044         which could contain a wildcard even if **name** does not; and
     2045       * **value** *(float)* which contains the parameter limit.
     2046    '''
     2047    keyLookup = {str(key):key for key in prmDict}
     2048    sn = str(name).split(':')
     2049    if str(name) in keyLookup:
     2050        return keyLookup[str(name)],prmDict[keyLookup[str(name)]]
     2051    elif sn[1] != '':
     2052        sn[1] = '*'
     2053        wname = ':'.join(sn)
     2054    elif len(sn) >= 4 and sn[3] != '':
     2055        sn[3] = '*'
     2056        wname = ':'.join(sn)
     2057    else:
     2058        return None,None
     2059    if wname in keyLookup:
     2060        return keyLookup[wname],prmDict[keyLookup[wname]]
    20132061    else:
    20142062        return None,None
     
    20462094    unique Id numbers or using a character string that specifies
    20472095    variables by phase/atom/histogram number (which can change).
    2048     Note that :func:`LoadID` should be used to (re)load the current Ids
     2096    Note that :func:`GSASIIstrIO.GetUsedHistogramsAndPhases`,
     2097    which calls :func:`IndexAllIds` (or
     2098    :func:`GSASIIscriptable.G2Project.index_ids`) should be used to
     2099    (re)load the current Ids
    20492100    before creating or later using the G2VarObj object.
    20502101
     
    21372188        return self.varname()
    21382189
     2190    def __hash__(self):
     2191        'Allow G2VarObj to be a dict key by implementing hashing'
     2192        return hash(self.varname())
     2193
    21392194    def varname(self):
    21402195        '''Formats the GSAS-II variable name as a "traditional" GSAS-II variable
     
    21992254
    22002255    def __eq__(self, other):
    2201         if type(other) is type(self):
    2202             return (self.phase == other.phase and
    2203                     self.histogram == other.histogram and
    2204                     self.name == other.name and
    2205                     self.atom == other.atom)
    2206         return False
     2256        '''Allow comparison of G2VarObj to other G2VarObj objects or strings.
     2257        If any field is a wildcard ('*') that field matches.
     2258        '''
     2259        if type(other) is str:
     2260            other = G2VarObj(other)
     2261        elif type(other) is not G2VarObj:
     2262            raise Exception("Invalid type ({}) for G2VarObj comparison with {}"
     2263                            .format(type(other),other))
     2264        if self.phase != other.phase and self.phase != '*' and other.phase != '*':
     2265            return False
     2266        if self.histogram != other.histogram and self.histogram != '*' and other.histogram != '*':
     2267            return False
     2268        if self.atom != other.atom and self.atom != '*' and other.atom != '*':
     2269            return False
     2270        if self.name != other.name:
     2271            return False
     2272        return True
    22072273
    22082274    def _show(self):
  • trunk/GSASIIpwd.py

    r4571 r4588  
    18801880    :param dict controls: a dict specifying two values, Ftol = controls['min dM/M']
    18811881      and derivType = controls['deriv type']. If None default values are used.
    1882     :param float wtFactor. weight multiplier; = 1.0 by default
     1882    :param float wtFactor: weight multiplier; = 1.0 by default
    18831883    :param wx.Dialog dlg: A dialog box that is updated with progress from the fit.
    1884       Defaults to None, which means no updates are done. 
     1884      Defaults to None, which means no updates are done.
    18851885    '''
    18861886    def GetBackgroundParms(parmList,Background):
  • trunk/GSASIIscriptable.py

    r4578 r4588  
    19681968    return np.asarray(sumImg,dtype='int32')
    19691969
     1970def patchControls(Controls):
     1971    '''patch routine to convert variable names used in parmeter limits
     1972    to G2VarObj objects
     1973    '''
     1974    #patch (added Oct 2020) convert variable names for parm limits to G2VarObj
     1975    for d in 'parmMaxDict','parmMinDict':
     1976        for k in Controls[d]: 
     1977            if type(k) is str:
     1978                print("Applying patch to Controls['{}']".format(d))
     1979                Controls[d] = {G2obj.G2VarObj(k):v for k,v in Controls[d].items()}
     1980                break
     1981    conv = False
     1982    for k in Controls['parmFrozen']:
     1983        for item in Controls['parmFrozen'][k]:
     1984            if type(item) is str:
     1985                conv = True
     1986                Controls['parmFrozen'][k] = [G2obj.G2VarObj(i) for i in Controls['parmFrozen'][k]]
     1987                break
     1988    if conv: print("Applying patch to Controls['parmFrozen']")
     1989    # end patch
     1990
    19701991class G2ObjectWrapper(object):
    19711992    """Base class for all GSAS-II object wrappers.
     
    30513072
    30523073        Automatically converts string phase, hist, or atom names into the ID required
    3053         by G2VarObj."""
     3074        by G2VarObj.
     3075
     3076        Note that this will cause the project to be saved if not
     3077        already done so.
     3078        """
    30543079
    30553080        if reloadIdx:
     3081            self.index_ids()
     3082        elif G2obj.TestIndexAll():
    30563083            self.index_ids()
    30573084
     
    33613388       
    33623389    def set_Controls(self, control, value, variable=None):
    3363         '''Set project controls
     3390        '''Set project controls.
     3391
     3392        Note that use of this with control set to parmMin or parmMax
     3393        will cause the project to be saved if not already done so.
    33643394
    33653395        :param str control: the item to be set. See below for allowed values.
     
    33933423            for key in ('parmMinDict','parmMaxDict','parmFrozen'):
    33943424                if key not in self.data['Controls']['data']: self.data['Controls']['data'][key] = {}
     3425            if G2obj.TestIndexAll(): self.index_ids()
     3426            patchControls(self.data['Controls']['data'])
    33953427        if control == 'cycles':
    33963428            self.data['Controls']['data']['max cyc'] = int(value)
     
    34103442            self.data['Controls']['data']['Seq Data'] = histlist
    34113443        elif control == 'parmMin' or control == 'parmMax':
    3412             self.data['Controls']['data'][control+'Dict'][variable] = float(value)
     3444            key = G2obj.G2VarObj(variable)
     3445            self.data['Controls']['data'][control+'Dict'][key] = float(value)
    34133446        else:
    34143447            raise Exception('{} is an invalid control value'.format(control))
  • trunk/GSASIIstrIO.py

    r4534 r4588  
    658658    :param dict RigidBodies: dictionary of rigid bodies
    659659    :param dict CovData: dictionary of refined variables, varyList, & covariance matrix
    660     :param list parmFrozenList: list of parameters that are frozen due to limits
    661     :param bool makeBack: True if new backup of .gpx file is to be made; else use the last one made
    662 
     660    :param list parmFrozenList: list of parameters (as str) that are frozen
     661      due to limits; converted to :class:`GSASIIobj.G2VarObj` objects.
     662    :param bool makeBack: True if new backup of .gpx file is to be made; else
     663      use the last one made
    663664    '''
    664665                       
     
    689690            if 'parmFrozen' not in Controls:
    690691                Controls['parmFrozen'] = {}
    691             Controls['parmFrozen']['FrozenList'] = parmFrozenList
     692            Controls['parmFrozen']['FrozenList'] = [G2obj.G2VarObj(i) for i in parmFrozenList]
    692693        try:
    693694            histogram = Histograms[datum[0]]
     
    772773    :param dict CovData: dictionary of refined variables, varyList, & covariance matrix
    773774    :param dict parmFrozen: dict with frozen parameters for all phases
     775      and histograms (specified as str values)
    774776    '''
    775777                       
     
    852854    name,CovData = cPickleLoad(fp)[0] # 2nd block in file should be Covariance
    853855    name,RigidBodies = cPickleLoad(fp)[0] # 3rd block in file should be Rigid Bodies
    854     name,parmFrozen = cPickleLoad(fp)[0] # 4th block in file should be frozen parameters
     856    name,parmFrozenDict = cPickleLoad(fp)[0] # 4th block in file should be frozen parameters
    855857    fp.close()
    856858    GPXhist = os.path.splitext(GPXfile)[0]+'.seqHist'
     
    887889            Controls = data[0][1]
    888890            Controls['Copy2Next'] = False
    889             Controls['parmFrozen'] = parmFrozen
     891            for key in parmFrozenDict:
     892                Controls['parmFrozen'][key] = [
     893                    i if type(i) is G2obj.G2VarObj
     894                    else G2obj.G2VarObj(i)
     895                    for i in parmFrozenDict[key]]
    890896        elif datum[0] in histIndex:
    891897            hist.seek(histIndex[datum[0]])
     
    930936    pFile.write(80*'*'+'\n')
    931937
    932 def ShowControls(Controls,pFile=None,SeqRef=False):
     938def ShowControls(Controls,pFile=None,SeqRef=False,preFrozenCount=0):
    933939    'Print controls information'
    934940    pFile.write(' Least squares controls:\n')
     
    944950        pFile.write(' Copy of histogram results to next: %s\n'%(Controls['Copy2Next']))
    945951        pFile.write(' Process histograms in reverse order: %s\n'%(Controls['Reverse Seq']))
     952    if preFrozenCount:
     953        pFile.write('\n Starting refinement with {} Frozen variables\n\n'.format(preFrozenCount))
    946954   
    947955def GetPawleyConstr(SGLaue,PawleyRef,im,pawleyVary):
  • trunk/GSASIIstrMain.py

    r4578 r4588  
    5454    :returns: 5-tuple of ifOk (bool), Rvals (dict), result, covMatrix, sig
    5555    '''
     56    #patch (added Oct 2020) convert variable names for parm limits to G2VarObj
     57    import GSASIIscriptable as G2sc
     58    G2sc.patchControls(Controls)
     59    # end patch
    5660#    print 'current',varyList
    5761#    for item in parmDict: print item,parmDict[item] ######### show dict just before refinement
     
    374378    import pytexture as ptx
    375379    ptx.pyqlmninit()            #initialize fortran arrays for spherical harmonics
    376 
     380    msgs = {}
    377381    printFile = open(ospath.splitext(GPXfile)[0]+'.lst','w')
    378382    G2fil.G2Print ('Starting Sequential Refinement')
    379383    G2stIO.ShowBanner(printFile)
    380384    Controls = G2stIO.GetControls(GPXfile)
    381     G2stIO.ShowControls(Controls,printFile,SeqRef=True)
     385    preFrozenCount = 0
     386    for h in Controls['parmFrozen']:
     387        if h == 'FrozenList': continue
     388        preFrozenCount += len(Controls['parmFrozen'][h])   
     389    G2stIO.ShowControls(Controls,printFile,SeqRef=True,
     390                            preFrozenCount=preFrozenCount)
    382391    restraintDict = G2stIO.GetRestraints(GPXfile)
    383392    Histograms,Phases = G2stIO.GetUsedHistogramsAndPhases(GPXfile)
     
    417426    NewparmDict = {}
    418427    G2stIO.SetupSeqSavePhases(GPXfile)
     428    msgs['steepestNum'] = 0
     429    msgs['maxshift/sigma'] = []
    419430    for ihst,histogram in enumerate(histNames):
    420431        if GSASIIpath.GetConfigValue('Show_timing'): t1 = time.time()
     
    559570            G2fil.G2Print ('  wR = %7.2f%%, chi**2 = %12.6g, reduced chi**2 = %6.2f, last delta chi = %.4f, last shft/sig = %.4f'%(
    560571                Rvals['Rwp'],Rvals['chisq'],Rvals['GOF']**2,Rvals['DelChi2'],Rvals.get('Max shft/sig',np.nan)))
     572            if Rvals.get('lamMax',0) >= 10.:
     573                msgs['steepestNum'] += 1
     574            if Rvals.get('Max shft/sig'):
     575                msgs['maxshift/sigma'].append(Rvals['Max shft/sig'])
    561576            # add the uncertainties into the esd dictionary (sigDict)
    562577            if not IfOK:
     
    636651            import traceback
    637652            print(traceback.format_exc())       
     653    postFrozenCount = 0
     654    for h in Controls['parmFrozen']:
     655        if h == 'FrozenList': continue
     656        postFrozenCount += len(Controls['parmFrozen'][h])
     657    if postFrozenCount:
     658        msgs['Frozen'] = 'Ending refinement with {} Frozen variables ({} added here)\n'.format(postFrozenCount,postFrozenCount-preFrozenCount)
     659        printFile.write('\n '+msg)
    638660    printFile.close()
    639661    G2fil.G2Print (' Sequential refinement results are in file: '+ospath.splitext(GPXfile)[0]+'.lst')
    640662    G2fil.G2Print (' ***** Sequential refinement successful *****')
    641     return True,'Success'
     663    return True,msgs
    642664
    643665def dropOOBvars(varyList,parmDict,sigDict,Controls,parmFrozenList):
Note: See TracChangeset for help on using the changeset viewer.