- Timestamp:
- Jul 4, 2017 9:37:13 AM (6 years ago)
- Location:
- branch/2frame
- Files:
-
- 17 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASII.py
r2899 r2900 18 18 import os 19 19 import sys 20 import GSASIIpath 21 GSASIIpath.SetVersionNumber("$Revision$") 22 GSASIIpath.InvokeDebugOpts() 20 23 21 24 __version__ = '0.3.0' 22 25 23 # PATCH: for Mavericks (OS X 10.9.x), wx produces an annoying warning about LucidaGrandeUI.24 # In case stderr has been suppressed there, redirect python error output to stdout. Nobody25 # else should care much about this.26 sys.stderr = sys.stdout27 26 28 #def create(parent):29 # return GSASII(parent)30 31 # class GSASIIsplit(wx.SplitterWindow):32 # def __init__(self,parent,ID):33 # wx.SplitterWindow.__init__(self, parent, ID,style = wx.SP_BORDER|wx.SP_LIVE_UPDATE)34 # self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSashChanged)35 # self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGING, self.OnSashChanging)36 37 # def OnSashChanged(self, evt):38 # evt.Skip()39 # # print "sash changed to %s\n" % str(evt.GetSashPosition())40 41 # def OnSashChanging(self, evt):42 # evt.Skip()43 # # print "sash changing to %s\n" % str(evt.GetSashPosition())44 45 27 if __name__ == '__main__': 46 import numpy as np 47 import scipy as sp 48 import wx 49 import wx.lib.scrolledpanel as wxscroll 50 try: # patch for LANG environment var problem on occasional OSX machines 51 import locale 52 locale.getdefaultlocale() 53 except ValueError: 54 print('Fixing location (see https://github.com/matplotlib/matplotlib/issues/5420.)') 55 os.environ['LC_ALL'] = 'en_US.UTF-8' 56 locale.getdefaultlocale() 57 import matplotlib as mpl 58 try: 59 import OpenGL as ogl 60 except ImportError: 61 print('*******************************************************') 62 print('PyOpenGL is missing from your python installation') 63 print(' - we will try to install it') 64 print('*******************************************************') 65 def install_with_easyinstall(package): 66 try: 67 print "trying a system-wide PyOpenGl install" 68 easy_install.main(['-f',os.path.split(__file__)[0],package]) 69 return 70 except: 71 pass 72 try: 73 print "trying a user level PyOpenGl install" 74 easy_install.main(['-f',os.path.split(__file__)[0],'--user',package]) 75 return 76 except: 77 print "Install of '+package+' failed. Please report this information:" 78 import traceback 79 print traceback.format_exc() 80 sys.exit() 81 from setuptools.command import easy_install 82 install_with_easyinstall('PyOpenGl') 83 print('*******************************************************') 84 print('OpenGL has been installed. Restarting GSAS-II') 85 print('*******************************************************') 86 loc = os.path.dirname(__file__) 87 import subprocess 88 subprocess.Popen([sys.executable,os.path.join(loc,'GSASII.py')]) 89 sys.exit() 90 91 # load the GSAS routines 92 import GSASIIpath 93 GSASIIpath.SetVersionNumber("$Revision$") 94 import GSASIIIO as G2IO 95 import GSASIIElem as G2elem 96 import GSASIIgrid as G2gd 97 import GSASIIctrls as G2G 98 import GSASIIplot as G2plt 99 import GSASIIpwd as G2pwd 100 import GSASIIpwdGUI as G2pdG 101 import GSASIIspc as G2spc 102 import GSASIIstrMain as G2stMn 103 import GSASIIstrIO as G2stIO 104 import GSASIImath as G2mth 105 import GSASIImapvars as G2mv 106 import GSASIIobj as G2obj 107 import GSASIIlattice as G2lat 108 import GSASIIlog as log 109 # GSASIIpath.IPyBreak() 110 # print versions 111 print "Python module versions loaded:" 112 print " Python: ",sys.version.split()[0] 113 print " wx: ",wx.__version__ 114 print " matplotlib: ",mpl.__version__ 115 print " numpy: ",np.__version__ 116 print " scipy: ",sp.__version__ 117 print " OpenGL: ",ogl.__version__ 118 try: 119 from PIL import Image 120 try: 121 from PIL import PILLOW_VERSION 122 version = PILLOW_VERSION 123 except: 124 version = Image.VERSION 125 print " PIL.Image: ",version 126 except ImportError: 127 try: 128 import Image 129 print "Image (PIL):",Image.VERSION 130 except ImportError: 131 print "Image module not present; Note that PIL (Python Imaging Library) or pillow is needed for some image operations" 132 import platform 133 print " Platform: ",sys.platform,platform.architecture()[0],platform.machine() 134 try: 135 import mkl 136 print " Max threads:",mkl.get_max_threads() 137 except: 138 pass 139 #print "wxPython description",wx.PlatformInfo 140 print "This is GSAS-II revision "+str(GSASIIpath.GetVersionNumber())+'\n' 141 GSASIIpath.InvokeDebugOpts() 28 import GSASIIdataGUI as G2gd 142 29 G2gd.GSASIImain() # start the GUI -
branch/2frame/GSASIIIO.py
r2871 r2900 18 18 Also includes base classes for data import routines. 19 19 20 This module needs some work to separate wx from non-wx routines 20 21 ''' 21 22 """GSASIIIO: functions for IO of data … … 32 33 import GSASIIpath 33 34 GSASIIpath.SetVersionNumber("$Revision$") 34 import GSASII gridas G2gd35 import GSASIIdataGUI as G2gd 35 36 import GSASIIobj as G2obj 36 37 import GSASIIlattice as G2lat … … 42 43 import GSASIIstrIO as G2stIO 43 44 import GSASIImapvars as G2mv 44 import GSASIIctrl sas G2G45 import GSASIIctrlGUI as G2G 45 46 import os 46 47 import os.path as ospath … … 956 957 selections are placed in self.chosen when OK is pressed 957 958 958 Also see GSASIIctrl s959 Also see GSASIIctrlGUI 959 960 ''' 960 961 def __init__(self,choicelist,headinglist, -
branch/2frame/GSASIIconstrGUI.py
r2893 r2900 31 31 import GSASIImath as G2mth 32 32 import GSASIIlattice as G2lat 33 import GSASII gridas G2gd34 import GSASIIctrl sas G2G33 import GSASIIdataGUI as G2gd 34 import GSASIIctrlGUI as G2G 35 35 import GSASIIplot as G2plt 36 36 import GSASIIobj as G2obj -
branch/2frame/GSASIIctrlGUI.py
r2899 r2900 1 1 # -*- coding: utf-8 -*- 2 #GSASIIctrl s- Custom GSAS-II GUI controls2 #GSASIIctrlGUI - Custom GSAS-II GUI controls 3 3 ########### SVN repository information ################### 4 4 # $Date$ … … 9 9 ########### SVN repository information ################### 10 10 ''' 11 *GSASIIctrl s: Custom GUI controls*12 ------------------------------------------- 11 *GSASIIctrlGUI: Custom GUI controls* 12 --------------------------------------------- 13 13 14 14 A library of GUI controls for reuse throughout GSAS-II 15 16 (at present many are still in GSASIIgrid, but with time will be moved here)17 15 18 16 ''' … … 32 30 import GSASIIpath 33 31 GSASIIpath.SetVersionNumber("$Revision$") 34 import GSASII gridas G2gd32 import GSASIIdataGUI as G2gd 35 33 import GSASIIpwdGUI as G2pdG 36 34 import GSASIIpy3 as G2py3 … … 2469 2467 :returns: the selection index or None or a selection list if multiple is true 2470 2468 2471 Called by GSASII grid.OnReOrgSelSeq() which is not fully implemented.2469 Called by GSASIIdataGUI.OnReOrgSelSeq() Which is not fully implemented. 2472 2470 ''' 2473 2471 if multiple: -
branch/2frame/GSASIIdataGUI.py
r2899 r2900 1 1 # -*- coding: utf-8 -*- 2 #GSASII grid - data displayroutines2 #GSASIIdataGUI - Main GUI routines 3 3 ########### SVN repository information ################### 4 4 # $Date$ … … 9 9 ########### SVN repository information ################### 10 10 ''' 11 *GSASIIgrid: Basic GUI routines* 12 -------------------------------- 13 11 *GSASIIdataGUI: Main GSAS-II GUI* 12 ------------------------------------ 13 14 Module that defines GUI routines and classes for the main GUI Frame (window) 15 and the main routines that define the GSAS-II tree panel and much of the 16 data editing panel. 14 17 ''' 15 18 import time … … 52 55 import GSASIIexprGUI as G2exG 53 56 import GSASIIlog as log 54 import GSASIIctrl sas G2G57 import GSASIIctrlGUI as G2G 55 58 56 59 # trig functions in degrees … … 155 158 Define_wxId('wxID_MCRON', 'wxID_MCRLIST', 'wxID_MCRSAVE', 'wxID_MCRPLAY',) 156 159 160 # these data definitions probably should be moved 157 161 commonTrans = {'abc':np.eye(3),'a-cb':np.array([[1.,0.,0.],[0.,0.,-1.],[0.,1.,0.]]), 158 162 'ba-c':np.array([[0.,1.,0.],[1.,0.,0.],[0.,0.,-1.]]),'-cba':np.array([[0.,0.,-1.],[0.,1.,0.],[1.,0.,0.]]), … … 329 333 parent.Raise() 330 334 self.EndModal(wx.ID_CANCEL) 335 336 # class GSASIIsplit(wx.SplitterWindow): 337 # def __init__(self,parent,ID): 338 # wx.SplitterWindow.__init__(self, parent, ID,style = wx.SP_BORDER|wx.SP_LIVE_UPDATE) 339 # self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSashChanged) 340 # self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGING, self.OnSashChanging) 341 342 # def OnSashChanged(self, evt): 343 # evt.Skip() 344 # # print "sash changed to %s\n" % str(evt.GetSashPosition()) 345 346 # def OnSashChanging(self, evt): 347 # evt.Skip() 348 # # print "sash changing to %s\n" % str(evt.GetSashPosition()) 349 350 def GUIpatches(): 351 'Misc fixes that only needs to be done when running a GUI' 352 try: # patch for LANG environment var problem on occasional OSX machines 353 import locale 354 locale.getdefaultlocale() 355 except ValueError: 356 print('Fixing location (see https://github.com/matplotlib/matplotlib/issues/5420.)') 357 os.environ['LC_ALL'] = 'en_US.UTF-8' 358 locale.getdefaultlocale() 359 try: 360 import OpenGL as ogl 361 except ImportError: 362 print('*******************************************************') 363 print('PyOpenGL is missing from your python installation') 364 print(' - we will try to install it') 365 print('*******************************************************') 366 def install_with_easyinstall(package): 367 try: 368 print "trying a system-wide PyOpenGl install" 369 easy_install.main(['-f',os.path.split(__file__)[0],package]) 370 return 371 except: 372 pass 373 try: 374 print "trying a user level PyOpenGl install" 375 easy_install.main(['-f',os.path.split(__file__)[0],'--user',package]) 376 return 377 except: 378 print "Install of '+package+' failed. Please report this information:" 379 import traceback 380 print traceback.format_exc() 381 sys.exit() 382 from setuptools.command import easy_install 383 install_with_easyinstall('PyOpenGl') 384 print('*******************************************************') 385 print('OpenGL has been installed. Restarting GSAS-II') 386 print('*******************************************************') 387 loc = os.path.dirname(__file__) 388 import subprocess 389 subprocess.Popen([sys.executable,os.path.join(loc,'GSASII.py')]) 390 sys.exit() 391 # PATCH: for Mavericks (OS X 10.9.x), wx produces an annoying warning about LucidaGrandeUI. 392 # In case stderr has been suppressed there, redirect python error output to stdout. Nobody 393 # else should care much about this. 394 sys.stderr = sys.stdout 395 396 def ShowVersions(): 397 '''Show the versions all of required Python packages, etc. 398 ''' 399 import numpy as np 400 import scipy as sp 401 import wx 402 #import wx.lib.scrolledpanel as wxscroll 403 import matplotlib as mpl 404 import OpenGL as ogl 405 # load the GSAS routines to update versions with GSASIIpath.SetVersionNumber 406 import GSASIIpath 407 import GSASIIIO as G2IO 408 import GSASIIElem as G2elem 409 import GSASIIctrlGUI as G2G 410 import GSASIIplot as G2plt 411 import GSASIIpwd as G2pwd 412 import GSASIIpwdGUI as G2pdG 413 import GSASIIspc as G2spc 414 import GSASIIstrMain as G2stMn 415 import GSASIIstrIO as G2stIO 416 import GSASIImath as G2mth 417 import GSASIImapvars as G2mv 418 import GSASIIobj as G2obj 419 import GSASIIlattice as G2lat 420 import GSASIIlog as log 421 # GSASIIpath.IPyBreak() 422 # print versions 423 print "Python module versions loaded:" 424 print " Python: ",sys.version.split()[0] 425 print " wx: ",wx.__version__ 426 print " matplotlib: ",mpl.__version__ 427 print " numpy: ",np.__version__ 428 print " scipy: ",sp.__version__ 429 print " OpenGL: ",ogl.__version__ 430 try: 431 from PIL import Image 432 try: 433 from PIL import PILLOW_VERSION 434 version = PILLOW_VERSION 435 except: 436 version = Image.VERSION 437 print " PIL.Image: ",version 438 except ImportError: 439 try: 440 import Image 441 print "Image (PIL):",Image.VERSION 442 except ImportError: 443 print "Image module not present; Note that PIL (Python Imaging Library) or pillow is needed for some image operations" 444 import platform 445 print " Platform: ",sys.platform,platform.architecture()[0],platform.machine() 446 try: 447 import mkl 448 print " Max threads:",mkl.get_max_threads() 449 except: 450 pass 451 #print "wxPython description",wx.PlatformInfo 452 print "This is GSAS-II revision "+str(GSASIIpath.GetVersionNumber())+'\n' 453 331 454 ############################################################################### 332 455 # Main application … … 334 457 def GSASIImain(): 335 458 '''Start up the GSAS-II application''' 459 ShowVersions() 460 GUIpatches() 461 #GSASIIpath.InvokeDebugOpts() 336 462 #application = GSASIImain() # don't redirect output, someday we 337 463 # may want to do this if we can -
branch/2frame/GSASIIddataGUI.py
r2892 r2900 23 23 import GSASIIspc as G2spc 24 24 import GSASIIplot as G2plt 25 import GSASII gridas G2gd25 import GSASIIdataGUI as G2gd 26 26 import GSASIIpwd as G2pwd 27 27 import GSASIIphsGUI as G2phsGUI 28 import GSASIIctrl sas G2G28 import GSASIIctrlGUI as G2G 29 29 import numpy as np 30 30 -
branch/2frame/GSASIIexprGUI.py
r2899 r2900 30 30 import GSASIIpath 31 31 GSASIIpath.SetVersionNumber("$Revision$") 32 import GSASII gridas G2gd33 import GSASIIctrl sas G2G32 import GSASIIdataGUI as G2gd 33 import GSASIIctrlGUI as G2G 34 34 import GSASIIpy3 as G2py3 35 35 import GSASIIobj as G2obj -
branch/2frame/GSASIIimgGUI.py
r2893 r2900 33 33 import GSASIIplot as G2plt 34 34 import GSASIIIO as G2IO 35 import GSASII gridas G2gd36 import GSASIIctrl sas G2G35 import GSASIIdataGUI as G2gd 36 import GSASIIctrlGUI as G2G 37 37 import GSASIIobj as G2obj 38 38 import GSASIIpy3 as G2py3 -
branch/2frame/GSASIIlog.py
r2509 r2900 16 16 ''' 17 17 import wx 18 import GSASII gridas G2gd18 import GSASIIdataGUI as G2gd 19 19 import GSASIIpath 20 20 # Global variables -
branch/2frame/GSASIIphsGUI.py
r2899 r2900 39 39 import GSASIIddataGUI as G2ddG 40 40 import GSASIIplot as G2plt 41 import GSASII gridas G2gd41 import GSASIIdataGUI as G2gd 42 42 import GSASIIIO as G2IO 43 43 import GSASIIstrMain as G2stMn … … 47 47 import GSASIIpy3 as G2py3 48 48 import GSASIIobj as G2obj 49 import GSASIIctrl sas G2G49 import GSASIIctrlGUI as G2G 50 50 import GSASIIconstrGUI as G2cnstG 51 51 import numpy as np … … 1065 1065 '''Create the data display window contents when a phase is clicked on 1066 1066 in the main (data tree) window. 1067 Called only from :meth:`GSASII grid.SelectDataTreeItem`,1067 Called only from :meth:`GSASIIdataGUI.SelectDataTreeItem`, 1068 1068 which in turn is called from :meth:`GSASII.GSASII.OnDataTreeSelChanged` 1069 1069 when a Phase tree item is selected. This creates all tabs on the page and fills -
branch/2frame/GSASIIplot.py
r2895 r2900 27 27 Clip_on = GSASIIpath.GetConfigValue('Clip_on') 28 28 GSASIIpath.SetVersionNumber("$Revision$") 29 import GSASII gridas G2gd29 import GSASIIdataGUI as G2gd 30 30 import GSASIIimage as G2img 31 31 import GSASIIpwd as G2pwd … … 37 37 import GSASIIspc as G2spc 38 38 import GSASIImath as G2mth 39 import GSASIIctrls as G2G 39 import GSASIIctrlGUI as G2G 40 import GSASIIobj as G2obj 40 41 import pytexture as ptx 41 42 #from OpenGL.GL import * … … 3953 3954 xvar = np.outer(sig,np.ones_like(sig)) 3954 3955 covArray = np.divide(np.divide(covMatrix,xvar),xvar.T) 3955 title = ' for\n'+Data['title']3956 title = G2obj.StripUnicode(' for\n'+Data['title'],'') # matplotlib 1.x does not like unicode 3956 3957 newAtomDict = Data.get('newAtomDict',{}) 3957 3958 G2frame.G2plotNB.status.DestroyChildren() -
branch/2frame/GSASIIpwdGUI.py
r2893 r2900 37 37 import GSASIIindex as G2indx 38 38 import GSASIIplot as G2plt 39 import GSASII gridas G2gd40 import GSASIIctrl sas G2G39 import GSASIIdataGUI as G2gd 40 import GSASIIctrlGUI as G2G 41 41 import GSASIIElemGUI as G2elemGUI 42 42 import GSASIIElem as G2elem -
branch/2frame/GSASIIrestrGUI.py
r2893 r2900 25 25 import GSASIIlattice as G2lat 26 26 import GSASIIspc as G2spc 27 import GSASII gridas G2gd27 import GSASIIdataGUI as G2gd 28 28 import GSASIIplot as G2plt 29 29 import GSASIIdata as G2data 30 import GSASIIctrl sas G2G30 import GSASIIctrlGUI as G2G 31 31 32 32 VERY_LIGHT_GREY = wx.Colour(235,235,235) -
branch/2frame/GSASIIstrMain.py
r2899 r2900 468 468 469 469 :param dict DisAglCtls: contains distance/angle radii usually defined using 470 :func:`GSASIIctrl s.DisAglDialog`470 :func:`GSASIIctrlGUI.DisAglDialog` 471 471 :param dict DisAglData: contains phase data: 472 472 Items 'OrigAtoms' and 'TargAtoms' contain the atoms to be used … … 585 585 586 586 :param dict DisAglCtls: contains distance/angle radii usually defined using 587 :func:`GSASIIctrl s.DisAglDialog`587 :func:`GSASIIctrlGUI.DisAglDialog` 588 588 :param dict DisAglData: contains phase data: 589 589 Items 'OrigAtoms' and 'TargAtoms' contain the atoms to be used -
branch/2frame/exports/G2export_CIF.py
r2899 r2900 33 33 GSASIIpath.SetVersionNumber("$Revision$") 34 34 import GSASIIIO as G2IO 35 import GSASII gridas G2gd36 import GSASIIctrl sas G2G35 import GSASIIdataGUI as G2gd 36 import GSASIIctrlGUI as G2G 37 37 import GSASIImath as G2mth 38 38 import GSASIIspc as G2spc -
branch/2frame/exports/G2export_PDB.py
r2819 r2900 21 21 GSASIIpath.SetVersionNumber("$Revision$") 22 22 import GSASIIIO as G2IO 23 #import GSASIIgrid as G2gd24 23 import GSASIIstrIO as G2stIO 25 24 #import GSASIImath as G2mth -
branch/2frame/exports/G2export_examples.py
r2819 r2900 26 26 import GSASIIIO as G2IO 27 27 import GSASIIpy3 as G2py3 28 #import GSASIIgrid as G2gd29 28 #import GSASIIstrIO as G2stIO 30 29 import GSASIImath as G2mth -
branch/2frame/exports/G2export_map.py
r2819 r2900 23 23 GSASIIpath.SetVersionNumber("$Revision$") 24 24 import GSASIIIO as G2IO 25 #import GSASIIgrid as G2gd26 25 #import GSASIIstrIO as G2stIO 27 26 #import GSASIImath as G2mth -
branch/2frame/testSSymbols.py
r2895 r2900 3 3 import wx 4 4 import GSASIIspc as G2spc 5 import GSASII gridas G2gd6 import GSASIIctrl sas G2G5 import GSASIIdataGUI as G2gd 6 import GSASIIctrlGUI as G2G 7 7 import numpy as np 8 8 import copy
Note: See TracChangeset
for help on using the changeset viewer.