Skip to content

Commit a5fe752

Browse files
committed
misc fixes related to running self-tests; docs updates
1 parent adb29df commit a5fe752

File tree

6 files changed

+34
-21
lines changed

6 files changed

+34
-21
lines changed

GSASII/GSASII.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
pkginfo = importlib.util.find_spec('GSASII.GSASIIGUI')
1212
except ModuleNotFoundError:
1313
pkginfo = None
14-
15-
if pkginfo is None: # fixup path if GSASII not installed into Python
16-
os.environ["GSASII_YOLO_PATH"] = "True"
17-
sys.path.insert(0,os.path.dirname(os.path.dirname(__file__)))
18-
19-
from GSASII.GSASIIGUI import main
2014

2115
if __name__ == '__main__':
16+
if pkginfo is None: # fixup path if GSASII not installed into Python
17+
os.environ["GSASII_YOLO_PATH"] = "True"
18+
sys.path.insert(0,os.path.dirname(os.path.dirname(__file__)))
19+
from GSASII.GSASIIGUI import main
2220
if pkginfo is None: # fixup path if GSASII not installed into Python
2321
print('GSAS-II not installed in Python: Hacking sys.path')
2422
main()

GSASII/GSASIIphsGUI.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,7 +3294,9 @@ def _selectSuperGroups(rowdict,csdict,msg,depth=0,key=0):
32943294
mainSizer = wx.BoxSizer(wx.VERTICAL)
32953295
dlg.SetSizer(mainSizer)
32963296
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
3297-
SUBGROUPS.BilbaoSymSearchCite))
3297+
f'''Using the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
3298+
program; Please cite:
3299+
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}'''))
32983300
mainSizer.Add((-1,5))
32993301
G2G.HorizontalLine(mainSizer,dlg)
33003302
txt = wx.StaticText(dlg,wx.ID_ANY,
@@ -3367,7 +3369,9 @@ def _selectHiSymCell(rowdict,csdict):
33673369
mainSizer = wx.BoxSizer(wx.VERTICAL)
33683370
dlg.SetSizer(mainSizer)
33693371
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
3370-
SUBGROUPS.BilbaoSymSearchCite))
3372+
f'''Using the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
3373+
program; Please cite:
3374+
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}'''))
33713375
mainSizer.Add((-1,5))
33723376
G2G.HorizontalLine(mainSizer,dlg)
33733377
showSizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -3470,7 +3474,10 @@ def _showWebPage(event):
34703474
style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
34713475
mainSizer = wx.BoxSizer(wx.VERTICAL)
34723476
dlg.SetSizer(mainSizer)
3473-
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,SUBGROUPS.BilbaoSymSearchCite))
3477+
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
3478+
f'''Using the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
3479+
program; Please cite:
3480+
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}'''))
34743481
if msg:
34753482
txt = wx.StaticText(dlg,wx.ID_ANY,'Starting from '+msg.replace('\n',' '))
34763483
txt.Wrap(width)
@@ -3563,7 +3570,9 @@ def _showSummary(G2frame,msgs,gpxList):
35633570
mainSizer = wx.BoxSizer(wx.VERTICAL)
35643571
dlg.SetSizer(mainSizer)
35653572
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
3566-
SUBGROUPS.BilbaoSymSearchCite))
3573+
f'''Using the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
3574+
program; Please cite:
3575+
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}'''))
35673576
mainSizer.Add((-1,10))
35683577
mainSizer.Add(wx.StaticText(dlg,wx.ID_ANY,
35693578
f'From the starting model, {len(gpxList)} possible supergroups were located.'))

GSASII/SUBGROUPS.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,6 @@ def applySym(xform,cell):
465465
))
466466
return cellsList
467467

468-
BilbaoSymSearchCite = f'''Using the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
469-
program; Please cite:
470-
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}'''
471-
472468
def BilbaoSymSearch1(sgnum, phase, maxdelta=2, angtol=None,
473469
pagelist=None, keepCell=False):
474470
'''Perform a search for a supergroup consistent with a phase
@@ -509,7 +505,9 @@ def BilbaoSymSearch1(sgnum, phase, maxdelta=2, angtol=None,
509505
contain possible supergroup settings.
510506
'''
511507

512-
print('\n'+BilbaoSymSearchCite+'\n')
508+
print(f'''\nUsing the Bilbao Crystallographic Server Pseudosymmetry search (PSEUDO)
509+
program; Please cite:
510+
{G2G.GetCite('Bilbao: PSEUDO',wrap=70,indent=5)}\n''')
513511

514512
postdict = {
515513
"formulae":'',

docs/ReadTheDocs_build.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/source/packages.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@ Python extension packages are required:
174174
* matplotlib (http://matplotlib.org/contents.html) and
175175
* PyOpenGL (http://pyopengl.sourceforge.net/documentation).
176176

177-
GSAS-II will not start if the above packages are not available. In
178-
addition, several Python packages are referenced in sections of the
179-
GUI code, but are not required. If these packages are not present, warning
177+
GSAS-II will not start or will start but will not be able to do much
178+
if the above packages are not available.
179+
180+
In addition to the previous required packages, several Python packages
181+
are utilized in limited sections of the GUI code, but are not
182+
required. If these packages are not present, warning
180183
messages may be generated if they would be needed, or menu items may
181184
be omitted, but the vast bulk of GSAS-II will function normally. These
182185
optional packages are:

tests/test_scripting.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010

1111
skip = False
1212
import importlib.util # fixup path if GSASII not installed into Python
13-
if importlib.util.find_spec('GSASII.GSASIIscriptable') is None:
13+
G2loc = None
14+
try:
15+
G2loc = importlib.util.find_spec('GSASII.GSASIIscriptable')
16+
except ModuleNotFoundError:
17+
print('ModuleNotFound for GSASII.GSASIIscriptable')
18+
19+
if G2loc is None:
1420
print('GSAS-II not installed in Python: Hacking sys.path')
1521
os.environ["GSASII_YOLO_PATH"] = "True"
1622
sys.path.append(os.path.dirname(home))
@@ -21,6 +27,7 @@
2127
print("unable to run inside testing suite?!")
2228
skip = True
2329

30+
import GSASII
2431
import GSASII.GSASIIscriptable as G2sc
2532

2633
def test_refine():

0 commit comments

Comments
 (0)