Changeset 5374
- Timestamp:
- Nov 17, 2022 9:51:44 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r4800 r5374 28 28 #import os 29 29 import platform 30 import wx 31 import GSASIIpath 30 try: 31 import wx 32 # importing the following wx modules at the same time as wx seems to eliminate 33 # the "Debug: Adding duplicate image handler for 'Windows bitmap file'" 34 # error message 35 import wx.grid as wg 36 import wx.aui 37 import wx.lib.scrolledpanel as wxscroll 38 import wx.html # could postpone this for quicker startup 39 import wx.lib.mixins.listctrl as listmix 40 import wx.richtext as wxrt 41 import wx.lib.filebrowsebutton as wxfilebrowse 42 import GSASIIpath 43 except ImportError: 44 pass 32 45 GSASIIpath.SetVersionNumber("$Revision$") 33 46 -
trunk/GSASIIctrlGUI.py
r5373 r5374 148 148 import wx.html # could postpone this for quicker startup 149 149 import wx.lib.mixins.listctrl as listmix 150 import wx.richtext as wxrt 151 import wx.lib.filebrowsebutton as wxfilebrowse 150 152 import matplotlib as mpl 153 151 154 except ImportError: 152 155 print('ImportError for wx/mpl in GSASIIctrlGUI: ignore if docs build') … … 8502 8505 ''' 8503 8506 if fl is None: return {} 8504 result = { }8507 result = {'other':[]} 8505 8508 if not os.path.exists(fl): 8506 8509 return {'error':'File does not exist!'} … … 8512 8515 while True: 8513 8516 cnt += 1 8517 note = None 8514 8518 try: 8515 8519 data = G2IO.cPickleLoad(fp) … … 8524 8528 result[datum[0]] = datum[1][-1] 8525 8529 elif datum[0] == 'Covariance': 8526 d = datum[1] ['Rvals']8527 result[datum[0]] = 'Overall: Rwp={:.2f}, GOF={:.1f}'.format(8528 d.get('Rwp','?'),d.get('GOF','?'))8529 if d.get('converged',False):8530 result[datum[0]] += ' **Converged**'8531 elif datum[0].startswith('PWDR '):8530 d = datum[1].get('Rvals') 8531 if d: 8532 result[datum[0]] = 'Overall: Rwp={:.2f}, GOF={:.1f}'.format( 8533 d.get('Rwp','?'),d.get('GOF','?')) 8534 if d.get('converged',False): result[datum[0]] += ' **Converged**' 8535 elif datum[0].startswith('PWDR '): 8532 8536 if 'Residuals' not in datum[1][0]: continue 8533 8537 if 'PWDR' not in result: result['PWDR'] = [] … … 8536 8540 hist,datum[1][0]['Residuals'].get('wR','?'),datum[0])) 8537 8541 hist += 1 8538 # elif datum[0].startswith('HKLF'): 8539 # pass 8542 elif datum[0].startswith('HKLF '): 8543 note = 'Single crystal histogram(s)' 8544 elif datum[0].startswith('REFD '): 8545 note = 'Reflectivity histogram(s)' 8546 elif datum[0].startswith('SASD '): 8547 note = 'Small angle histogram(s)' 8548 elif datum[0].startswith('PDF '): 8549 note = 'PDF histogram(s)' 8550 elif datum[0].startswith('IMG '): 8551 note = 'Image(s)' 8552 elif datum[0] == 'Sequential results': 8553 note = 'Sequential results' 8540 8554 # elif 'Controls' in datum[0]: 8541 8555 # datum[0]['Seq Data'] … … 8543 8557 pass 8544 8558 else: 8545 pass 8546 #GSASIIpath.IPyBreak_base() 8559 # print(datum[0]) 8560 # breakpoint() 8561 pass 8562 if note: 8563 if note not in result['other']: 8564 result['other'].append(note) 8547 8565 except Exception as msg: 8548 8566 result['error'] = 'read error: '+str(msg) … … 8570 8588 ''' 8571 8589 def __init__(self,parent,startdir='.',multiple=False,*args,**kwargs): 8572 import wx.lib.filebrowsebutton as wxfilebrowse8573 import wx.richtext as wxrt8574 8590 self.timer = None 8575 8591 self.delay = 1500 # time to wait before applying filter (1.5 sec) … … 8593 8609 subSiz = wx.BoxSizer(wx.HORIZONTAL) 8594 8610 self.opt = {'useBak':False, 'sort':0, 'filter':'*'} 8595 chk = G2CheckBoxFrontLbl(self,' Include \n.bakXX?',self.opt,'useBak',8611 chk = G2CheckBoxFrontLbl(self,' Include .bakXX?',self.opt,'useBak', 8596 8612 OnChange=self.DirSelected) 8597 subSiz.Add(chk )8613 subSiz.Add(chk,0,wx.ALIGN_CENTER_VERTICAL,0) 8598 8614 subSiz.Add((10,-1),1,wx.EXPAND,1) 8599 8615 subSiz.Add(wx.StaticText(self,wx.ID_ANY,' Sort by: '),0,wx.ALIGN_CENTER_VERTICAL,1) … … 8640 8656 subSiz.Add(btn) 8641 8657 subSiz.Add((-1,-1),1,wx.EXPAND,1) 8658 topSizer.Add((-1,5)) 8642 8659 topSizer.Add(subSiz,0,wx.EXPAND) 8660 topSizer.Add((-1,5)) 8643 8661 self.SetSizer(topSizer) 8644 8662 topSizer.Fit(self) … … 8726 8744 self.rtc.Newline() 8727 8745 self.rtc.EndLeftIndent() 8728 if 'Notebook' in result :8746 if 'Notebook' in result and len(result.get('Notebook','').strip()): 8729 8747 self.rtc.BeginLeftIndent(0,40) 8730 8748 self.rtc.BeginItalic() … … 8734 8752 self.rtc.Newline() 8735 8753 self.rtc.EndLeftIndent() 8736 8754 if len(result.get('other',[])) > 0: 8755 self.rtc.BeginParagraphSpacing(0,0) 8756 self.rtc.BeginLeftIndent(0) 8757 self.rtc.BeginBold() 8758 self.rtc.WriteText('Data types in project:') 8759 self.rtc.EndBold() 8760 self.rtc.EndLeftIndent() 8761 self.rtc.Newline() 8762 self.rtc.BeginLeftIndent(40) 8763 for line in result['other']: 8764 self.rtc.WriteText(line+'\n') 8765 self.rtc.EndLeftIndent() 8766 self.rtc.EndParagraphSpacing() 8767 8737 8768 if 'PWDR' in result: 8738 8769 self.rtc.BeginParagraphSpacing(0,0)
Note: See TracChangeset
for help on using the changeset viewer.