Changeset be1ec9f in sasview


Ignore:
Timestamp:
Jul 13, 2012 4:11:26 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:
0da4eba
Parents:
e95614e
Message:

base_page: pylint cleanup#2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/basepage.py

    rd49c956 rbe1ec9f  
    6868        ## current model 
    6969        self.model = None 
     70        self.m_name = None 
    7071        self.index_model = None 
     72        self.panel = None 
    7173        ## data 
    7274        self.data = None 
     
    8890        ## total number of point: float 
    8991        self.npts = None 
     92        self.num_points = None 
    9093        ## default fitengine type 
    9194        self.engine_type = 'scipy' 
     
    125128        self.btEditMask = None 
    126129        self.btFit = None 
     130        self.sld_axes = None 
     131        self.multi_factor = None 
    127132        
    128133        self.disp_cb_dict = {} 
     
    230235            if self.model != None: 
    231236                if not self.data.is_data: 
    232                     self._manager.page_finder[self.uid].set_fit_data(data=[self.data]) 
     237                    self._manager.page_finder[self.uid].set_fit_data(data=\ 
     238                                                                [self.data]) 
    233239            self.on_smear_helper(update=True) 
    234240            self.state.enable_smearer = self.enable_smearer.GetValue() 
     
    346352                            and (self.model != None) 
    347353            sim_menu.Enable(not self.batch_on and flag) 
    348             batch_menu = self._manager.menu1.FindItemById(self._manager.id_batchfit) 
     354            batch_menu = \ 
     355                    self._manager.menu1.FindItemById(self._manager.id_batchfit) 
    349356            batch_menu.Enable(self.batch_on and flag) 
    350357     
     
    361368         
    362369        """ 
    363         ## Set to True when the mouse is clicked while the whole string is selected 
     370        ## Set to True when the mouse is clicked while whole string is selected 
    364371        full_selection = False 
    365372        ## Call back for EVT_SET_FOCUS events 
     
    431438             
    432439            event.Skip() 
    433             pass 
     440            #pass 
    434441     
    435442    def set_page_info(self, page_info): 
     
    760767        """ 
    761768        # date and time 
    762         year, month, day, hour, minute, second, tda, ty, tm_isdst \ 
    763             = time.localtime() 
     769        year, month, day, hour, minute, second, _, _, _ = time.localtime() 
    764770        current_time = str(hour) + ":" + str(minute) + ":" + str(second) 
    765771        current_date = str(month) + "/" + str(day) + "/" + str(year) 
     
    11231129                        not item in self.model.details: 
    11241130                        self.model.details[item] = ["", None, None] 
    1125                 for k, v in self.state.disp_cb_dict.iteritems(): 
    1126                     self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
    1127                     self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
     1131                self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
     1132                self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
    11281133        ## smearing info  restore 
    11291134        if hasattr(self, "enable_smearer"): 
     
    12121217            formfactor_pos = 0 
    12131218            for ind_form in range(self.formfactorbox.GetCount()): 
    1214                 if self.formfactorbox.GetString(ind_form) == (state.formfactorcombobox): 
     1219                if self.formfactorbox.GetString(ind_form) == \ 
     1220                                                    (state.formfactorcombobox): 
    12151221                    formfactor_pos = int(ind_form) 
    12161222                    break 
     
    12241230            structfactor_pos = 0 
    12251231            for ind_struct in range(self.structurebox.GetCount()): 
    1226                 if self.structurebox.GetString(ind_struct) == (state.structurecombobox): 
     1232                if self.structurebox.GetString(ind_struct) == \ 
     1233                                                    (state.structurecombobox): 
    12271234                    structfactor_pos = int(ind_struct) 
    12281235                    break 
     
    13831390        if self.parent != None: 
    13841391            self._default_save_location = \ 
    1385                         self.parent.parent._default_save_location 
     1392                        self.parent.parent.get_save_location() 
    13861393        dlg = wx.FileDialog(self, "Choose a weight file", 
    13871394                                self._default_save_location, "", 
     
    13971404        reset the context menu 
    13981405        """ 
    1399         for name, state in self.state.saved_states.iteritems(): 
     1406        for name, _ in self.state.saved_states.iteritems(): 
    14001407            self.number_saved_state += 1 
    14011408            ## Add item in the context menu 
     
    18981905        x, y = self.model.getProfile() 
    18991906 
    1900         from danse.common.plottools import Data1D 
     1907        from danse.common.plottools import Data1D as pf_data1d 
    19011908        #from sans.perspectives.theory.profile_dialog import SLDPanel 
    19021909        from sans.guiframe.local_perspectives.plotting.profile_dialog \ 
    19031910        import SLDPanel 
    1904         sld_data = Data1D(x, y) 
     1911        sld_data = pf_data1d(x, y) 
    19051912        sld_data.name = 'SLD' 
    19061913        sld_data.axes = self.sld_axes 
     
    20162023        wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    20172024        # Flag to register when a parameter has changed. 
    2018         is_modified = False 
     2025        #is_modified = False 
    20192026        if tcrtl.GetValue().lstrip().rstrip() != "": 
    20202027            try: 
    2021                 value = float(tcrtl.GetValue()) 
     2028                float(tcrtl.GetValue()) 
    20222029                tcrtl.SetBackgroundColour(wx.WHITE) 
    20232030                # If qmin and qmax have been modified, update qmin and qmax 
     
    20452052                    if temp_npts != self.num_points: 
    20462053                        self.num_points = temp_npts 
    2047                         is_modified = True 
     2054                        #is_modified = True 
    20482055                else: 
    20492056                    msg = "Cannot Plot :No npts in that Qrange!!!  " 
     
    21462153        if form_factor != None: 
    21472154            # set multifactor for Mutifunctional models 
    2148             if form_factor().__class__ in self.model_list_box["Multi-Functions"]: 
     2155            if form_factor().__class__ in \ 
     2156                                        self.model_list_box["Multi-Functions"]: 
    21492157                m_id = self.multifactorbox.GetCurrentSelection() 
    21502158                multiplicity = form_factor().multiplicity_info[0] 
     
    21672175                # Check len of the text1 and max_multiplicity 
    21682176                text = '' 
    2169                 if form_factor.multiplicity_info[0] == len(form_factor.multiplicity_info[2]): 
     2177                if form_factor.multiplicity_info[0] == \ 
     2178                                        len(form_factor.multiplicity_info[2]): 
    21702179                    text = form_factor.multiplicity_info[2][self.multi_factor] 
    21712180                self.mutifactor_text1.SetLabel(text) 
     
    22732282                self.qmax.SetBackgroundColour("pink") 
    22742283                self.qmax.Refresh() 
    2275                 msg = "Npts of Data Error :No or too little npts of %s." % data.name 
     2284                msg = "Npts of Data Error :" 
     2285                msg += "No or too little npts of %s." % data.name 
    22762286                wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 
    22772287                self.fitrange = False 
     
    23072317                self.qmax.SetBackgroundColour("pink") 
    23082318                self.qmax.Refresh() 
    2309                 msg = "Npts of Data Error :No or too little npts of %s." % data.name 
     2319                msg = "Npts of Data Error :" 
     2320                msg += "No or too little npts of %s." % data.name 
    23102321                wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 
    23112322                self.fitrange = False 
     
    23892400                 
    23902401                if name in self.model.details.keys(): 
    2391                         self.model.details[name][1:3] = param_min, param_max 
    2392                         is_modified = True 
     2402                    self.model.details[name][1:3] = param_min, param_max 
     2403                    is_modified = True 
    23932404                else: 
    2394                         self.model.details[name] = ["", param_min, param_max] 
    2395                         is_modified = True 
     2405                    self.model.details[name] = ["", param_min, param_max] 
     2406                    is_modified = True 
    23962407            try: 
    23972408                # Check if the textctr is enabled 
     
    27072718        #so that 
    27082719        # it's not lost when we use the model within another thread. 
    2709         #TODO: total hack - fix this 
    27102720        self.state.model = self.model.clone() 
    27112721        self.model._persistency_dict[name.split('.')[0]] = \ 
     
    28462856         
    28472857        : return graphs: list of figures 
    2848         : TODO: Move to guiframe 
     2858        : Need Move to guiframe 
    28492859        """ 
    28502860        # set list of graphs 
     
    28542864        gui_manager = self.parent.parent 
    28552865        # loops through the panels [dic] 
    2856         for item1, item2 in gui_manager.plot_panels.iteritems(): 
     2866        for _, item2 in gui_manager.plot_panels.iteritems(): 
    28572867            data_title = self.data.group_id 
    28582868            # try to get all plots belonging to this control panel 
     
    28742884        on 'More details' button 
    28752885        """ 
    2876         from help_panel import  HelpWindow 
     2886        from sans.perspectives.fitting.help_panel import  HelpWindow 
    28772887        from sans.models import get_data_path 
    28782888         
     
    29222932        # Figuring out key combo: Cmd for copy, Alt for paste 
    29232933        if event.CmdDown() and event.ShiftDown(): 
    2924             flag = self.get_paste() 
     2934            self.get_paste() 
    29252935        elif event.CmdDown(): 
    2926             flag = self.get_copy() 
     2936            self.get_copy() 
    29272937        else: 
    29282938            event.Skip() 
     
    29492959             
    29502960            # go through the parameters 
    2951             string = self._get_copy_helper(self.parameters, 
     2961            strings = self._get_copy_helper(self.parameters, 
    29522962                                           self.orientation_params) 
    2953             content += string 
     2963            content += strings 
    29542964             
    29552965            # go through the fittables 
    2956             string = self._get_copy_helper(self.fittable_param, 
     2966            strings = self._get_copy_helper(self.fittable_param, 
    29572967                                           self.orientation_params_disp) 
    2958             content += string 
     2968            content += strings 
    29592969 
    29602970            # go through the fixed params 
    2961             string = self._get_copy_helper(self.fixed_param, 
     2971            strings = self._get_copy_helper(self.fixed_param, 
    29622972                                           self.orientation_params_disp) 
    2963             content += string 
     2973            content += strings 
    29642974                 
    29652975            # go through the str params 
    2966             string = self._get_copy_helper(self.str_parameters, 
     2976            strings = self._get_copy_helper(self.str_parameters, 
    29672977                                           self.orientation_params) 
    2968             content += string 
     2978            content += strings 
    29692979            return content 
    29702980        else: 
     
    30273037                 
    30283038                disfunc = ',' + disfunc 
    3029             # TODO: to support array func for copy/paste 
     3039            # Need to support array func for copy/paste 
    30303040            try: 
    30313041                if disfunc.count('array') > 0: 
     
    30523062                data = wx.TextDataObject() 
    30533063                # get wx dataobject 
    3054                 success = wx.TheClipboard.GetData(data) 
     3064                #success = wx.TheClipboard.GetData(data) 
    30553065                # get text 
    30563066                text = data.GetText() 
     
    32693279        """ 
    32703280            Method to be called by sub-classes 
    3271             TODO: this method doesn't belong here 
     3281            Moveit; This method doesn't belong here 
    32723282        """ 
    32733283        print "BasicPage.update_pinhole_smear was called: skipping" 
Note: See TracChangeset for help on using the changeset viewer.