Changeset e95614e in sasview


Ignore:
Timestamp:
Jul 12, 2012 1:50:52 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
be1ec9f
Parents:
699df7f
Message:

resol_panel: pylint fix#1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/resolution_calculator_panel.py

    rb025572 re95614e  
    2626from sans.calculator.resolution_calculator import ResolutionCalculator  
    2727from sans.guiframe.events import StatusEvent   
    28 from calculator_widgets import OutputTextCtrl 
    29 from calculator_widgets import InputTextCtrl 
     28from sans.perspectives.calculator.calculator_widgets import OutputTextCtrl 
     29from sans.perspectives.calculator.calculator_widgets import InputTextCtrl 
    3030from wx.lib.scrolledpanel import ScrolledPanel 
    3131from math import fabs 
     
    6363     
    6464    def __init__(self, parent,  *args, **kwds): 
    65         kwds["size"]= (PANEL_WIDTH * 2, PANEL_HEIGHT) 
    66         kwds["style"]= wx.FULL_REPAINT_ON_RESIZE 
     65        kwds["size"] = (PANEL_WIDTH * 2, PANEL_HEIGHT) 
     66        kwds["style"] = wx.FULL_REPAINT_ON_RESIZE 
    6767        ScrolledPanel.__init__(self, parent, *args, **kwds) 
    6868        self.SetupScrolling() 
     
    8383        self.image = None 
    8484        # results of sigmas 
    85         self.sigma_strings =' ' 
     85        self.sigma_strings = ' ' 
    8686        #Font size  
    8787        self.SetWindowVariant(variant=FONT_VARIANT) 
     
    149149        source_list.sort() 
    150150        for idx in range(len(source_list)): 
    151             self.source_cb.Append(source_list[idx],idx) 
     151            self.source_cb.Append(source_list[idx], idx) 
    152152        self.source_cb.SetStringSelection("Neutron")  
    153         wx.EVT_COMBOBOX(self.source_cb,-1, self._on_source_selection)  
     153        wx.EVT_COMBOBOX(self.source_cb, -1, self._on_source_selection)  
    154154         
    155155        # combo box for color 
     
    161161        self.wave_color_cb.Append('TOF') 
    162162        self.wave_color_cb.SetStringSelection("Monochromatic")  
    163         wx.EVT_COMBOBOX(self.wave_color_cb,-1, self._on_source_color)  
     163        wx.EVT_COMBOBOX(self.wave_color_cb, -1, self._on_source_color)  
    164164         
    165165        source_hint = "Source Selection: Affect on" 
     
    273273                                               wx.LEFT, 15), 
    274274                                (self.source_aperture_tcl, 0, wx.LEFT, 15), 
    275                                     (source_aperture_unit_txt,0, wx.LEFT, 10)])   
     275                                (source_aperture_unit_txt, 0, wx.LEFT, 10)])   
    276276 
    277277         
     
    297297                                               wx.LEFT, 15), 
    298298                                (self.sample_aperture_tcl, 0, wx.LEFT, 15), 
    299                                     (sample_aperture_unit_txt,0, wx.LEFT, 10)])   
     299                                (sample_aperture_unit_txt, 0, wx.LEFT, 10)])   
    300300 
    301301 
     
    366366                                                sample2detector_distance_hint) 
    367367        self.sample2detector_distance_sizer.AddMany([\ 
    368                             (sample2detector_distance_txt, 0, wx.LEFT, 15),         
    369                             (self.sample2detector_distance_tcl, 0, wx.LEFT, 15), 
    370                             (sample2detector_distance_unit_txt,0, wx.LEFT, 10)])   
     368                        (sample2detector_distance_txt, 0, wx.LEFT, 15),         
     369                        (self.sample2detector_distance_tcl, 0, wx.LEFT, 15), 
     370                        (sample2detector_distance_unit_txt,0, wx.LEFT, 10)])   
    371371         
    372372    def _layout_detector_size(self): 
     
    688688        self._layout_image() 
    689689        # Add a vertical static line 
    690         self.main_sizer.Add( wx.StaticLine(self, -1, (2,2),  
     690        self.main_sizer.Add( wx.StaticLine(self, -1, (2, 2),  
    691691                            (2,PANEL_HEIGHT * 0.94), style = wx.LI_VERTICAL)) 
    692692        # Add the plot to main sizer 
     
    718718        wx.CallAfter(self.on_compute_call, event) 
    719719         
    720     def on_compute_call(self, event = None): 
     720    def on_compute_call(self, event=None): 
    721721        """ 
    722722        Execute the computation of resolution 
     
    776776            sample2sample_distance = self._string2list(sample2sample_distance) 
    777777            self.resolution.set_sample2sample_distance(sample2sample_distance) 
    778             sample2detector_distance = self.sample2detector_distance_tcl.GetValue() 
    779             sample2detector_distance = self._string2list(sample2detector_distance) 
    780             self.resolution.set_sample2detector_distance(sample2detector_distance) 
     778            sample2detector_distance = \ 
     779                                self.sample2detector_distance_tcl.GetValue() 
     780            sample2detector_distance = \ 
     781                                self._string2list(sample2detector_distance) 
     782            self.resolution.set_sample2detector_distance(\ 
     783                                                    sample2detector_distance) 
    781784            detector_size = self.detector_size_tcl.GetValue() 
    782785            detector_size = self._string2list(detector_size) 
     
    827830        # Compute and get the image plot 
    828831        try: 
    829             from sans.perspectives.calculator.resolcal_thread import CalcRes as thread 
     832            from sans.perspectives.calculator.resolcal_thread \ 
     833                                                import CalcRes as thread 
    830834            self.sigma_strings = '\nResolution: Computation is finished. \n' 
    831835            cal_res = thread(func = self._map_func, 
     
    847851        except: 
    848852            raise 
    849             msg = "An error occured during the resolution computation." 
    850             msg += "Please check your inputs..." 
    851             status_type = 'stop' 
    852             self._status_info(msg, status_type) 
    853             wx.MessageBox(msg, 'Warning') 
    854853             
    855854    def complete(self, image, elapsed=None): 
     
    911910            detector_qy_max = self.resolution.detector_qy_max 
    912911        else: 
    913             qx_min, qx_max, qy_min, qy_max = self.resolution.get_detector_qrange() 
     912            qx_min, qx_max, qy_min, qy_max = \ 
     913                                self.resolution.get_detector_qrange() 
    914914            # detector range 
    915915            detector_qx_min = self.resolution.qxmin_limit 
     
    988988                                 self.det_coordinate) 
    989989        # record sigmas 
    990         self.sigma_strings += " At Qx = %s, Qy = %s; \n"% (qx_value,qy_value) 
     990        self.sigma_strings += " At Qx = %s, Qy = %s; \n"% (qx_value, qy_value) 
    991991        self._sigma_strings() 
    992992        return image 
     
    11701170        : return new_string: string like list 
    11711171        """ 
    1172         new_string = [] 
     1172        #new_string = [] 
    11731173        msg = "Wrong format of intputs." 
    11741174        try: 
     
    12061206                #    wx.MessageBox(msg, 'Warning') 
    12071207 
    1208     def _on_xy_coordinate(self,event=None): 
     1208    def _on_xy_coordinate(self, event=None): 
    12091209        """ 
    12101210        Set the detector coordinate for sigmas to x-y coordinate 
     
    12181218        self._onparamEnter() 
    12191219         
    1220     def _on_rp_coordinate(self,event=None): 
     1220    def _on_rp_coordinate(self, event=None): 
    12211221        """ 
    12221222        Set the detector coordinate for sigmas to polar coordinate 
     
    12441244        self.compute_button.SetToolTipString(label) 
    12451245        if self.parent.parent != None: 
    1246                 wx.PostEvent(self.parent.parent,  
     1246            wx.PostEvent(self.parent.parent,  
    12471247                             StatusEvent(status = msg, type = type )) 
    12481248 
     
    13161316        """ 
    13171317        if event != None: 
    1318             combo = event.GetEventObject() 
     1318            #combo = event.GetEventObject() 
    13191319            event.Skip() 
    13201320        else: 
     
    13391339            except: 
    13401340                raise 
    1341                 msg = "Failed to load the spectrum data file." 
    1342                 wx.MessageBox(msg, 'Warning') 
    1343                 raise ValueError, "Invalid spectrum file..." 
    13441341         
    13451342        self.resolution.set_spectrum(self.spectrum_dic[selection]) 
     
    13491346        open a dialog file to select a customized spectrum 
    13501347        """ 
    1351         import os 
    13521348        dlg = wx.FileDialog(self,  
    13531349                "Choose a wavelength spectrum file: Intensity vs. wavelength", 
    1354                 self.parent.parent._default_save_location , "",  
     1350                self.parent.parent.get_save_location() , "",  
    13551351                "*.*", wx.OPEN) 
    13561352        path = None 
     
    13681364        """ 
    13691365        try: 
    1370             if path==None: 
     1366            if path == None: 
    13711367                wx.PostEvent(self.parent.parent, StatusEvent(status=\ 
    13721368                            " Selected Distribution was not loaded: %s"%path)) 
     
    13941390         
    13951391class ResolutionWindow(wx.Frame): 
     1392    """ 
     1393    Resolution Window 
     1394    """ 
    13961395    def __init__(self, parent = None, title = "SANS Resolution Estimator", 
    13971396                  size=(PANEL_WIDTH * 2, PANEL_HEIGHT), *args, **kwds): 
Note: See TracChangeset for help on using the changeset viewer.