Changeset 1289


Ignore:
Timestamp:
Apr 19, 2014 6:37:07 PM (8 years ago)
Author:
toby
Message:

Fix bug in copy of histogram parms on Copy Next

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r1282 r1289  
    364364        makeBack = False
    365365        NewparmDict = {}
    366         if Controls['Copy2Next']:
    367             hId = Histo[histogram]['hId']
    368             try:
    369                 nexthId = Histograms[histNames[ihst+1]]['hId']
    370                 for parm in parmDict:
    371                     items = parm.split(':',2)
    372                     if str(hId) in items[1] and parm in varyList:
    373                         items[1] = str(nexthId)
    374                         newparm = ':'.join(items)
    375                         NewparmDict[newparm] = parmDict[parm]
    376             except IndexError:
    377                 pass
     366        # make dict of varied parameters in current histogram, renamed to
     367        # next histogram, for use in next refinement.
     368        if Controls['Copy2Next'] and ihst < len(histNames)-1:
     369            hId = Histo[histogram]['hId'] # current histogram
     370            nexthId = Histograms[histNames[ihst+1]]['hId']
     371            for parm in set(list(varyList)+list(varyListStart)):
     372                items = parm.split(':')
     373                if len(items) < 3: continue
     374                if str(hId) in items[1]:
     375                    items[1] = str(nexthId)
     376                    newparm = ':'.join(items)
     377                    NewparmDict[newparm] = parmDict[parm]
    378378    G2stIO.SetSeqResult(GPXfile,Histograms,SeqResult)
    379379    printFile.close()
Note: See TracChangeset for help on using the changeset viewer.