Changeset 65


Ignore:
Timestamp:
May 14, 2010 4:26:05 PM (12 years ago)
Author:
vondreel
Message:

remove all path setup code & replace with a simple import of GSASIIpath.

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r63 r65  
    1111import matplotlib as mpl
    1212
     13## determine a binary path for the pyd files based on the host OS and the python version, 
     14## path is relative to location of this file
     15#if sys.platform == "win32":
     16#    bindir = 'binwin%d.%d' % sys.version_info[0:2]
     17#elif sys.platform == "darwin":
     18#    bindir = 'binmac%d.%d' % sys.version_info[0:2]
     19#else:
     20#    bindir = 'bin'
     21#if ospath.exists(ospath.join(sys.path[0],bindir)) and ospath.join(sys.path[0],bindir) not in sys.path:
     22#    sys.path.insert(0,ospath.join(sys.path[0],bindir))
     23
     24#try:
     25#    import pypowder as pyp
     26#except:
     27#    # create an app to display the error, since we are still loading routines at this point
     28#    app = wx.App()
     29#    app.MainLoop()
     30#    msg = wx.MessageDialog(None, message="Unable to load the GSAS powder computation module, pypowder",
     31#        caption="Import Error",style=wx.ICON_ERROR | wx.OK | wx.STAY_ON_TOP)
     32#    msg.ShowModal()
     33#    # this error is non-recoverable, so just quit
     34#    exit()
     35   
    1336# load the GSAS routines
     37import GSASIIpath
    1438import GSASIIIO as G2IO
    1539import GSASIIcomp as G2cmp
  • trunk/GSASIIIO.py

    r63 r65  
    88import cPickle
    99import sys
     10import GSASIIpath
    1011import GSASIIgrid as G2gd
    11 # needed for MAR345
    1212import os.path as ospath
    13 # determine a binary path passed on the host OS and the python version, path is relative to
    14 # location of this file
    15 if sys.platform == "win32":
    16     bindir = 'binwin%d.%d' % sys.version_info[0:2]
    17 elif sys.platform == "darwin":
    18     bindir = 'binmac%d.%d' % sys.version_info[0:2]
    19 else:
    20     bindir = 'bin'
    21 if ospath.exists(ospath.join(sys.path[0],bindir)) and ospath.join(sys.path[0],bindir) not in sys.path:
    22     sys.path.insert(0,ospath.join(sys.path[0],bindir))
    2313
    2414def sfloat(S):
  • trunk/GSASIIcomp.py

    r64 r65  
    77import numpy.linalg as nl
    88import os.path as ospath
    9 # determine a binary path pased on the host OS and the python version, path is relative to
    10 # location of this file
    11 if sys.platform == "win32":
    12     bindir = 'binwin%d.%d' % sys.version_info[0:2]
    13 elif sys.platform == "darwin":
    14     bindir = 'binmac%d.%d' % sys.version_info[0:2]
    15 else:
    16     bindir = 'bin'
    17 
    18 if ospath.exists(ospath.join(sys.path[0],bindir)) and ospath.join(sys.path[0],bindir) not in sys.path:
    19     sys.path.insert(0,ospath.join(sys.path[0],bindir))
    20 
    21 try:
    22     import pypowder as pyp
    23 except:
    24     # create an app to display the error, since we are still loading routines at this point
    25     app = wx.App()
    26     app.MainLoop()
    27     msg = wx.MessageDialog(None, message="Unable to load the GSAS powder computation module, pypowder",
    28         caption="Import Error",style=wx.ICON_ERROR | wx.OK | wx.STAY_ON_TOP)
    29     msg.ShowModal()
    30     # this error is non-recoverable, so just quit
    31     exit()
     9import GSASIIpath
     10import pypowder as pyp              #assumes path has been amended to include correctr bin directory
    3211import GSASIIplot as G2plt
    3312
  • trunk/GSASIIgrid.py

    r64 r65  
    66import time
    77import cPickle
     8import GSASIIpath
    89import GSASIIcomp as G2cmp
    910import GSASIIspc as G2spc
  • trunk/GSASIIplot.py

    r64 r65  
    66import wx.aui
    77import matplotlib as mpl
     8import GSASIIpath
    89import GSASIIgrid as G2gd
    910import GSASIIcomp as G2cmp
  • trunk/GSASIIspc.py

    r57 r65  
    11"GSASII - Space group interpretion routines"
    2 
    32
    43import numpy as np
     
    65import os.path as ospath
    76
    8 # determine a binary path based on the host OS and the python version, path
    9 # is relative to the location of this file
    10 if sys.platform == "win32":
    11     bindir = 'binwin%d.%d' % sys.version_info[0:2]
    12 elif sys.platform == "darwin":
    13     bindir = 'binmac%d.%d' % sys.version_info[0:2]
    14     if sys.byteorder == 'big':
    15         bindir += 'PPC'
    16 elif sys.platform == "linux2":
    17     bindir = 'binlinux%d.%d' % sys.version_info[0:2]
    18 else:
    19     bindir = 'bin'
    20 mypath = ospath.split(ospath.abspath( __file__ ))[0]
    21 bindir = ospath.join(mypath,bindir)
    22 if ospath.exists(bindir):
    23     if bindir not in sys.path: sys.path.insert(0,bindir)
    24 else:
    25     print 'Expected binary directory (%s) for pyspg not found' % bindir
    26 # use local bin directory preferentially
    27 bindir = ospath.join(mypath,'bin')
    28 if ospath.exists(bindir):
    29     if bindir not in sys.path: sys.path.insert(0,bindir)
    30 
    31 import pyspg as pyd
     7import GSASIIpath
     8import pyspg
    329
    3310def SpcGroup(SGSymbol):
     
    5431    SGData = {}
    5532    SGData['SpGrp'] = SGSymbol.strip().lower().capitalize()
    56     SGInfo = pyd.sgforpy(SGSymbol)
     33    SGInfo = pyspg.sgforpy(SGSymbol)
    5734    SGData['SGLaue'] = LaueSym[SGInfo[0]-1]
    5835    SGData['SGInv'] = bool(SGInfo[1])
Note: See TracChangeset for help on using the changeset viewer.