Skip to content

Commit eb08eee

Browse files
committed
add seekpath to optional & default modules; add k-vector self-test
1 parent 965197d commit eb08eee

File tree

5 files changed

+827
-97
lines changed

5 files changed

+827
-97
lines changed

GSASII/GSASIIpwdGUI.py

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5428,40 +5428,14 @@ def OnKvecSearch(event):
54285428
import seekpath
54295429
seekpath
54305430
except:
5431-
msg = 'Performing a k-vector search requires installation of the Python seekpath package. Press Yes to install this. \n\nGSAS-II will restart after the installation.'
5432-
dlg = wx.MessageDialog(G2frame, msg,'Install package?',wx.YES_NO|wx.ICON_QUESTION)
5433-
result = wx.ID_NO
5431+
G2fil.NeededPackage({'magnetic k-vector search':['seekpath']})
5432+
msg = 'Performing a k-vector search requires installation of the Python seekpath package. Use the Help/Add Package... to install that package.'
5433+
dlg = wx.MessageDialog(G2frame, msg,'Install seekpath package')
54345434
try:
5435-
result = dlg.ShowModal()
5435+
dlg.ShowModal()
54365436
finally:
54375437
dlg.Destroy()
5438-
wx.GetApp().Yield()
5439-
if result != wx.ID_YES: return
5440-
wx.BeginBusyCursor()
5441-
try: # can we install via conda?
5442-
import conda.cli.python_api
5443-
conda.cli.python_api
5444-
print('Starting conda install of seekpath...')
5445-
GSASIIpath.condaInstall(['seekpath'])
5446-
print('conda install of seekpath completed')
5447-
except Exception as msg:
5448-
print(msg)
5449-
try:
5450-
print('Starting pip install of seekpath...')
5451-
GSASIIpath.pipInstall(['seekpath'])
5452-
print('pip install of seekpath completed')
5453-
except Exception as msg:
5454-
print('install of seekpath failed, sorry\n',msg)
5455-
return
5456-
finally:
5457-
wx.EndBusyCursor()
5458-
ans = G2frame.OnFileSave(None)
5459-
if not ans: return
5460-
project = os.path.abspath(G2frame.GSASprojectfile)
5461-
print(f"Restarting GSAS-II with project file {project!r}")
5462-
G2fil.openInNewTerm(project)
5463-
print ('exiting GSAS-II')
5464-
sys.exit()
5438+
return
54655439

54665440
# msg = G2G.NISTlatUse(True)
54675441
_, _, cells, _, _, _ = data

GSASII/k_vector_search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
import sys
3232
from scipy.optimize import linear_sum_assignment
3333
import math
34+
from . import GSASIIfiles as G2fil
3435
try:
3536
import seekpath
3637
from kvec_general import parallel_proc
3738
gen_option_avail = True
3839
except ModuleNotFoundError:
40+
G2fil.NeededPackage({'magnetic k-vector search':['seekpath']})
3941
gen_option_avail = False
4042
import time
4143

0 commit comments

Comments
 (0)