Skip to content

Commit e5607d4

Browse files
committed
fixes to exceptHook & fixes to deformation stuff.
1 parent e5f36a1 commit e5607d4

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

GSASII/GSASIIpath.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,10 @@ def exceptHook(*args):
11351135
import IPython.core
11361136
savehook = sys.excepthook # save the exception hook
11371137
# show the error location
1138-
tb_formatter = IPython.core.ultratb.FormattedTB()
1139-
#tb_formatter = IPython.core.ultratb.ListTB() # better for windows?
1138+
if sys.platform == "win32":
1139+
tb_formatter = IPython.core.ultratb.ListTB() # better for windows?
1140+
else:
1141+
tb_formatter = IPython.core.ultratb.FormattedTB()
11401142
print() # blank line
11411143
print(tb_formatter.text(*args,-1),end='') # show only last routine
11421144
# get the Ipython shell routine
@@ -1146,12 +1148,11 @@ def exceptHook(*args):
11461148
ipshell = IPython.terminal.embed.InteractiveShellEmbed()
11471149
# traceback display routines
11481150
def TB(): print(IPython.core.ultratb.FormattedTB().text(*args))
1149-
def vTB(): print(IPython.core.ultratb.VerboseTB().text(*args))
1151+
def vTB(): print(IPython.core.ultratb.VerboseTB().text(*args,-1))
11501152
def bwTB(): print(IPython.core.ultratb.ListTB().text(*args)) # uncolored
11511153
try: # get to the right frame
11521154
import inspect
1153-
frame = inspect.getinnerframes(args[2])[-1][0]
1154-
import copy
1155+
frame = inspect.getinnerframes(args[2])[-2][0]
11551156
locals = frame.f_locals # add traceback commands to shell namespace
11561157
locals['TB'] = TB
11571158
locals['vTB'] = vTB

GSASII/GSASIIplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7364,12 +7364,12 @@ def Draw(caller='',Fade=[],NPkey=False):
73647364
SHC = {item.replace('D','C'):SHC[item] for item in SHC if item not in ['Ne','kappa']}
73657365
SGC = G2lat.CrysM2CartM(Amat,Bmat,SGM)
73667366
UVMat = np.inner(defCtrls['UVmat'],SGC)
7367-
Npsi,Ngam = 91,46
7367+
Npsi,Ngam = 90,45
73687368
PSI,GAM = np.mgrid[0:Npsi,0:Ngam] #[azm,pol]
7369-
PSI = PSI.flatten()*360./(Npsi-1) #azimuth 0-360 incl
7370-
GAM = GAM.flatten()*180./(Ngam-1) #polar 0-180 incl
7369+
PSI = PSI.flatten()*360./Npsi #azimuth 0-360 incl
7370+
GAM = GAM.flatten()*180./Ngam #polar 0-180 incl
73717371
Rp,PSIp,GAMp = G2mth.RotPolbyM(np.ones_like(PSI),PSI,GAM,UVMat) #TODO: needs symmetry operation for equiv. positions
7372-
P = G2lat.SHarmcal(SytSym,SHC,PSIp,GAMp).reshape((Npsi,Ngam))
7372+
P = G2lat.SHarmcal(SytSym,SHC,PSIp,GAMp).reshape((Npsi,Ngam-1))
73737373
if np.min(P) < np.max(P):
73747374
P = (P-np.min(P))/(np.max(P)-np.min(P))
73757375
RenderTextureSphere(x,y,z,radius,atcolor,shape=[Npsi,Ngam],Texture=P.T,ifFade=False)

0 commit comments

Comments
 (0)