Changeset 3246
- Timestamp:
- Jan 28, 2018 8:56:19 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIIO.py
r3228 r3246 1420 1420 return True 1421 1421 elif len(self.Phases) == 1: 1422 self.phasenam = self.Phases.keys()1422 self.phasenam = list(self.Phases.keys()) 1423 1423 elif self.multiple: 1424 1424 choices = sorted(self.Phases.keys()) … … 1481 1481 return True 1482 1482 elif len(self.Histograms) == 1: 1483 self.histnam = self.Histograms.keys()1483 self.histnam = list(self.Histograms.keys()) 1484 1484 else: 1485 1485 choices = sorted(self.Histograms.keys()) … … 1604 1604 else: 1605 1605 varyList = list(varyList) 1606 # add symmetry-generated constraints 1607 rigidbodyDict = self.G2frame.GPXtree.GetItemPyData( 1608 G2gd.GetGPXtreeItemId(self.G2frame,self.G2frame.root,'Rigid bodies')) 1609 rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]}) 1610 rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,Print=False) 1611 Natoms,atomIndx,phaseVary,phaseDict,pawleyLookup,FFtables,BLtables,MFtables,maxSSwave = G2stIO.GetPhaseData( 1612 Phases,RestraintDict=None,rbIds=rbIds,Print=False) # generates atom symmetry constraints 1606 1613 try: 1607 1614 groups,parmlist = G2mv.GroupConstraints(constDict) 1608 1615 G2mv.GenerateConstraints(groups,parmlist,varyList,constDict,fixedList,self.parmDict) 1616 #print(G2mv.VarRemapShow(varyList)) 1609 1617 except: 1610 1618 # this really should not happen … … 2660 2668 l[-1] += j 2661 2669 t += n + l + ['','Unused columns:'] 2662 usedCols = l bldict.keys()2670 usedCols = list(lbldict.keys()) 2663 2671 for i in keyCols.values(): usedCols += i 2664 2672 for i in range(len(items)): -
trunk/GSASIIdataGUI.py
r3245 r3246 24 24 import sys 25 25 import os 26 import glob27 import imp26 #import glob 27 #import imp 28 28 import inspect 29 29 if '2' in platform.python_version_tuple()[0]: … … 6675 6675 # sort out the variables in their selected order 6676 6676 varcols = 0 6677 for d in posdict. itervalues():6677 for d in posdict.values(): 6678 6678 varcols = max(varcols,max(d.keys())+1) 6679 6679 # get labels for each column … … 6756 6756 6757 6757 # add atom parameters to table 6758 colLabels += list(atomLookup.keys())6758 colLabels += sorted(atomLookup.keys()) 6759 6759 for parm in sorted(atomLookup): 6760 6760 G2frame.colList += [[data[name]['newAtomDict'][atomLookup[parm]][1] for name in histNames]] … … 6830 6830 # Also dicts of variables 6831 6831 # for Parametric fitting from the data table 6832 parmDict = dict(zip(colLabels, zip(*G2frame.colList)[0])) # scratch dict w/all values in table6832 parmDict = dict(zip(colLabels,list(zip(*G2frame.colList))[0])) # scratch dict w/all values in table 6833 6833 parmDict.update({var:val for var,val in newCellDict.values()}) # add varied reciprocal cell terms 6834 6834 del parmDict['Use'] -
trunk/GSASIIpath.py
r3179 r3246 630 630 ''' 631 631 from IPython.core import ultratb 632 # IPyBreak_base() # need fix below for Python3 632 633 if 'win' in sys.platform: 633 634 ultratb.FormattedTB(call_pdb=False,color_scheme='NoColor')(*args) -
trunk/exports/G2export_CIF.py
r3216 r3246 56 56 import GSASIIspc as G2spc 57 57 import GSASIIstrMain as G2stMn 58 import GSASIImapvars as G2mv 58 59 59 60 DEBUG = False #True to skip printing of reflection/powder profile lists … … 166 167 val = parmDict.get(var,at[j]) 167 168 sig = sigDict.get(dvar,sigdig) 169 if dvar in G2mv.GetDependentVars(): # do not include an esd for dependent vars 170 sig = -abs(sig) 168 171 s += PutInCol(G2mth.ValEsd(val,sig),dig) 169 172 s += PutInCol(at[cs+1],3) -
trunk/makeTutorial.py
r3236 r3246 19 19 from __future__ import print_function 20 20 import os 21 import GSASIIpath 21 22 22 i mport GSASIIpath23 GSASIIpath.SetBinaryPath()24 import GSASIIctrlGUI as G2G25 G2BaseURL = G2G.G2BaseURL26 tutorialIndex = G2G.tutorialIndex27 tutURL = G2BaseURL +'/Tutorials'28 outname = os.path.join(GSASIIpath.path2GSAS2,'help','Tutorials.html')23 if __name__ == '__main__': 24 GSASIIpath.SetBinaryPath() 25 import GSASIIctrlGUI as G2G 26 G2BaseURL = G2G.G2BaseURL 27 tutorialIndex = G2G.tutorialIndex 28 tutURL = G2BaseURL +'/Tutorials' 29 outname = os.path.join(GSASIIpath.path2GSAS2,'help','Tutorials.html') 29 30 30 dirList = [l[0] for l in tutorialIndex if len(l) == 3]31 dirList = [l[0] for l in tutorialIndex if len(l) == 3] 31 32 32 # loop through directories in Tutorials repository33 dirs = [d[:-1] for d in GSASIIpath.svnList(tutURL,False).split('\n') if d and d[-1] == '/']34 for d in dirs:35 if d not in dirList: print(u"makeTutorial: Listed tutorial is missing: "+d)33 # loop through directories in Tutorials repository 34 dirs = [d[:-1] for d in GSASIIpath.svnList(tutURL,False).split('\n') if d and d[-1] == '/'] 35 for d in dirs: 36 if d not in dirList: print(u"makeTutorial: Listed tutorial is missing: "+d) 36 37 37 #import sys38 #out = sys.stdout39 out = open(outname,'w')40 print('<!-- Do not edit this file. It is created by makeTutorial.py from info in GSASIIctrlGUI.py --!>',file=out)41 print('<h2>List of GSAS-II tutorials</H2><UL>',file=out)42 print('''43 <p> A list of available tutorials appears below. Each tutorial is a44 web page that can be opened using the link below, but most tutorials also need45 to have example data files downloaded. This can also be done with links included below,46 but it can be easier to access tutorials using47 <b>Help/Tutorials</b> menu item.48 When this menu entry is used from inside GSAS-II (unless "browse tutorial on web" is selected),49 the data files are downloaded to a local directory and GSAS-II will start from that directory50 for most file open commands.51 </p>''',file=out)38 #import sys 39 #out = sys.stdout 40 out = open(outname,'w') 41 print('<!-- Do not edit this file. It is created by makeTutorial.py from info in GSASIIctrlGUI.py --!>',file=out) 42 print('<h2>List of GSAS-II tutorials</H2><UL>',file=out) 43 print(''' 44 <p> A list of available tutorials appears below. Each tutorial is a 45 web page that can be opened using the link below, but most tutorials also need 46 to have example data files downloaded. This can also be done with links included below, 47 but it can be easier to access tutorials using 48 <b>Help/Tutorials</b> menu item. 49 When this menu entry is used from inside GSAS-II (unless "browse tutorial on web" is selected), 50 the data files are downloaded to a local directory and GSAS-II will start from that directory 51 for most file open commands. 52 </p>''',file=out) 52 53 53 for l in tutorialIndex: 54 if len(l) == 1: 55 print("</UL><h4>{}</H4><UL>".format(l[0]),file=out) 56 else: 57 pageURL = tutURL+'/'+l[0]+'/'+l[1] 58 dataURL = tutURL+'/'+l[0]+'/data' 59 suffix = '' 60 if l[2][0] == ' ': 61 suffix = ' <A href="#prereq">*</A>' 62 if suffix: 63 print('<UL><LI><A href="{}">{}</A>{}'.format(pageURL,l[2].strip(),suffix),file=out) 54 for l in tutorialIndex: 55 if len(l) == 1: 56 print("</UL><h4>{}</H4><UL>".format(l[0]),file=out) 64 57 else: 65 p rint('<LI><A href="{}">{}</A>'.format(pageURL,l[2].strip()),file=out)66 67 if GSASIIpath.svnList(dataURL,False):68 print(' [link: <A href="{}">Exercise files</A>].'.format(dataURL),file=out)69 else:70 print(' [No exercise files].',file=out)71 if suffix: print('</UL>',file=out)72 # if l[2][0] == ' ':73 # print(' (Note that this tutorial requires previous as prerequisite)',file=out)58 pageURL = tutURL+'/'+l[0]+'/'+l[1] 59 dataURL = tutURL+'/'+l[0]+'/data' 60 suffix = '' 61 if l[2][0] == ' ': 62 suffix = ' <A href="#prereq">*</A>' 63 if suffix: 64 print('<UL><LI><A href="{}">{}</A>{}'.format(pageURL,l[2].strip(),suffix),file=out) 65 else: 66 print('<LI><A href="{}">{}</A>'.format(pageURL,l[2].strip()),file=out) 74 67 75 print('</UL>\n<A name=prereq>* Indented tutorials require the previous unindented tutorial as a prerequisite',file=out) 76 out.close() 68 if GSASIIpath.svnList(dataURL,False): 69 print(' [link: <A href="{}">Exercise files</A>].'.format(dataURL),file=out) 70 else: 71 print(' [No exercise files].',file=out) 72 if suffix: print('</UL>',file=out) 73 # if l[2][0] == ' ': 74 # print(' (Note that this tutorial requires previous as prerequisite)',file=out) 75 76 print('</UL>\n<A name=prereq>* Indented tutorials require the previous unindented tutorial as a prerequisite',file=out) 77 out.close()
Note: See TracChangeset
for help on using the changeset viewer.