Skip to content

Commit eba65ab

Browse files
committed
fix several issues with diaglog and so on
1 parent a7fd4ff commit eba65ab

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

GSASII/GSASIIpwdGUI.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5196,6 +5196,12 @@ def showWebtext(txt):
51965196
break
51975197

51985198
if kpoint is None:
5199+
wx.MessageBox(
5200+
"Please select a k-vector from the table.",
5201+
style=wx.ICON_INFORMATION,
5202+
caption='Isotropic Subgroup Generation'
5203+
)
5204+
51995205
return
52005206

52015207
#isoscript='isocifform.php'
@@ -5206,16 +5212,24 @@ def showWebtext(txt):
52065212
Exploring Structural Distortions." J. Appl. Cryst.
52075213
39, 607-614 (2006).
52085214
'''
5209-
info_str = "CIF files of the isotropic subgroups associated with the "
5210-
info_str += "selected k-vector will be created.\n"
5211-
info_str += "Generated CIF files will be saved in the same directory "
5212-
info_str += "as the current project file."
5215+
info_str = '''CIF files of the isotropic subgroups associated with the
5216+
selected k-vector will be created.
5217+
Generated CIF files will be saved in the same directory as the
5218+
current project file.
5219+
This can take up to a few minutes. Check the terminal for progress.
5220+
'''
52135221
wx.MessageBox(
52145222
f"{isoCite}\n\n{info_str}",
52155223
style=wx.ICON_INFORMATION,
52165224
caption='Isotropic Subgroup Generation'
52175225
)
52185226

5227+
wx.GetApp().Yield()
5228+
5229+
info_msg = "Processing IRREPs for the selected k-vector. "
5230+
info_msg += "This can take up to a few minutes."
5231+
print(info_msg)
5232+
52195233
phaseID = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Phases')
52205234
phase_nam = G2frame.kvecSearch['phase']
52215235
Phase = G2frame.GPXtree.GetItemPyData(
@@ -5427,8 +5441,6 @@ def match_vector_pattern(k_vec, k_vec_dict):
54275441

54285442
data['input'] = 'kvector'
54295443
data['irrepcount'] = '1'
5430-
# data['kvec1'] = '10 *P, k10 (1/3,1/3,g)'
5431-
# data['kparam31'] = '1/3'
54325444

54335445
data_update = setup_kvec_input(kpoint_frac)
54345446
for key, value in data_update.items():
@@ -5466,6 +5478,7 @@ def _get_opt_val(opt_name, out):
54665478
)
54675479

54685480
for ir_opt, _ in ir_options:
5481+
print("Processing irrep:", ir_opt)
54695482
data["input"] = "irrep"
54705483
data['irrep1'] = ir_opt
54715484
out4 = requests.post(isoformsite, data=data).text
@@ -5484,6 +5497,7 @@ def _get_opt_val(opt_name, out):
54845497
data["isofilename"] = iso_fn
54855498

54865499
for radio_val in cleaned_radio_vals:
5500+
print("Processing mode:", radio_val)
54875501
data["input"] = "distort"
54885502
data["origintype"] = "method2"
54895503
data["orderparam"] = radio_val + '" CHECKED'
@@ -5494,6 +5508,7 @@ def _get_opt_val(opt_name, out):
54945508
cif_fn_part2_tmp = radio_val.split(")")[1].split(",")[0]
54955509
cif_fn_part2 = cif_fn_part2_tmp.split()[-1]
54965510
cif_fn = f"{phase_nam}_{cif_fn_part1}_{cif_fn_part2}.cif"
5511+
cif_fn = os.path.join(os.getcwd(), cif_fn)
54975512
with open(cif_fn, 'wb') as fl:
54985513
fl.write(out_cif.encode("utf-8"))
54995514

@@ -5502,6 +5517,16 @@ def _get_opt_val(opt_name, out):
55025517
# TODO: replacing the phase with the new CIF
55035518
# TODO: 3. Save the project files
55045519

5520+
info_msg = f'''Done with subgroup output for the selected k-vector.
5521+
Please check output files in the following directory,
5522+
{os.getcwd()}
5523+
'''
5524+
wx.MessageBox(
5525+
info_msg,
5526+
style=wx.ICON_INFORMATION,
5527+
caption='Isotropic Subgroup Generation'
5528+
)
5529+
55055530
try:
55065531
os.unlink(tmp.name)
55075532
except PermissionError:

0 commit comments

Comments
 (0)