Skip to content

Commit abd9a56

Browse files
committed
warn about current Bilbao access problems
1 parent 34cb5ac commit abd9a56

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

GSASII/GSASIIphsGUI.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3628,6 +3628,11 @@ def fmtCell(cell):
36283628
# need to convert non-standard space group settings
36293629
print('*** Checking space group setting')
36303630
sgnum,sgsym,xmat,xoff = SUBGROUPS.GetStdSGset(data['General']['SGData'])
3631+
if sgnum is None:
3632+
G2G.G2MessageBox(G2frame,
3633+
'Standard setting check failed. Check console output.',
3634+
'Bilbao error')
3635+
return
36313636
newPhase = copy.deepcopy(data)
36323637
try:
36333638
if np.allclose(np.eye(3),xmat) and np.allclose(xoff,np.zeros_like(xoff)):
@@ -3866,7 +3871,9 @@ def OnSubSearch(event):
38663871
SubGroups,baseList = kSUB.GetNonStdSubgroups(SGData,kvec[:9],star,Landau)
38673872
wx.EndBusyCursor()
38683873
if SubGroups is None:
3869-
wx.MessageBox('Check your internet connection?',caption='Bilbao SUBGROUPS error',style=wx.ICON_EXCLAMATION)
3874+
wx.MessageBox('Internet connection problem? Check console output.',
3875+
caption='Bilbao SUBGROUPS error',
3876+
style=wx.ICON_EXCLAMATION)
38703877
return
38713878
if not SubGroups:
38723879
if Landau:
@@ -3919,6 +3926,11 @@ def OnTransform2Std(event):
39193926
generalData = data['General']
39203927
cx,ct,cs,cia = generalData['AtomPtrs']
39213928
sgnum,sgsym,xmat,xoff = SUBGROUPS.GetStdSGset(generalData['SGData'])
3929+
if sgnum is None:
3930+
G2G.G2MessageBox(G2frame,
3931+
'Standard setting check failed. Check console output.',
3932+
'Bilbao error')
3933+
return
39223934
if xmat is None:
39233935
G2G.G2MessageBox(G2frame,"Unable to reach web site.",'No connection')
39243936
return

GSASII/GSASIIpwdGUI.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5030,7 +5030,9 @@ def OnRunSubs(event):
50305030
SubGroups,baseList = kSUB.GetNonStdSubgroups(SGData,kvec[:9],star,Landau)
50315031
wx.EndBusyCursor()
50325032
if SubGroups is None:
5033-
wx.MessageBox('Check your internet connection?',caption='Bilbao SUBGROUPS error',style=wx.ICON_EXCLAMATION)
5033+
wx.MessageBox('Internet connection problem? Check console output.',
5034+
caption='Bilbao SUBGROUPS error',
5035+
style=wx.ICON_EXCLAMATION)
50345036
return
50355037
if not SubGroups:
50365038
if Landau:

GSASII/SUBGROUPS.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@
3131
#pseudolattice = "pseudosym/nph-pseudolattice"
3232
cif2std = 'nph-cif2std'
3333
subgrmag1 = 'subgrmag1_general_GSAS.pl?'
34+
#checkgr = 'checkgr.pl' # to be replaced with following:
3435
checkgr = 'checkgr_gsas.pl'
3536
minsup = 'nph-minsup' # coded but not used
3637
timeout=150 # time to wait for Bilbao to respond; 2.5 minutes
38+
timeout=15 # time to wait for Bilbao to respond; short since probably broken
3739

3840
def postpostURL(page):
3941
'''warn on Bilbao down
4042
'''
41-
if page is None: return
43+
if page is None:
44+
print('\n'+70*'*')
45+
print("GSAS-II access Bilbao website is currently (as of mid-January, 2026)\nbeing repaired. Please check for updates and try again later in\nthe month.")
46+
print(70*'*'+'\n')
47+
return
4248
if "currently down" in page:
4349
# Bilbao is down. Tell user
4450
import re
@@ -338,7 +344,7 @@ def GetStdSGset(SGData=None, oprList=[]):
338344
G2G.GetCite('Bilbao: k-SUBGROUPSMAG',wrap=70,indent=5))
339345
postdict = {'tipog':'gesp','generators':'\n'.join(oprList)}
340346
page = GSASIIpath.postURL(Site,postdict,timeout=timeout)
341-
if not page or postpostURL(page):
347+
if postpostURL(page):
342348
print('error:','No response')
343349
return [None,None,None,None]
344350

tests/run_bilbao.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def test_pseudosym():
7171
print('test PSEUDOSYM')
7272
page0 = GSASIIpath.postURL(URL,postdict,
7373
getcookie=savedcookies,timeout=SUBGROUPS.timeout)
74+
if page0 is None: assert False,"Web access failed"
7475
res = SUBGROUPS.scanBilbaoSymSearch1(page0,postdict)+[savedcookies]
7576
assert res[2]['1'][0] == 'Pn-3m'
7677
assert abs(float(res[2]['1'][5].split()[0]) - 5.43123/2) < 2e-5
@@ -81,6 +82,7 @@ def test_SUBGROUPSMAG():
8182
print('test SUBGROUPSMAG')
8283
results,baseList = SUBGROUPS.GetNonStdSubgroupsmag(
8384
SGData,('0','0','0',' ',' ',' ',' ',' ',' ',' '))
85+
assert results is not None,'web access failed'
8486
assert len(results) == 322
8587
assert results[0][0] == "Fd'-3'm'"
8688
assert results[1][0] == "Fd-3m'"
@@ -91,13 +93,15 @@ def test_SUBGROUPS():
9193
print('\n\ntest SUBGROUPS')
9294
results,baseList = SUBGROUPS.GetNonStdSubgroups(
9395
SGData,('1/3','1/3','1/2',' ',' ',' ',' ',' ',' ',' '))
96+
assert results is not None,'web access failed'
9497
assert len(results) == 51
9598
assert results[0][0] == "P21/c"
9699
assert results[-1][0] == "P1"
97100

98101
def test_GetStdSGset():
99102
print('\n\ntest Bilbao IDENTIFY GROUP')
100103
sgnum,sgsym,xmat,xoff = SUBGROUPS.GetStdSGset(G2spc.SpcGroup('R 3 C r')[1])
104+
assert sgnum is not None,'web access failed'
101105
assert sgnum == 161
102106
assert sgsym == 'R 3 c'
103107
assert xoff == [0,0,0]

0 commit comments

Comments
 (0)