Ignore:
Timestamp:
Nov 22, 2010 10:36:42 AM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
32c0841
Parents:
cbaa2f4
Message:

working on pylint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant_panel.py

    reffce1d r4a2b054  
    33 
    44""" 
    5  
     5import copy 
     6import time 
     7import sys 
     8import os 
    69import wx 
    7  
    8 import sys,os 
    9  
    1010from wx.lib.scrolledpanel import ScrolledPanel 
    1111from sans.invariant import invariant 
    12 from sans.guiframe.utils import format_number, check_float 
     12from sans.guiframe.utils import format_number 
     13from sans.guiframe.utils import check_float 
    1314from sans.guicomm.events import NewPlotEvent, StatusEvent 
    14 from invariant_details import InvariantDetailsPanel, InvariantContainer 
    15 from invariant_widgets import OutputTextCtrl, InvTextCtrl 
     15from invariant_details import InvariantDetailsPanel 
     16from invariant_details import InvariantContainer 
     17from invariant_widgets import OutputTextCtrl 
     18from invariant_widgets import InvTextCtrl 
    1619from invariant_state import InvariantState as IState 
    17 import copy,time 
     20 
    1821# The minimum q-value to be used when extrapolating 
    1922Q_MINIMUM  = 1e-5 
     
    3639 
    3740 
    38 if sys.platform.count("win32")>0: 
     41if sys.platform.count("win32") > 0: 
    3942    _STATICBOX_WIDTH = 450 
    4043    PANEL_WIDTH = 500  
     
    5861    ## Flag to tell the AUI manager to put this panel in the center pane 
    5962    CENTER_PANE = True 
    60     def __init__(self, parent, data=None, manager=None,*args, **kwds): 
    61         kwds["size"]= (PANEL_WIDTH, PANEL_HEIGHT) 
    62         kwds["style"]= wx.FULL_REPAINT_ON_RESIZE 
     63    def __init__(self, parent, data=None, manager=None, *args, **kwds): 
     64        kwds["size"] = (PANEL_WIDTH, PANEL_HEIGHT) 
     65        kwds["style"] = wx.FULL_REPAINT_ON_RESIZE 
    6366        ScrolledPanel.__init__(self, parent=parent, *args, **kwds) 
    6467        self.SetupScrolling() 
     
    108111            if len(self._data.x[self._data.x==0]) > 0: 
    109112                flag = True 
    110                 msg = "Invariant: one of your q-values is zero. Delete that entry before proceeding" 
     113                msg = "Invariant: one of your q-values is zero. " 
     114                msg += "Delete that entry before proceeding" 
    111115                self.hint_msg_txt.SetLabel(msg) 
    112116                wx.PostEvent(self.parent, StatusEvent(status=msg, 
     
    137141            self._reset_state_list() 
    138142        return True   
     143     
    139144    def set_message(self): 
    140145        """ 
     
    147152                self.hint_msg_txt.SetForegroundColour("red") 
    148153     
    149                 wx.PostEvent(self.parent,StatusEvent(status=msg,info="warning")) 
     154                wx.PostEvent(self.parent, 
     155                             StatusEvent(status=msg,info="warning")) 
    150156            else: 
    151157                msg = "For more information, click on Details button." 
    152158                self.hint_msg_txt.SetForegroundColour("black") 
    153                 wx.PostEvent(self.parent,StatusEvent(status=msg,info="info")) 
     159                wx.PostEvent(self.parent, 
     160                             StatusEvent(status=msg,info="info")) 
    154161            self.hint_msg_txt.SetLabel(msg) 
    155162             
     
    178185            if num > 0 : 
    179186                self._undo_enable() 
    180             if num < len(state.state_list)-1: 
     187            if num < len(state.state_list) - 1: 
    181188                self._redo_enable() 
    182189                 
     
    184191            self.bookmark_num = len(self.state.bookmark_list) 
    185192 
    186             total_bookmark_num = self.bookmark_num+1 
     193            total_bookmark_num = self.bookmark_num + 1 
    187194            for ind in range(1,total_bookmark_num): 
    188195                #bookmark_num = ind 
     
    197204             
    198205            self._get_input_list()  
    199             #make sure that the data is reset (especially when loaded from a inv file) 
     206            #make sure that the data is reset (especially 
     207            # when loaded from a inv file) 
    200208            self.state.data = self._data 
    201209 
     
    238246            return float(background) 
    239247        else: 
    240             raise ValueError, "Receive invalid value for background : %s"%(background) 
     248            msg = "Receive invalid value for background : %s" % (background) 
     249            raise ValueError, msg 
    241250     
    242251    def get_scale(self): 
     
    248257            raise ValueError, "Need a background" 
    249258        if check_float(self.scale_tcl): 
    250             if float(scale)<= 0.0: 
     259            if float(scale) <= 0.0: 
    251260                self.scale_tcl.SetBackgroundColour("pink") 
    252261                self.scale_tcl.Refresh() 
    253                 raise ValueError, "Receive invalid value for scale: %s"%(scale) 
     262                msg = "Receive invalid value for scale: %s" % (scale) 
     263                raise ValueError, msg 
    254264            return float(scale) 
    255265        else: 
    256             raise ValueError, "Receive invalid value for scale : %s"%(scale) 
     266            raise ValueError, "Receive invalid value for scale : %s" % (scale) 
    257267         
    258268    def get_contrast(self): 
     
    262272        par_str = self.contrast_tcl.GetValue().strip() 
    263273        contrast = None 
    264         if par_str !="" and check_float(self.contrast_tcl): 
     274        if par_str !=" " and check_float(self.contrast_tcl): 
    265275            contrast = float(par_str) 
    266276        return contrast 
     
    284294        par_str = self.porod_constant_tcl.GetValue().strip() 
    285295        porod_const = None 
    286         if par_str !="" and check_float(self.porod_constant_tcl): 
     296        if par_str != "" and check_float(self.porod_constant_tcl): 
    287297            porod_const = float(par_str) 
    288298        return porod_const 
     
    294304            try: 
    295305                v, dv = inv.get_volume_fraction_with_error(contrast=contrast,  
    296                                                            extrapolation=extrapolation) 
     306                                                extrapolation=extrapolation) 
    297307                self.volume_tcl.SetValue(format_number(v)) 
    298308                self.volume_err_tcl.SetValue(format_number(dv)) 
     
    300310                self.volume_tcl.SetValue(format_number(None)) 
    301311                self.volume_err_tcl.SetValue(format_number(None)) 
    302                 msg= "Error occurred computing volume fraction: %s"%sys.exc_value 
     312                msg = "Error occurred computing volume " 
     313                msg += " fraction: %s" % sys.exc_value 
    303314                wx.PostEvent(self.parent, StatusEvent(status=msg, 
    304315                                                      info="error", 
     
    318329                self.surface_tcl.SetValue(format_number(None)) 
    319330                self.surface_err_tcl.SetValue(format_number(None)) 
    320                 msg = "Error occurred computing specific surface: %s"%sys.exc_value 
     331                msg = "Error occurred computing " 
     332                msg += "specific surface: %s" % sys.exc_value 
    321333                wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 
    322334                                                       type="stop")) 
     
    338350            self.invariant_total_tcl.SetValue(format_number(None)) 
    339351            self.invariant_total_err_tcl.SetValue(format_number(None)) 
    340             msg= "Error occurred computing invariant using extrapolation: %s"%sys.exc_value 
     352            msg = "Error occurred computing invariant using" 
     353            msg += " extrapolation: %s" % sys.exc_value 
    341354            wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop"))   
    342355             
     
    359372                self.inv_container.qstar_low_err = "ERROR" 
    360373                self._manager.plot_theory(name="Low-Q extrapolation") 
    361                 msg= "Error occurred computing low-Q invariant: %s"%sys.exc_value 
    362                 wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 
     374                msg = "Error occurred computing low-Q " 
     375                msg += "invariant: %s" % sys.exc_value 
     376                wx.PostEvent(self.parent, 
     377                             StatusEvent(status=msg, type="stop")) 
    363378        else: 
    364379            try: 
     
    378393                power_high = inv.get_extrapolation_power(range='high')  
    379394                self.power_high_tcl.SetValue(format_number(power_high)) 
    380                 high_out_data = inv.get_extra_data_high(q_end=qmax_plot,npts=500) 
     395                high_out_data = inv.get_extra_data_high(q_end=qmax_plot, 
     396                                                        npts=500) 
    381397                self._manager.plot_theory(data=high_out_data, 
    382398                                           name="High-Q extrapolation") 
     
    385401                self.inv_container.qstar_high_err = "ERROR" 
    386402                self._manager.plot_theory(name="High-Q extrapolation") 
    387                 msg= "Error occurred computing high-Q invariant: %s"%sys.exc_value 
    388                 wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 
     403                msg = "Error occurred computing high-Q " 
     404                msg += "invariant: %s" % sys.exc_value 
     405                wx.PostEvent(self.parent, StatusEvent(status=msg, 
     406                                                      type="stop")) 
    389407        else: 
    390408            try: 
     
    420438                    if low_q : 
    421439                        #Raise error only when qstar at low q is requested 
    422                         msg = "Expect float for power at low q , got %s"%(power_low) 
     440                        msg = "Expect float for power at low q, " 
     441                        msg += " got %s" % (power_low) 
    423442                        raise ValueError, msg 
    424443        
     
    429448        else: 
    430449            if low_q: 
    431                 msg = "Expect float for number of points at low q , got %s"%(npts_low) 
     450                msg = "Expect float for number of points at low q," 
     451                msg += " got %s" % (npts_low) 
    432452                raise ValueError, msg 
    433453        #Set the invariant calculator 
     
    454474                if high_q : 
    455475                    #Raise error only when qstar at high q is requested 
    456                     msg = "Expect float for power at high q , got %s"%(power_high) 
     476                    msg = "Expect float for power at high q," 
     477                    msg += " got %s" % (power_high) 
    457478                    raise ValueError, msg 
    458479                           
     
    462483        else: 
    463484            if high_q: 
    464                 msg = "Expect float for number of points at high q , got %s"%(npts_high) 
     485                msg = "Expect float for number of points at high q," 
     486                msg += " got %s" % (npts_high) 
    465487                raise ValueError, msg 
    466488        inv.set_extrapolation(range="high", npts=npts_high, 
     
    483505        """ 
    484506        if self._data == None: 
    485             msg = "\n\nData must be loaded first in order to perform a compution..." 
     507            msg = "\n\nData must be loaded first in order" 
     508            msg += " to perform a compution..." 
    486509            wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    487510        # set a state for this computation for saving 
     
    502525            scale = self.get_scale() 
    503526        except: 
    504             msg= "Invariant Error: %s"%(sys.exc_value) 
    505             wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 
     527            msg = "Invariant Error: %s" % (sys.exc_value) 
     528            wx.PostEvent(self.parent, StatusEvent(status=msg, type="stop")) 
    506529            return 
    507530         
     
    516539            inv, npts_high = self.set_extrapolation_high(inv=inv, high_q=high_q) 
    517540        except: 
    518             msg = "Error occurred computing invariant: %s"%sys.exc_value 
     541            msg = "Error occurred computing invariant: %s" % sys.exc_value 
    519542            wx.PostEvent(self.parent, StatusEvent(status=msg, 
    520543                                                 info="warning",type="stop")) 
     
    532555             
    533556        except: 
    534             msg= "Error occurred computing invariant: %s"%sys.exc_value 
     557            msg= "Error occurred computing invariant: %s" % sys.exc_value 
    535558            wx.PostEvent(self.parent, StatusEvent(status=msg,  
    536                                                   info="warning",type="stop")) 
     559                                                  info="warning", 
     560                                                  type="stop")) 
    537561            return 
    538562        
     
    549573        try: 
    550574            #Compute volume and set value to txtcrtl 
    551             self.get_volume(inv=inv, contrast=contrast, extrapolation=extrapolation) 
     575            self.get_volume(inv=inv, contrast=contrast, 
     576                            extrapolation=extrapolation) 
    552577            #compute surface and set value to txtcrtl 
    553578        except: 
    554             msg = "Error occurred computing invariant: %s"%sys.exc_value 
     579            msg = "Error occurred computing invariant: %s" % sys.exc_value 
    555580            wx.PostEvent(self.parent, StatusEvent(status=msg, 
    556                                                   info="warning",type="stop")) 
     581                                                  info="warning", 
     582                                                  type="stop")) 
    557583        try: 
    558             self.get_surface(inv=inv, contrast=contrast, porod_const=porod_const,  
     584            self.get_surface(inv=inv, contrast=contrast, 
     585                                    porod_const=porod_const,  
    559586                                    extrapolation=extrapolation) 
    560587             
    561588        except: 
    562             msg = "Error occurred computing invariant: %s"%sys.exc_value 
     589            msg = "Error occurred computing invariant: %s" % sys.exc_value 
    563590            wx.PostEvent(self.parent, StatusEvent(status=msg, 
    564                                                   info="warning",type="stop")) 
     591                                                  info="warning", 
     592                                                  type="stop")) 
    565593             
    566594        #compute percentage of each invariant 
     
    583611         
    584612        if event != None:  
    585             if not self.button_report.IsEnabled(): self.button_report.Enable(True) 
    586             if not self.button_save.IsEnabled(): self.button_save.Enable(True) 
    587             wx.PostEvent(self.parent, StatusEvent(status = '\nFinished invariant computation...')) 
     613            if not self.button_report.IsEnabled(): 
     614                self.button_report.Enable(True) 
     615            if not self.button_save.IsEnabled(): 
     616                self.button_save.Enable(True) 
     617            wx.PostEvent(self.parent, 
     618                StatusEvent(status='\nFinished invariant computation...')) 
    588619             
    589620 
     
    594625        : param event: undo button event 
    595626        """ 
    596         if event != None: event.Skip() 
    597         if self.state.state_num <0: return 
     627        if event != None:  
     628            event.Skip() 
     629        if self.state.state_num < 0: 
     630            return 
    598631        self.is_power_out = True 
    599632        # get the previous state_num 
     
    601634        self.get_state_by_num(state_num=str(pre_state_num)) 
    602635         
    603         if float(pre_state_num) <=0: 
     636        if float(pre_state_num) <= 0: 
    604637            self._undo_disable() 
    605638        else: 
     
    617650        : param event: redo button event 
    618651        """ 
    619         if event != None: event.Skip() 
     652        if event != None: 
     653            event.Skip() 
    620654        self.is_power_out = True 
    621655        # get the next state_num 
     
    663697        try: 
    664698            current_state = copy.deepcopy(self.state.state_list[str(state_num)]) 
    665             # get the previously computed state number (computation before the state changes happened) 
     699            # get the previously computed state number  
     700            #(computation before the state changes happened) 
    666701            current_compute_num = str(current_state['compute_num']) 
    667702        except : 
     
    789824        name = str(obj.GetName()) 
    790825        value = str(obj.GetValue()) 
    791         rb_list = [['power_law_low','guinier'],['fit_enable_low','fix_enable_low'],['fit_enable_high','fix_enable_high']] 
     826        rb_list = [['power_law_low','guinier'], 
     827                   ['fit_enable_low','fix_enable_low'], 
     828                   ['fit_enable_high','fix_enable_high']] 
    792829 
    793830        try: 
     
    797834            exec "self.state.saved_state['%s'] = %s" %  (name, value) 
    798835             
    799             # set the count part of radio button clicked False for the saved_state 
     836            # set the count part of radio button clicked  
     837            #False for the saved_state 
    800838            for title,content in rb_list: 
    801839                if name ==  title: 
     
    808846             
    809847            # Instead of changing the future, create a new future. 
    810             max_state_num = len(self.state.state_list)-1    
     848            max_state_num = len(self.state.state_list) - 1    
    811849            self.state.saved_state['state_num'] = max_state_num    
    812850             
    813             self.state.saved_state['state_num'] +=1 
     851            self.state.saved_state['state_num'] += 1 
    814852            self.state.state_num = self.state.saved_state['state_num'] 
    815853            self.state.state_list[str(self.state.state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
     
    825863        Notify the compute_invariant state to self.state 
    826864         
    827         : param state: set 'compute' when the computation is activated by the 'compute' button, else None 
     865        : param state: set 'compute' when the computation is 
     866        activated by the 'compute' button, else None 
    828867         
    829868        """ 
     
    838877        self.state.saved_state['state_num'] = max_state_num         
    839878        # A new computation is also A state 
    840         temp_saved_states = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
    841         temp_saved_states['state_num'] +=1 
     879        #copy.deepcopy(self.state.saved_state) 
     880        temp_saved_states = self.state.clone_state() 
     881        temp_saved_states['state_num'] += 1 
    842882        self.state.state_num = temp_saved_states['state_num'] 
    843883 
     
    847887            temp_saved_states['compute_num'] = self.state.state_num 
    848888        self.state.saved_state= copy.deepcopy(temp_saved_states) 
    849         self.state.state_list[str(self.state.state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
    850          
    851         # A computation is a new state, so delete the states with any higher state numbers 
     889        #copy.deepcopy(self.state.saved_state) 
     890        self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 
     891         
     892        # A computation is a new state, so delete the states with any higher 
     893        # state numbers 
    852894        for i in range(self.state.state_num+1,len(self.state.state_list)): 
    853895            try: 
     
    860902         
    861903         
    862     def _reset_state_list(self,data=None): 
    863         """ 
    864         Reset the state_list just before data was loading: Used in 'set_current_data()' 
     904    def _reset_state_list(self, data=None): 
     905        """ 
     906        Reset the state_list just before data was loading: 
     907        Used in 'set_current_data()' 
    865908        """ 
    866909        #if data == None: return 
    867         #temp_state = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
     910        #temp_state = self.state.clone_state() 
     911        #copy.deepcopy(self.state.saved_state) 
    868912        # Clear the list  
    869913        self.state.state_list.clear() 
     
    882926 
    883927        # Put only the current state in the list 
    884         self.state.state_list[str(self.state.state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
     928        #copy.deepcopy(self.state.saved_state) 
     929        self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 
    885930        self._undo_disable() 
    886931         
     
    927972                    self.state.saved_state['state_num'] += 1 
    928973            self.state.state_num = self.state.saved_state['state_num'] 
    929             self.state.state_list[str(self.state.state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
     974            #copy.deepcopy(self.state.saved_state) 
     975            self.state.state_list[str(self.state.state_num)] = self.state.clone_state() 
    930976        except: 
    931977            pass 
     
    9761022        self.popUpMenu = wx.Menu() 
    9771023        id = wx.NewId() 
    978         self._bmark = wx.MenuItem(self.popUpMenu,id,"BookMark"," Bookmark the panel to recall it later") 
     1024        self._bmark = wx.MenuItem(self.popUpMenu,id,"BookMark", 
     1025                                  " Bookmark the panel to recall it later") 
    9791026        self.popUpMenu.AppendItem(self._bmark) 
    9801027        self._bmark.Enable(True) 
     
    9851032    def _on_bookmark(self,event): 
    9861033        """ 
    987         Save the panel state in memory and add the list on the popup menu on bookmark context menu event 
     1034        Save the panel state in memory and add the list on 
     1035        the popup menu on bookmark context menu event 
    9881036        """  
    9891037        if self._data == None: return 
     
    10101058        state = self.state.clone_state() 
    10111059        comp_state = copy.deepcopy(self.state.state_list[str(compute_num)]) 
    1012         self.state.bookmark_list[self.bookmark_num] = [my_time,date,state,comp_state] 
     1060        self.state.bookmark_list[self.bookmark_num] = [my_time, date, 
     1061                                                       state,comp_state] 
    10131062        self.state.toXML(self, doc=None, entry_node=None) 
    10141063         
     
    10171066    def _back_to_bookmark(self,event): 
    10181067        """ 
    1019         Bring the panel back to the state of bookmarked requested by context menu event 
     1068        Bring the panel back to the state of bookmarked requested by 
     1069        context menu event 
    10201070        and set it as a new state 
    10211071        """ 
     
    10321082         
    10331083        self.state.saved_state['state_num'] = state_num 
    1034         self.state.state_list[str(state_num)] = self.state.clone_state()#copy.deepcopy(self.state.saved_state) 
     1084        #copy.deepcopy(self.state.saved_state) 
     1085        self.state.state_list[str(state_num)] = self.state.clone_state() 
    10351086        self.state.state_num = state_num 
    10361087        self._undo_enable() 
     
    11051156        # Ask the user the location of the file to write to. 
    11061157        path = None 
    1107         dlg = wx.FileDialog(self, "Choose a file", self._default_save_location, "", "*.inv", wx.SAVE) 
     1158        dlg = wx.FileDialog(self, "Choose a file", 
     1159                            self._default_save_location, "", "*.inv", wx.SAVE) 
    11081160        if dlg.ShowModal() == wx.ID_OK: 
    11091161            path = dlg.GetPath() 
     
    11241176        count_bf = self.data_cbbox.GetCount() 
    11251177        if count_bf > 1: 
    1126             mssg += 'Loading a new data set will reset all the work done in this panel. \n\r' 
    1127             mssg += 'Please make sure to save it first... \n\r' 
    1128             answer = wx.MessageBox(mssg, msg, wx.CANCEL|wx.OK|wx.ICON_EXCLAMATION) 
     1178            msg += "Loading a new data set will reset all the work" 
     1179            msg += " done in this panel. \n\r" 
     1180            mssg += "Please make sure to save it first... \n\r" 
     1181            answer = wx.MessageBox(mssg, msg, 
     1182                                   wx.CANCEL|wx.OK|wx.ICON_EXCLAMATION) 
    11291183     
    11301184            if answer == wx.OK: 
     
    11591213        Define main sizers needed for this panel 
    11601214        """ 
    1161         ## Box sizers must be defined first before defining buttons/textctrls (MAC). 
     1215        ## Box sizers must be defined first before  
     1216        #defining buttons/textctrls (MAC). 
    11621217        self.main_sizer = wx.BoxSizer(wx.VERTICAL) 
    11631218        #Sizer related to outputs 
     
    11931248        #Sizer related to extrapolation at low q range 
    11941249        high_q_box = wx.StaticBox(self, -1, "High Q") 
    1195         self.high_extrapolation_sizer = wx.StaticBoxSizer(high_q_box, wx.VERTICAL) 
     1250        self.high_extrapolation_sizer = wx.StaticBoxSizer(high_q_box, 
     1251                                                          wx.VERTICAL) 
    11961252        self.high_q_sizer = wx.GridBagSizer(5,5) 
    11971253        #sizer to define outputs 
     
    12091265        """ 
    12101266        #Sizer hint  
    1211         hint_msg = "First open data file from 'File' menu.  Then Highlight and right click on the data plot. \n" 
     1267        hint_msg = "First open data file from 'File' menu." 
     1268        hint_msg += "Then Highlight and right click on the data plot. \n" 
    12121269        hint_msg += "Finally, select 'Compute Invariant'." 
    12131270        self.hint_msg_txt = wx.StaticText(self, -1, hint_msg)   
    12141271        self.hint_msg_txt.SetForegroundColour("red") 
    1215         msg = "Highlight = mouse the mouse's cursor on the data until the plot's color changes to yellow" 
     1272        msg = "Highlight = mouse the mouse's cursor on the data until" 
     1273        msg += " the plot's color changes to yellow" 
    12161274        self.hint_msg_txt.SetToolTipString(msg) 
    12171275        self.hint_msg_sizer.Add(self.hint_msg_txt) 
     
    12191277        data_name_txt = wx.StaticText(self, -1, 'Data : ')   
    12201278        
    1221         self.data_name_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), style=0)  
     1279        self.data_name_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH*5, 20), 
     1280                                            style=0)  
    12221281        self.data_name_tcl.SetToolTipString("Data's name.") 
    12231282        self.data_name_sizer.AddMany([(data_name_txt, 0, wx.LEFT|wx.RIGHT, 10), 
     
    12261285        data_range_txt = wx.StaticText(self, -1, 'Total Q Range (1/A): ')  
    12271286        data_min_txt = wx.StaticText(self, -1, 'Min : ')   
    1228         self.data_min_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0, name='data_min_tcl') 
     1287        self.data_min_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     1288                                           style=0, name='data_min_tcl') 
    12291289        self.data_min_tcl.SetToolTipString("The minimum value of q range.") 
    12301290        data_max_txt = wx.StaticText(self, -1, 'Max : ')  
    1231         self.data_max_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0, name='data_max_tcl')  
     1291        self.data_max_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     1292                                           style=0, name='data_max_tcl')  
    12321293        self.data_max_tcl.SetToolTipString("The maximum value of q range.") 
    12331294        self.data_range_sizer.AddMany([(data_range_txt, 0, wx.RIGHT, 10), 
     
    12451306        """ 
    12461307        background_txt = wx.StaticText(self, -1, 'Background : ')   
    1247         self.background_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0, name='background_tcl')  
     1308        self.background_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     1309                                          style=0, name='background_tcl')  
    12481310        wx.EVT_TEXT(self, self.background_tcl.GetId(), self._on_text) 
    12491311        background_hint_txt = "Background" 
     
    12511313        background_unit_txt = wx.StaticText(self, -1, '[1/cm]')   
    12521314        scale_txt = wx.StaticText(self, -1, 'Scale : ')   
    1253         self.scale_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0, name='scale_tcl') 
     1315        self.scale_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0, 
     1316                                     name='scale_tcl') 
    12541317        wx.EVT_TEXT(self, self.scale_tcl.GetId(), self._on_text) 
    12551318        scale_hint_txt = "Scale" 
     
    12661329        """ 
    12671330        contrast_txt = wx.StaticText(self, -1, 'Contrast : ')   
    1268         self.contrast_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0,name='contrast_tcl') 
     1331        self.contrast_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     1332                                        style=0,name='contrast_tcl') 
    12691333        wx.EVT_TEXT(self, self.contrast_tcl.GetId(), self._on_text) 
    12701334        contrast_hint_txt = "Contrast" 
     
    12731337        porod_const_txt = wx.StaticText(self, -1, 'Porod Constant:')   
    12741338        self.porod_constant_tcl = InvTextCtrl(self, -1,  
    1275                                               size=(_BOX_WIDTH, 20), style=0,name='porod_constant_tcl')  
     1339                                              size=(_BOX_WIDTH, 20), style=0, 
     1340                                              name='porod_constant_tcl')  
    12761341        wx.EVT_TEXT(self, self.porod_constant_tcl.GetId(), self._on_text) 
    12771342        porod_const_hint_txt = "Porod Constant" 
     
    13551420        Draw widgets related to extrapolation at low q range 
    13561421        """ 
    1357         self.enable_low_cbox = wx.CheckBox(self, -1, "Enable Extrapolate Low Q",name='enable_low_cbox') 
     1422        self.enable_low_cbox = wx.CheckBox(self, -1, 
     1423                                           "Enable Extrapolate Low Q", 
     1424                                           name='enable_low_cbox') 
    13581425        wx.EVT_CHECKBOX(self, self.enable_low_cbox.GetId(), 
    13591426                                         self._enable_low_q_section) 
    13601427        self.fix_enable_low = wx.RadioButton(self, -1, 'Fix', 
    1361                                          (10, 10),style=wx.RB_GROUP,name='fix_enable_low') 
     1428                                         (10, 10), style=wx.RB_GROUP, 
     1429                                         name='fix_enable_low') 
    13621430        self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_low, 
    13631431                                     id=self.fix_enable_low.GetId()) 
    1364         self.fit_enable_low = wx.RadioButton(self, -1, 'Fit', (10, 10),name='fit_enable_low') 
     1432        self.fit_enable_low = wx.RadioButton(self, -1, 'Fit', (10, 10), 
     1433                                             name='fit_enable_low') 
    13651434        self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_low,  
    13661435                                        id=self.fit_enable_low.GetId()) 
    13671436        self.guinier = wx.RadioButton(self, -1, 'Guinier', 
    1368                                          (10, 10),style=wx.RB_GROUP, name='guinier') 
     1437                                         (10, 10), style=wx.RB_GROUP, 
     1438                                         name='guinier') 
    13691439        self.Bind(wx.EVT_RADIOBUTTON, self._enable_power_law_low, 
    13701440                                     id=self.guinier.GetId())         
    1371         self.power_law_low = wx.RadioButton(self, -1, 'Power Law', (10, 10),name='power_law_low') 
     1441        self.power_law_low = wx.RadioButton(self, -1, 'Power Law', 
     1442                                            (10, 10), name='power_law_low') 
    13721443        self.Bind(wx.EVT_RADIOBUTTON, self._enable_power_law_low,  
    13731444                                        id=self.power_law_low.GetId()) 
    13741445         
    13751446        npts_low_txt = wx.StaticText(self, -1, 'Npts') 
    1376         self.npts_low_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1),name='npts_low_tcl') 
     1447        self.npts_low_tcl = InvTextCtrl(self, -1, 
     1448                                        size=(_BOX_WIDTH*2/3, -1), 
     1449                                        name='npts_low_tcl') 
    13771450        wx.EVT_TEXT(self, self.npts_low_tcl.GetId(), self._on_text) 
    13781451        msg_hint = "Number of Q points to consider" 
     
    13801453        self.npts_low_tcl.SetToolTipString(msg_hint) 
    13811454        power_txt = wx.StaticText(self, -1, 'Power') 
    1382         self.power_low_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1),name='power_low_tcl') 
     1455        self.power_low_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1), 
     1456                                         name='power_low_tcl') 
    13831457        wx.EVT_TEXT(self, self.power_low_tcl.GetId(), self._on_text) 
    13841458        
     
    13871461        iy = 0 
    13881462        ix = 0 
    1389         self.low_q_sizer.Add(self.enable_low_cbox,(iy, ix),(1,5), 
     1463        self.low_q_sizer.Add(self.enable_low_cbox,(iy, ix), (1, 5), 
    13901464                            wx.TOP|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    13911465        iy += 1 
    13921466        ix = 0 
    1393         self.low_q_sizer.Add(npts_low_txt,(iy, ix),(1,1), 
     1467        self.low_q_sizer.Add(npts_low_txt,(iy, ix), (1, 1), 
    13941468                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    13951469        ix += 1 
     
    14021476        iy += 1 
    14031477        ix = 0 
    1404         self.low_q_sizer.Add(self.power_law_low,(iy, ix),(1,2), 
     1478        self.low_q_sizer.Add(self.power_law_low,(iy, ix), (1, 2), 
    14051479                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    14061480        
     
    14081482        ix = 1 
    14091483        iy += 1 
    1410         self.low_q_sizer.Add(self.fix_enable_low,(iy, ix),(1,1), 
     1484        self.low_q_sizer.Add(self.fix_enable_low,(iy, ix), (1, 1), 
    14111485                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    14121486        ix += 1 
     
    14151489        ix = 1 
    14161490        iy += 1 
    1417         self.low_q_sizer.Add(power_txt,(iy, ix),(1,1), 
     1491        self.low_q_sizer.Add(power_txt,(iy, ix), (1, 1), 
    14181492                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    14191493        ix += 1 
    1420         self.low_q_sizer.Add(self.power_low_tcl, (iy, ix), (1,1), 
     1494        self.low_q_sizer.Add(self.power_low_tcl, (iy, ix), (1, 1), 
    14211495                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    14221496        self.low_extrapolation_sizer.AddMany([(self.low_q_sizer, 0, 
     
    14661540        Draw widgets related to extrapolation at high q range 
    14671541        """ 
    1468         self.enable_high_cbox = wx.CheckBox(self, -1, "Enable Extrapolate high-Q", name='enable_high_cbox') 
     1542        self.enable_high_cbox = wx.CheckBox(self, -1, 
     1543                                            "Enable Extrapolate high-Q", 
     1544                                            name='enable_high_cbox') 
    14691545        wx.EVT_CHECKBOX(self, self.enable_high_cbox.GetId(), 
    14701546                                         self._enable_high_q_section) 
    14711547        self.fix_enable_high = wx.RadioButton(self, -1, 'Fix', 
    1472                                          (10, 10),style=wx.RB_GROUP,name='fix_enable_high') 
     1548                                         (10, 10), style=wx.RB_GROUP, 
     1549                                         name='fix_enable_high') 
    14731550        self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_high, 
    14741551                                     id=self.fix_enable_high.GetId()) 
    1475         self.fit_enable_high = wx.RadioButton(self, -1, 'Fit', (10, 10),name='fit_enable_high')      
     1552        self.fit_enable_high = wx.RadioButton(self, -1, 'Fit', (10, 10), 
     1553                                              name='fit_enable_high')      
    14761554        self.Bind(wx.EVT_RADIOBUTTON, self._enable_fit_power_law_high,  
    14771555                                        id=self.fit_enable_high.GetId()) 
     
    14811559        self.power_law_high.SetToolTipString(msg_hint) 
    14821560        npts_high_txt = wx.StaticText(self, -1, 'Npts') 
    1483         self.npts_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1),name='npts_high_tcl') 
     1561        self.npts_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1), 
     1562                                         name='npts_high_tcl') 
    14841563        wx.EVT_TEXT(self, self.npts_high_tcl.GetId(), self._on_text) 
    14851564        msg_hint = "Number of Q points to consider" 
     
    14871566        self.npts_high_tcl.SetToolTipString(msg_hint) 
    14881567        power_txt = wx.StaticText(self, -1, 'Power') 
    1489         self.power_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1),name='power_high_tcl') 
     1568        self.power_high_tcl = InvTextCtrl(self, -1, size=(_BOX_WIDTH*2/3, -1), 
     1569                                          name='power_high_tcl') 
    14901570        wx.EVT_TEXT(self, self.power_high_tcl.GetId(), self._on_text) 
    14911571        power_hint_txt = "Exponent to apply to the Power_law function." 
     
    14931573        iy = 0 
    14941574        ix = 0 
    1495         self.high_q_sizer.Add(self.enable_high_cbox,(iy, ix),(1,5), 
     1575        self.high_q_sizer.Add(self.enable_high_cbox, (iy, ix), (1, 5), 
    14961576                            wx.TOP|wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    14971577        iy += 1 
    14981578        ix = 0 
    1499         self.high_q_sizer.Add(npts_high_txt,(iy, ix),(1,1), 
     1579        self.high_q_sizer.Add(npts_high_txt, (iy, ix), (1, 1), 
    15001580                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    15011581        ix += 1 
    1502         self.high_q_sizer.Add(self.npts_high_tcl, (iy, ix), (1,1), 
     1582        self.high_q_sizer.Add(self.npts_high_tcl, (iy, ix), (1, 1), 
    15031583                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    15041584        iy += 2 
    15051585        ix = 0 
    1506         self.high_q_sizer.Add(self.power_law_high,(iy, ix),(1,2), 
     1586        self.high_q_sizer.Add(self.power_law_high, (iy, ix),(1, 2), 
    15071587                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    15081588        
     
    15101590        ix = 1 
    15111591        iy += 1 
    1512         self.high_q_sizer.Add(self.fix_enable_high,(iy, ix),(1,1), 
     1592        self.high_q_sizer.Add(self.fix_enable_high,(iy, ix), (1, 1), 
    15131593                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    15141594        ix += 1 
    1515         self.high_q_sizer.Add(self.fit_enable_high,(iy, ix),(1,1), 
     1595        self.high_q_sizer.Add(self.fit_enable_high,(iy, ix), (1, 1), 
    15161596                           wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    15171597        ix = 1 
    15181598        iy += 1 
    1519         self.high_q_sizer.Add(power_txt,(iy, ix),(1,1), 
     1599        self.high_q_sizer.Add(power_txt,(iy, ix), (1, 1), 
    15201600                            wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    15211601        ix += 1 
    1522         self.high_q_sizer.Add(self.power_high_tcl, (iy, ix), (1,1), 
     1602        self.high_q_sizer.Add(self.power_high_tcl, (iy, ix),  (1, 1), 
    15231603                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    15241604        self.high_extrapolation_sizer.AddMany([(self.high_q_sizer, 0,  
     
    15341614        extrapolation_min_txt = wx.StaticText(self, -1, 'Min :')   
    15351615        self.extrapolation_min_tcl = OutputTextCtrl(self, -1,  
    1536                                                 size=(_BOX_WIDTH, 20), style=0,name='extrapolation_min_tcl') 
     1616                                                size=(_BOX_WIDTH, 20), style=0, 
     1617                                                name='extrapolation_min_tcl') 
    15371618        self.extrapolation_min_tcl.SetValue(str(Q_MINIMUM)) 
    1538         self.extrapolation_min_tcl.SetToolTipString("The minimum extrapolated q value.") 
     1619        hint_msg = "The minimum extrapolated q value." 
     1620        self.extrapolation_min_tcl.SetToolTipString(hint_msg) 
    15391621        extrapolation_max_txt = wx.StaticText(self, -1, 'Max :')  
    15401622        self.extrapolation_max_tcl = OutputTextCtrl(self, -1, 
    1541                                                   size=(_BOX_WIDTH, 20), style=0,name='extrapolation_max_tcl')  
     1623                                                  size=(_BOX_WIDTH, 20), 
     1624                                                  style=0, 
     1625                                                  name='extrapolation_max_tcl')  
    15421626        self.extrapolation_max_tcl.SetValue(str(Q_MAXIMUM)) 
    1543         self.extrapolation_max_tcl.SetToolTipString("The maximum extrapolated q value.") 
    1544         self.extrapolation_range_sizer.AddMany([(extra_hint_txt, 0, wx.LEFT, 10), 
    1545                                                 (extrapolation_min_txt, 0, wx.LEFT, 10), 
     1627        hint_msg = "The maximum extrapolated q value." 
     1628        self.extrapolation_max_tcl.SetToolTipString(hint_msg) 
     1629        self.extrapolation_range_sizer.AddMany([(extra_hint_txt, 0,  
     1630                                                 wx.LEFT, 10), 
     1631                                                (extrapolation_min_txt, 0, 
     1632                                                 wx.LEFT, 10), 
    15461633                                                (self.extrapolation_min_tcl, 
    15471634                                                            0, wx.LEFT, 10), 
    1548                                                 (extrapolation_max_txt, 0, wx.LEFT, 10), 
     1635                                                (extrapolation_max_txt, 0, 
     1636                                                 wx.LEFT, 10), 
    15491637                                                (self.extrapolation_max_tcl, 
    15501638                                                            0, wx.LEFT, 10), 
     
    15691657        uncertainty = "+/-"  
    15701658        volume_txt = wx.StaticText(self, -1, 'Volume Fraction      ') 
    1571         self.volume_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='volume_tcl') 
     1659        self.volume_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, -1), 
     1660                                         name='volume_tcl') 
    15721661        wx.EVT_TEXT(self, self.volume_tcl.GetId(), self._on_out_text) 
    15731662        self.volume_tcl.SetToolTipString("Volume fraction.") 
    1574         self.volume_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='volume_err_tcl') 
     1663        self.volume_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, -1), 
     1664                                             name='volume_err_tcl') 
    15751665        wx.EVT_TEXT(self, self.volume_err_tcl.GetId(), self._on_out_text) 
    1576         self.volume_err_tcl.SetToolTipString("Uncertainty on the volume fraction.") 
     1666        hint_msg = "Uncertainty on the volume fraction." 
     1667        self.volume_err_tcl.SetToolTipString(hint_msg) 
    15771668        volume_units_txt = wx.StaticText(self, -1, unit_volume) 
    15781669         
    15791670        surface_txt = wx.StaticText(self, -1, 'Specific Surface') 
    1580         self.surface_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='surface_tcl') 
     1671        self.surface_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, -1), 
     1672                                          name='surface_tcl') 
    15811673        wx.EVT_TEXT(self, self.surface_tcl.GetId(), self._on_out_text) 
    15821674        self.surface_tcl.SetToolTipString("Specific surface value.") 
    1583         self.surface_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='surface_err_tcl') 
     1675        self.surface_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH, -1), 
     1676                                              name='surface_err_tcl') 
    15841677        wx.EVT_TEXT(self, self.surface_err_tcl.GetId(), self._on_out_text) 
    1585         self.surface_err_tcl.SetToolTipString("Uncertainty on the specific surface.") 
     1678        hint_msg = "Uncertainty on the specific surface." 
     1679        self.surface_err_tcl.SetToolTipString(hint_msg) 
    15861680        surface_units_txt = wx.StaticText(self, -1, unit_surface) 
    15871681        iy = 0 
    15881682        ix = 0 
    1589         self.volume_surface_sizer.Add(volume_txt, (iy, ix), (1,1), 
     1683        self.volume_surface_sizer.Add(volume_txt, (iy, ix), (1, 1), 
    15901684                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    15911685        ix += 1 
    1592         self.volume_surface_sizer.Add(self.volume_tcl, (iy, ix), (1,1), 
     1686        self.volume_surface_sizer.Add(self.volume_tcl, (iy, ix), (1, 1), 
    15931687                            wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    15941688        ix += 1 
     
    15961690                         (iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 10)  
    15971691        ix += 1 
    1598         self.volume_surface_sizer.Add(self.volume_err_tcl, (iy, ix), (1,1), 
     1692        self.volume_surface_sizer.Add(self.volume_err_tcl, (iy, ix), (1, 1), 
    15991693                            wx.EXPAND|wx.ADJUST_MINSIZE, 10)  
    16001694        ix += 1 
    1601         self.volume_surface_sizer.Add(volume_units_txt, (iy, ix), (1,1), 
     1695        self.volume_surface_sizer.Add(volume_units_txt, (iy, ix), (1, 1), 
    16021696                             wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    16031697        iy += 1 
    16041698        ix = 0 
    1605         self.volume_surface_sizer.Add(surface_txt, (iy, ix), (1,1), 
     1699        self.volume_surface_sizer.Add(surface_txt, (iy, ix), (1, 1), 
    16061700                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    16071701        ix += 1 
    1608         self.volume_surface_sizer.Add(self.surface_tcl, (iy, ix), (1,1), 
     1702        self.volume_surface_sizer.Add(self.surface_tcl, (iy, ix), (1, 1), 
    16091703                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    16101704        ix += 1 
     
    16121706                         (iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
    16131707        ix += 1 
    1614         self.volume_surface_sizer.Add(self.surface_err_tcl, (iy, ix), (1,1), 
     1708        self.volume_surface_sizer.Add(self.surface_err_tcl, (iy, ix), (1, 1), 
    16151709                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
    16161710        ix += 1 
    1617         self.volume_surface_sizer.Add(surface_units_txt, (iy, ix), (1,1), 
     1711        self.volume_surface_sizer.Add(surface_units_txt, (iy, ix), (1, 1), 
    16181712                            wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    16191713         
     
    16251719        unit_invariant = '[1/(cm * A)]' 
    16261720        invariant_total_txt = wx.StaticText(self, -1, 'Invariant Total [Q*]') 
    1627         self.invariant_total_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='invariant_total_tcl') 
     1721        self.invariant_total_tcl = OutputTextCtrl(self, -1, 
     1722                                                  size=(_BOX_WIDTH,-1), 
     1723                                                  name='invariant_total_tcl') 
    16281724        msg_hint = "Total invariant [Q*], including extrapolated regions." 
    16291725        self.invariant_total_tcl.SetToolTipString(msg_hint) 
    1630         self.invariant_total_err_tcl = OutputTextCtrl(self, -1, size=(_BOX_WIDTH,-1),name='invariant_total_err_tcl') 
    1631         self.invariant_total_err_tcl.SetToolTipString("Uncertainty on invariant.") 
     1726        self.invariant_total_err_tcl = OutputTextCtrl(self, -1, 
     1727                                                      size=(_BOX_WIDTH,-1), 
     1728                                                name='invariant_total_err_tcl') 
     1729        hint_msg = "Uncertainty on invariant." 
     1730        self.invariant_total_err_tcl.SetToolTipString(hint_msg) 
    16321731        invariant_total_units_txt = wx.StaticText(self, -1, unit_invariant) 
    16331732     
     
    16351734        iy = 0 
    16361735        ix = 0 
    1637         self.invariant_sizer.Add(invariant_total_txt, (iy, ix), (1,1), 
     1736        self.invariant_sizer.Add(invariant_total_txt, (iy, ix), (1, 1), 
    16381737                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    16391738        ix += 1 
    1640         self.invariant_sizer.Add(self.invariant_total_tcl, (iy, ix), (1,1), 
     1739        self.invariant_sizer.Add(self.invariant_total_tcl, (iy, ix), (1, 1), 
    16411740                          wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    16421741        ix += 1 
     
    16441743                         (iy, ix),(1,1),wx.EXPAND|wx.ADJUST_MINSIZE, 10)  
    16451744        ix += 1 
    1646         self.invariant_sizer.Add(self.invariant_total_err_tcl, (iy, ix), (1,1), 
     1745        self.invariant_sizer.Add(self.invariant_total_err_tcl, (iy, ix), (1, 1), 
    16471746                             wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    16481747        ix += 1 
    1649         self.invariant_sizer.Add(invariant_total_units_txt,(iy, ix), (1,1), 
     1748        self.invariant_sizer.Add(invariant_total_units_txt,(iy, ix), (1, 1), 
    16501749                          wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    16511750  
     
    16751774        #compute button 
    16761775        id = wx.NewId() 
    1677         self.button_calculate = wx.Button(self, id, "Compute", name ='compute_invariant' ) 
     1776        self.button_calculate = wx.Button(self, id, "Compute", 
     1777                                          name='compute_invariant') 
    16781778        self.button_calculate.SetToolTipString("Compute invariant") 
    16791779        self.Bind(wx.EVT_BUTTON, self.compute_invariant, id=id)    
     
    16811781        id = wx.NewId() 
    16821782        self.button_details = wx.Button(self, id, "Details?") 
    1683         self.button_details.SetToolTipString("Details about the results of the computation") 
     1783        hint_msg = "Details about the results of the computation" 
     1784        self.button_details.SetToolTipString(hint_msg) 
    16841785        self.Bind(wx.EVT_BUTTON, self.display_details, id=id) 
    16851786        details = "Details on Invariant Total Calculations" 
     
    16891790                                    wx.RIGHT|wx.BOTTOM|wx.TOP, 10), 
    16901791                                   (self.button_details, 0 , wx.ALL, 10), 
    1691                         (self.button_calculate, 0 , wx.RIGHT|wx.TOP|wx.BOTTOM, 10)])#, 
     1792                        (self.button_calculate, 0 , 
     1793                         wx.RIGHT|wx.TOP|wx.BOTTOM, 10)])#, 
    16921794                                   #(self.button_undo, 0 , wx.ALL, 10), 
    16931795                                   #(self.button_redo, 0 , wx.ALL, 10)]) 
     
    17061808        #undo button 
    17071809        id = wx.NewId() 
    1708         self.button_undo = wx.BitmapButton(self, id,wx.Bitmap(self.undo_png))#wx.Button(self, id, "Undo",size=(50,20)) 
     1810        #wx.Button(self, id, "Undo",size=(50,20)) 
     1811        self.button_undo = wx.BitmapButton(self, id,wx.Bitmap(self.undo_png)) 
    17091812        self.button_undo.SetToolTipString("Undo") 
    17101813         
     
    17141817        #redo button 
    17151818        id = wx.NewId() 
    1716         self.button_redo = wx.BitmapButton(self, id,wx.Bitmap(self.redo_png))#wx.Button(self, id, "Redo",size=(50,20)) 
     1819        #wx.Button(self, id, "Redo",size=(50,20)) 
     1820        self.button_redo = wx.BitmapButton(self, id,wx.Bitmap(self.redo_png)) 
    17171821        self.button_redo.SetToolTipString("Redo") 
    17181822        self.Bind(wx.EVT_BUTTON, self.redo, id=id) 
     
    17201824        #bookmark button 
    17211825        id = wx.NewId() 
    1722         self.button_bookmark = wx.BitmapButton(self, id,wx.Bitmap(self.bookmark_png))#wx.Button(self, id, "Undo",size=(50,20)) 
    1723         self.button_bookmark.SetToolTipString("Bookmark: right-click on the panel to retrieve it") 
     1826        #wx.Button(self, id, "Undo",size=(50,20)) 
     1827        self.button_bookmark = wx.BitmapButton(self, id, 
     1828                                               wx.Bitmap(self.bookmark_png)) 
     1829        hint_msg = "Bookmark: right-click on the panel to retrieve it" 
     1830        self.button_bookmark.SetToolTipString(hint_msg) 
    17241831        self.Bind(wx.EVT_BUTTON, self._on_bookmark, id=id) 
    17251832        #report button 
    17261833        id = wx.NewId() 
    1727         self.button_report = wx.BitmapButton(self, id,wx.Bitmap(self.report_png))#wx.Button(self, id, "Redo",size=(50,20)) 
    1728         self.button_report.SetToolTipString("Report the result of the computation") 
     1834        #wx.Button(self, id, "Redo",size=(50,20)) 
     1835        self.button_report = wx.BitmapButton(self, id, 
     1836                                             wx.Bitmap(self.report_png)) 
     1837        hint_msg = "Report the result of the computation" 
     1838        self.button_report.SetToolTipString(hint_msg) 
    17291839        self.Bind(wx.EVT_BUTTON, self.report, id=id) 
    17301840        #self.button_report.Disable()    
    17311841        #save button 
    17321842        id = wx.NewId() 
    1733         self.button_save = wx.BitmapButton(self, id,wx.Bitmap(self.save_png), name ='Save_invariant')#wx.Button(self, id, "Save", name ='Save_invariant' ) 
     1843        #wx.Button(self, id, "Save", name ='Save_invariant' ) 
     1844        self.button_save = wx.BitmapButton(self, id, wx.Bitmap(self.save_png), 
     1845                                           name='Save_invariant') 
    17341846        self.button_save.SetToolTipString("Save as a file") 
    17351847        self.Bind(wx.EVT_BUTTON, self._on_save_button, id=id)    
    17361848        self.button_save.Disable()   
    1737         self.save_button_sizer.AddMany([((PANEL_WIDTH/2,20), 1 , wx.EXPAND|wx.ADJUST_MINSIZE,0), 
    1738                                    (self.button_undo, 0 ,wx.LEFT|wx.ADJUST_MINSIZE, 10), 
    1739                                    (self.button_redo, 0 ,wx.LEFT|wx.ADJUST_MINSIZE, 10), 
    1740                                    (self.button_bookmark, 0 ,wx.LEFT|wx.ADJUST_MINSIZE, 10), 
    1741                                    (self.button_report, 0 ,wx.LEFT|wx.ADJUST_MINSIZE, 10), 
    1742                                    (self.button_save, 0 ,wx.LEFT|wx.ADJUST_MINSIZE, 10)])         
     1849        self.save_button_sizer.AddMany([((PANEL_WIDTH/2,20), 1 , 
     1850                                         wx.EXPAND|wx.ADJUST_MINSIZE,0), 
     1851                                   (self.button_undo, 0 , 
     1852                                    wx.LEFT|wx.ADJUST_MINSIZE, 10), 
     1853                                   (self.button_redo, 0 , 
     1854                                    wx.LEFT|wx.ADJUST_MINSIZE, 10), 
     1855                                   (self.button_bookmark, 0 , 
     1856                                    wx.LEFT|wx.ADJUST_MINSIZE, 10), 
     1857                                   (self.button_report, 0 , 
     1858                                    wx.LEFT|wx.ADJUST_MINSIZE, 10), 
     1859                                   (self.button_save, 0 , 
     1860                                    wx.LEFT|wx.ADJUST_MINSIZE, 10)])         
    17431861    def _do_layout(self): 
    17441862        """ 
     
    17811899    """ 
    17821900    """ 
    1783     def __init__(self, parent=None, id=1,graph=None,  
    1784                  data=None, title="Invariant",base=None): 
     1901    def __init__(self, parent=None, id=1, graph=None,  
     1902                 data=None, title="Invariant", base=None): 
    17851903         
    17861904        wx.Frame.__init__(self, parent, id, title, size=(PANEL_WIDTH +100, 
     
    17891907        self.loader = Loader() 
    17901908        import invariant 
    1791  
    1792         data= self.loader.load("C:/ECLPS/workspace/trunk/DataLoader/test/ascii_test_3.txt") 
     1909        path = "C:/ECLPS/workspace/trunk/DataLoader/test/ascii_test_3.txt" 
     1910        data= self.loader.load(path) 
    17931911        self.panel = InvariantPanel(self) 
    17941912 
Note: See TracChangeset for help on using the changeset viewer.