Changeset 1276


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.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1261 r1276  
    425425                    if result == wx.ID_NO: return []
    426426                           
    427                 self.lastimport = filename
     427                self.lastimport = filename # this is probably not what I want to do -- it saves only the
     428                # last name in a series. See rd.readfilename for a better name.
     429               
    428430                # try the file first with Readers that specify the
    429431                # file's extension and later with ones that merely allow it
     
    459461                            rd.errors += "\n  Traceback info:\n"+str(traceback.format_exc())
    460462                        if flag: # this read succeeded
     463                            rd.readfilename = filename
    461464                            rd_list.append(copy.deepcopy(rd)) # save the result before it is written over
    462465                            if rd.repeat:
     
    11891192            HistName = G2obj.MakeUniqueLabel(HistName,PWDRlist)
    11901193            print 'Read powder data '+str(HistName)+ \
    1191                 ' from file '+str(self.lastimport) + \
     1194                ' from file '+str(rd.readfilename) + \
    11921195                ' with parameters from '+str(rd.instmsg)
    11931196            # data are read, now store them in the tree
  • trunk/GSASIIIO.py

    r1275 r1276  
    13111311        # select one or more from a from list
    13121312        choices = [i.filename for i in zinfo]
    1313         dlg = wx.MultiChoiceDialog(parent,'Select file(s) to extract from zip file'+str(filename),
    1314             'Choose file(s)',choices,wx.CHOICEDLG_STYLE,)
     1313        dlg = G2gd.G2MultiChoiceDialog(parent,'Select file(s) to extract from zip file '+str(filename),
     1314            'Choose file(s)',choices)
    13151315        if dlg.ShowModal() == wx.ID_OK:
    13161316            zlist = dlg.GetSelections()
     
    14091409        self.repeat = False
    14101410        self.repeatcount = 0
     1411        self.readfilename = '?'
    14111412        #print 'created',self.__class__
    14121413
     
    14171418        self.repeat = False
    14181419        self.repeatcount = 0
     1420        self.readfilename = '?'
    14191421
    14201422    def BlockSelector(self, ChoiceList, ParentFrame=None,
  • 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.