Ignore:
Timestamp:
Apr 11, 2014 2:31:29 PM (8 years ago)
Author:
toby
Message:

seq. ref. bugs: wrong file name on msg; fix wildcarded constraints.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r1247 r1276  
    556556    depVarList = []
    557557    multdepVarList = []
     558    translateTable = {} # lookup table for wildcard referenced variables
    558559    for varlist,mapvars,multarr,invmultarr in zip(       # process equivalences
    559560        dependentParmList,indParmList,arrayList,invarrayList):
     
    635636                if var.startswith('_'): continue
    636637                if var.split(':')[1] == '*' and SeqHist is not None:
    637                     # convert wildcard var to current histogram
     638                    # convert wildcard var to reference current histogram; save translation in table
    638639                    sv = var.split(':')
    639640                    sv[1] = str(SeqHist)
    640                     var = ':'.join(sv)
     641                    translateTable[var] = ':'.join(sv)
     642                    var = translateTable[var]
    641643                if parmDict is not None and var not in parmDict:
    642644                    unused += 1
     
    682684            unused = 0
    683685            for var in VarKeys(constrDict[rel]):
    684                 if var.split(':')[1] == '*' and SeqHist is not None:
    685                     # convert wildcard var to current histogram
    686                     sv = var.split(':')
    687                     sv[1] = str(SeqHist)
    688                     var = ':'.join(sv)
     686                var = translateTable.get(var,var) # replace wildcards
    689687                if parmDict is not None and var not in parmDict:
    690688                    unused += 1                   
     
    751749            if debug: print ('   '+_FormatConstraint(constrDict[rel],fixedList[rel]))
    752750            continue
    753         dependentParmList.append(varlist)
     751        dependentParmList.append([translateTable.get(var,var) for var in varlist])
    754752        arrayList.append(constrArr)
    755753        invarrayList.append(np.linalg.inv(constrArr))
Note: See TracChangeset for help on using the changeset viewer.