Changeset 5191
- Timestamp:
- Feb 25, 2022 11:56:30 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIexprGUI.py ¶
r5181 r5191 263 263 bSizer.Add((1,1), 1, wx.ALL|wx.EXPAND, 0) 264 264 self.OKbtn = wx.Button(self, wx.ID_OK) 265 self.OKbtn.Bind(wx.EVT_BUTTON,lambda event: self.EndModal(wx.ID_OK)) 265 266 self.OKbtn.SetDefault() 266 267 self.OKbtn.Disable() 267 268 btnsizer.AddButton(self.OKbtn) 268 269 btn = wx.Button(self, wx.ID_CANCEL) 270 btn.Bind(wx.EVT_BUTTON,lambda event: self.EndModal(wx.ID_CANCEL)) 269 271 btnsizer.AddButton(btn) 270 272 btnsizer.Realize() … … 493 495 varListlbl = [fmt.format(i,*G2obj.VarDescr(i)) for i in wildList] 494 496 dlg = G2G.G2SingleChoiceDialog( 495 self,'Select GSAS-II variable for '+str(var)+':',496 'Select variable',497 self,'Select GSAS-II parameter for variable "'+str(var)+'":', 498 'Select parameter', 497 499 varListlbl,monoFont=True) 498 500 dlg.SetSize((625,250)) … … 684 686 self.depVarDict.get(self.dependentVar,'?') 685 687 ) 686 self.setEvalResult("Expression evaluates to: "+str(s)+depVal) 688 self.setEvalResult("Expression evaluates to: "+str(s)+depVal+ 689 " with first defined values") 687 690 self.OKbtn.Enable() 688 691 if self.ExtraBtn: self.ExtraBtn.Enable() -
TabularUnified trunk/GSASIIobj.py ¶
r5181 r5191 3303 3303 varlist = LookupWildCard(varname,list(parmDict.keys())) 3304 3304 if len(varlist) == 0: 3305 raise Exception("No variables match "+str(v)) 3305 self.exprDict[v] = None 3306 self.lblLookup[v] = varname # needed? 3307 self.exprDict.update(self.fxnpkgdict) # needed? 3308 return 3306 3309 for var in varlist: 3307 3310 self.lblLookup[var] = v … … 3363 3366 val = eval(self.compiledExpr,globals(),self.exprDict) 3364 3367 except TypeError: 3368 val = None 3369 except NameError: 3365 3370 val = None 3366 3371 if not np.isscalar(val): -
TabularUnified trunk/GSASIIseqGUI.py ¶
r5189 r5191 695 695 if row[indx] is None: continue 696 696 calcobj.depVal = row[indx] 697 calcobj.depSig = G2frame.colSigs[indx][j] 697 if G2frame.colSigs[indx]: 698 calcobj.depSig = G2frame.colSigs[indx][j] 699 else: 700 calcobj.depSig = 1. 698 701 calcObjList.append(calcobj) 699 702 # varied parameters … … 940 943 key = pfx+'PWLref:'+str(i) 941 944 refl[ik] = parmDict[key] 942 # if key in sigDict: #TODO: error here sigDict not defined. What was intended 945 # if key in sigDict: #TODO: error here sigDict not defined. What was intended? 943 946 # refl[ik+1] = sigDict[key] 944 947 # else: … … 1127 1130 atomsVaryList = {} # dict of atom coords varied in any histogram, includes dependent params 1128 1131 # key is atom param name, value is esd parm name 1129 firstValueDict = {} # first value for each parameter; used forpseudo vars GUI1132 firstValueDict = {} # first value for each parameter; used to create VarDict for parametric fit pseudo vars GUI 1130 1133 foundHistNames = [] # histograms to be used in sequential table 1131 1134 maxPWL = 5 # number of Pawley vars to show … … 1448 1451 esdList.append(np.sqrt(np.inner(derivs,np.inner(VCoV,derivs.T)) )) 1449 1452 else: 1450 derivs = np.array( 1453 derivs = np.array( # TODO: this needs to be reworked 1451 1454 [EvalPSvarDeriv(calcobj,parmDict.copy(),sampleDict[name],var,ESD) 1452 1455 for var,ESD in zip(varyList,sigs)]) 1456 # needs work: calls calcobj.SetupCalc each call time 1457 # integrate into G2obj.ExpressionCalcObj 1453 1458 if None in list(derivs): 1454 1459 esdList.append(None) … … 1470 1475 #---- table build done ------------------------------------------------------------- 1471 1476 1472 # Make dict needed for creating & editing pseudovars (PSvarDict). 1473 1474 name = histNames[0] 1475 parmDict = data[name].get('parmDict',{}) 1476 PSvarDict = parmDict.copy() 1477 # Make PSvarDict, needed for creating & editing pseudovars 1478 # contains 1st value for each parameter in parmDict 1479 PSvarDict = {} 1477 1480 PSvarDict.update(sampleParms) 1481 1482 for name in histNames: 1483 parmDict = data[name].get('parmDict',{}) 1484 PSvarDict.update({i:parmDict[i] for i in parmDict if i not in PSvarDict}) 1478 1485 UpdateParmDict(PSvarDict) 1479 # Also dicts of variables1480 # for Parametric fitting from the data table1481 parmDict = dict(zip(colLabels,list(zip(*G2frame.colList))[0])) # scratch dict w/all values in table1482 parmDict.update({var:val for var,val in newCellDict.values()}) # add varied reciprocal cell terms1483 del parmDict['Use']1484 name = histNames[0]1485 1486 1486 1487 # remove selected items from table … … 1491 1492 G2frame.SeqTblHideList += [item for item in saveColLabels if ':*:D' in item] 1492 1493 #****************************************************************************** 1493 # create a set of values for example evaluation of pseudovars and 1494 # this does not work for refinements that have differing numbers of variables. 1494 # create a set of values for example evaluation of parametric equation fitting 1495 1495 VarDict = {} 1496 1496 for i,var in enumerate(colLabels): -
TabularUnified trunk/exports/G2export_CIF.py ¶
r5150 r5191 3855 3855 self.Write(70*'#') 3856 3856 WriteCIFitem(self.fp, 'data_'+phaseOnly.replace(' ','_')) 3857 WriteCIFitem(self.fp, '_gsas_GSASII_version', 3858 str(GSASIIpath.GetVersionNumber())) 3857 3859 #phaseblk = self.Phases[phaseOnly] # pointer to current phase info 3858 3860 # report the phase info … … 3879 3881 #phasenam = self.Phases.keys()[0] 3880 3882 WriteCIFitem(self.fp, 'data_'+self.CIFname) 3883 WriteCIFitem(self.fp, '_gsas_GSASII_version', 3884 str(GSASIIpath.GetVersionNumber())) 3881 3885 if hist.startswith("PWDR") and MM: 3882 3886 WritePowderDataMM(hist) … … 4082 4086 self.CIFname = hist[5:40].replace(' ','') 4083 4087 WriteCIFitem(self.fp, 'data_'+self.CIFname) 4088 WriteCIFitem(self.fp, '_gsas_GSASII_version', 4089 str(GSASIIpath.GetVersionNumber())) 4084 4090 if hist.startswith("PWDR") and MM: 4085 4091 WritePowderDataMM(hist) … … 4095 4101 #====================================================================== 4096 4102 WriteCIFitem(self.fp, 'data_'+self.CIFname) 4103 WriteCIFitem(self.fp, '_gsas_GSASII_version', 4104 str(GSASIIpath.GetVersionNumber())) 4097 4105 if phasenam is None: # if not already selected, select the first phase (should be one) 4098 4106 phasenam = self.Phases.keys()[0] … … 4157 4165 dlg.Update(step,"Exporting overall section") 4158 4166 WriteCIFitem(self.fp, '\ndata_'+self.CIFname+'_publ') 4167 WriteCIFitem(self.fp, '_gsas_GSASII_version', 4168 str(GSASIIpath.GetVersionNumber())) 4159 4169 WriteAudit() 4160 4170 WriteCIFitem(self.fp, '_pd_block_id', … … 4378 4388 dlg.Update(step,"Exporting overall section") 4379 4389 WriteCIFitem(self.fp, '\ndata_'+self.CIFname+'_publ') 4390 WriteCIFitem(self.fp, '_gsas_GSASII_version', 4391 str(GSASIIpath.GetVersionNumber())) 4380 4392 WriteAudit() 4381 4393 WriteCIFitem(self.fp, '_pd_block_id',
Note: See TracChangeset
for help on using the changeset viewer.