Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .notes/.linenoteplus
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The location of this `.linenoteplus` file determines
# the path to store and retrieve your notes.

# To relocate your notes, simply move or rename
# the directory that contains this `.linenoteplus` file.
12 changes: 10 additions & 2 deletions GSASII/GSASIIphsGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -6388,8 +6388,12 @@ def RunRMCProfile(event):
ascript_file = os.path.join(os.getcwd(), "runrmc.script")
with open(ascript_file, 'w') as f:
f.write('tell application "Terminal"\n')
f.write(f''' do script "echo 'Running RMCprofile'"\n''')
f.write(' if not (exists window 1) then\n')
f.write(f' do script "bash {script_file}"\n')
f.write(' else\n')
f.write(f' do script "bash {script_file}" in window 1\n')
f.write(' end if\n')
f.write(' activate\n')
f.write("end tell\n")
subp.Popen(['osascript', ascript_file])
elif sys.platform.startswith("linux"):
Expand Down Expand Up @@ -6607,8 +6611,12 @@ def OnViewRMC(event):
generalData = data['General']
RMCPdict = data['RMC']['RMCProfile']
pName = generalData['Name'].replace(' ','_')
if sys.platform == "darwin":
wildcard = 'RMCProfile result csv files|' + pName + '*.csv' + '|All files|*.*'
else:
wildcard = 'RMCProfile result csv files|' + pName + '*.csv'
dlg = wx.FileDialog(G2frame, "Choose any RMCProfile csv results file for "+pName+":",
defaultDir=G2frame.LastGPXdir,style=wx.FD_CHANGE_DIR,wildcard='RMCProfile result csv files|'+pName+'*.csv')
defaultDir=G2frame.LastGPXdir,style=wx.FD_CHANGE_DIR,wildcard=wildcard)
if dlg.ShowModal() == wx.ID_OK:
path = os.path.split(dlg.GetPath())[0]
dlg.Destroy()
Expand Down
2 changes: 1 addition & 1 deletion GSASII/GSASIIpwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3431,7 +3431,7 @@ def MakeRMCPdat(PWDdata,Name,Phase,RMCPdict):
dMin = refList[-1][4]
gsasType = 'xray2'
if 'T' in inst['Type'][1]:
gsasType = 'gsas3'
gsasType = 'gsas3_new'
elif 'X' in inst['Type'][1]:
XFF = G2elem.GetFFtable(Atseq)
Xfl = open(Name+'.xray','w')
Expand Down
9 changes: 5 additions & 4 deletions GSASII/GSASIIrmcGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,14 @@ def OnFileSel(event):
style=wx.FD_OPEN ,wildcard=fil+'(*.*)|*.*')
if dlg.ShowModal() == wx.ID_OK:
fpath,fName = os.path.split(dlg.GetPath())
if os.path.exists(fName): # is there a file by this name in the current directory?
if os.path.exists(os.path.join(G2frame.LastGPXdir,fName)): # is there a file by this name in the current directory?
RMCPdict['files'][fil][0] = fName
else: # nope, copy it
# TODO: is G2frame.LastGPXdir the right choice here or
# do I want the current working directory (same?)
shutil.copy(dlg.GetPath(), os.path.join(G2frame.LastGPXdir,fName))
if not os.path.exists(fName): # sanity check
RMCPdict['files'][fil][0] = fName
if not os.path.exists(os.path.join(G2frame.LastGPXdir,fName)): # sanity check
print(f'Error: file {fName} not found in .gpx directory ({G2frame.LastGPXdir})')
return
G2frame.LastImportDir = fpath #set so next file is found in same place
Expand Down Expand Up @@ -270,7 +271,7 @@ def OnPlotBtn(event):
XY = np.empty((1,2))
while XY.shape[0] == 1:
try:
XY = np.loadtxt(fileItem[0],skiprows=start)
XY = np.loadtxt(os.path.join(G2frame.LastGPXdir,fileItem[0]),skiprows=start)
except ValueError:
start += 1
if start > 500: #absurd number of header lines!
Expand Down Expand Up @@ -551,7 +552,7 @@ def OnSetVal(event):
if 'Xray' in fil:
nform = 1
Name = 'Xdata'
if Rfile and os.path.exists(Rfile): #incase .gpx file is moved away from G(R), F(Q), etc. files
if Rfile and os.path.exists(os.path.join(G2frame.LastGPXdir,Rfile)): #incase .gpx file is moved away from G(R), F(Q), etc. files
fileFormat = wx.ComboBox(G2frame.FRMC,choices=Formats[:nform],style=wx.CB_DROPDOWN|wx.TE_READONLY)
fileFormat.SetStringSelection(RMCPdict['files'][fil][3])
Indx[fileFormat.GetId()] = fil
Expand Down
Loading