Changeset 4628 for trunk


Ignore:
Timestamp:
Oct 27, 2020 4:47:16 PM (13 months ago)
Author:
toby
Message:

fixup display of sequential refinement messages

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4624 r4628  
    77327732        Types += [wg.GRID_VALUE_FLOAT+':10,5',]
    77337733    deltaChiCol = len(colLabels)-1
     7734    # frozen variables?
     7735    f = [len(Controls['parmFrozen'].get(h,[])) for h in histNames]
     7736    if any(f):
     7737        G2frame.colList += [f]
     7738        G2frame.colSigs += [None]
     7739        colLabels += ['frozen']
     7740        Types += [wg.GRID_VALUE_LONG]
    77347741    # add changing sample parameters to table
    77357742    for key in sampleParms:
  • trunk/GSASIIstrIO.py

    r4591 r4628  
    34673467    return histVary,histDict,controlDict
    34683468   
    3469 def SetHistogramData(parmDict,sigDict,Histograms,FFtables,Print=True,pFile=None):
    3470     'needs a doc string'
     3469def SetHistogramData(parmDict,sigDict,Histograms,FFtables,Print=True,pFile=None,seq=False):
     3470    'Shows histogram data after a refinement'
    34713471   
    34723472    def SetBackgroundParms(pfx,Background,parmDict,sigDict):
     
    36603660            sampSig = SetSampleParms(pfx,Sample,parmDict,sigDict)
    36613661
    3662             pFile.write('\n Histogram: %s histogram Id: %d\n'%(histogram,hId))
    3663             pFile.write(135*'='+'\n')
     3662            if not seq:
     3663                pFile.write('\n Histogram: %s histogram Id: %d\n'%(histogram,hId))
     3664                pFile.write(135*'='+'\n')
    36643665            pFile.write(' PWDR histogram weight factor = '+'%.3f\n'%(Histogram['wtFactor']))
    36653666            pFile.write(' Final refinement wR = %.2f%% on %d observations in this histogram\n'%
  • trunk/GSASIIstrMain.py

    r4588 r4628  
    550550
    551551        ifSeq = True
    552         printFile.write('\n Refinement results for histogram: %s\n'%histogram)
     552        printFile.write('\n Refinement results for histogram id {}: {}\n'
     553                            .format(hId,histogram))
    553554        printFile.write(135*'-'+'\n')
    554555        # remove frozen vars
     
    561562        if len(frozenList) != 0:
    562563           varyList = [i for i in varyList if i not in parmFrozenList]
     564           s = ''
     565           for a in frozenList:
     566               if s:
     567                   s+= ', '
     568               s += a
    563569           printFile.write(
    564                ' The following refined variables have previously been frozen due to exceeding limits\n\t:{}\n'
    565                .format(frozenList))
     570               ' The following refined variables have previously been frozen due to exceeding limits:\n\t{}\n'
     571               .format(s))
    566572        try:
    567573            IfOK,Rvals,result,covMatrix,sig = RefineCore(Controls,Histo,Phases,restraintDict,
     
    583589            # check for variables outside their allowed range, reset and freeze them
    584590            frozen = dropOOBvars(varyList,parmDict,sigDict,Controls,parmFrozenList)
     591            msg = None
    585592            if len(frozen) > 0:
    586593               msg = ('Hist {}: {} variables were outside limits and were frozen (now {} frozen total)'
    587594                   .format(ihst,len(frozen),len(parmFrozenList)))
    588595               G2fil.G2Print(msg)
    589                printFile.write(msg+'\n')
     596               msg = (' {} variables were outside limits and were frozen (now {} frozen total)'
     597                   .format(len(frozen),len(parmFrozenList)))
    590598               for p in frozen:
    591599                   if p not in varyList:
     
    611619#            G2stIO.SetRigidBodyModels(parmDict,sigDict,rigidbodyDict,printFile)
    612620            G2stIO.SetHistogramPhaseData(parmDict,sigDict,Phases,Histo,None,ifPrint,printFile)
    613             G2stIO.SetHistogramData(parmDict,sigDict,Histo,None,ifPrint,printFile)
     621            G2stIO.SetHistogramData(parmDict,sigDict,Histo,None,ifPrint,printFile,seq=True)
    614622            G2stIO.SaveUpdatedHistogramsAndPhases(GPXfile,Histo,Phases,rigidbodyDict,histRefData,Controls['parmFrozen'])
     623            if msg:
     624                printFile.write(msg+'\n')
    615625            NewparmDict = {}
    616626            # make dict of varied parameters in current histogram, renamed to
     
    656666        postFrozenCount += len(Controls['parmFrozen'][h])
    657667    if postFrozenCount:
    658         msgs['Frozen'] = 'Ending refinement with {} Frozen variables ({} added here)\n'.format(postFrozenCount,postFrozenCount-preFrozenCount)
    659         printFile.write('\n '+msg)
     668        msgs['Frozen'] = 'Ending refinement with {} Frozen variables ({} added now)\n'.format(postFrozenCount,postFrozenCount-preFrozenCount)
     669        printFile.write('\n'+msgs['Frozen'])
    660670    printFile.close()
    661671    G2fil.G2Print (' Sequential refinement results are in file: '+ospath.splitext(GPXfile)[0]+'.lst')
Note: See TracChangeset for help on using the changeset viewer.