Changeset 235f514 in sasview for src/sas/sasgui/perspectives


Ignore:
Timestamp:
Apr 9, 2017 3:46:10 AM (7 years ago)
Author:
andyfaff
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ac07a3a
Parents:
5b2b04d
Message:

MAINT: replace '== None' by 'is None'

Location:
src/sas/sasgui/perspectives
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/calculator.py

    r959eb01 r235f514  
    9393        Edit meta data 
    9494        """ 
    95         if self.data_edit_frame == None: 
     95        if self.data_edit_frame is None: 
    9696            self.data_edit_frame = DataEditorWindow(parent=self.parent, 
    9797                                                    manager=self, data=[], 
     
    106106        Data operation 
    107107        """ 
    108         if self.data_operator_frame == None: 
     108        if self.data_operator_frame is None: 
    109109            # Use one frame all the time 
    110110            self.data_operator_frame = DataOperatorWindow(parent=self.parent, 
     
    121121        Compute the Kiessig thickness 
    122122        """ 
    123         if self.kiessig_frame == None: 
     123        if self.kiessig_frame is None: 
    124124            frame = KiessigWindow(parent=self.parent, manager=self) 
    125125            self.put_icon(frame) 
     
    133133        Compute the scattering length density of molecula 
    134134        """ 
    135         if self.sld_frame == None: 
     135        if self.sld_frame is None: 
    136136            frame = SldWindow(parent=self.parent, 
    137137                                  base=self.parent, manager=self) 
     
    146146        Compute the mass density or molar voulme 
    147147        """ 
    148         if self.cal_md_frame == None: 
     148        if self.cal_md_frame is None: 
    149149            frame = DensityWindow(parent=self.parent, 
    150150                                  base=self.parent, manager=self) 
     
    159159        Compute the slit size a given data 
    160160        """ 
    161         if self.cal_slit_frame == None: 
     161        if self.cal_slit_frame is None: 
    162162            frame = SlitLengthCalculatorWindow(parent=self.parent, manager=self) 
    163163            self.put_icon(frame) 
     
    171171        Estimate the instrumental resolution 
    172172        """ 
    173         if self.cal_res_frame == None: 
     173        if self.cal_res_frame is None: 
    174174            frame = ResolutionWindow(parent=self.parent, manager=self) 
    175175            self.put_icon(frame) 
     
    183183        On Generic model menu event 
    184184        """ 
    185         if self.gen_frame == None: 
     185        if self.gen_frame is None: 
    186186            frame = SasGenWindow(parent=self.parent, manager=self) 
    187187            self.put_icon(frame) 
     
    214214        :param filename: file name to open in editor 
    215215        """ 
    216         if self.py_frame == None: 
     216        if self.py_frame is None: 
    217217            frame = PyConsole(parent=self.parent, base=self, 
    218218                              filename=filename) 
  • src/sas/sasgui/perspectives/calculator/data_editor.py

    r959eb01 r235f514  
    419419        """ 
    420420        path = None 
    421         if location == None: 
     421        if location is None: 
    422422            location = os.getcwd() 
    423423 
  • src/sas/sasgui/perspectives/calculator/data_operator.py

    r959eb01 r235f514  
    198198        self.send_warnings('') 
    199199        msg = '' 
    200         if name == None: 
     200        if name is None: 
    201201            text = self.data_namectr.GetValue().strip() 
    202202        else: 
     
    205205        name_list = [] 
    206206        for state in state_list: 
    207             if state.data == None: 
     207            if state.data is None: 
    208208                theory_list = state.get_theory() 
    209209                theory, _ = theory_list.values()[0] 
     
    278278        pos = item.GetCurrentSelection() 
    279279        data = item.GetClientData(pos) 
    280         if data == None: 
     280        if data is None: 
    281281            content = "?" 
    282282            self.put_text_pic(self.data1_pic, content) 
     
    313313        content = "?" 
    314314        if not (self.numberctr.IsShown() and self.numberctr.IsEnabled()): 
    315             if data == None: 
     315            if data is None: 
    316316                content = "?" 
    317317                self.put_text_pic(self.data2_pic, content) 
     
    355355        pos1 = self.data1_cbox.GetCurrentSelection() 
    356356        data1 = self.data1_cbox.GetClientData(pos1) 
    357         if data1 == None: 
     357        if data1 is None: 
    358358            self.output = None 
    359359            return flag 
     
    361361        data2 = self.data2_cbox.GetClientData(pos2) 
    362362 
    363         if data2 == None: 
     363        if data2 is None: 
    364364            self.output = None 
    365365            return flag 
     
    422422        """ 
    423423        out = self.out_pic 
    424         if output == None: 
     424        if output is None: 
    425425            content = "?" 
    426426            self.put_text_pic(out, content) 
     
    592592        name_list = [] 
    593593        for state in state_list: 
    594             if state.data == None: 
     594            if state.data is None: 
    595595                theory_list = state.get_theory() 
    596596                theory, _ = theory_list.values()[0] 
     
    609609            wx.MessageBox(msg, 'Error') 
    610610            return 
    611         if self.output == None: 
     611        if self.output is None: 
    612612            msg = "No Output Data has been generated...   " 
    613613            wx.MessageBox(msg, 'Error') 
  • src/sas/sasgui/perspectives/calculator/density_panel.py

    r959eb01 r235f514  
    239239        update units and output combobox 
    240240        """ 
    241         if event == None: 
     241        if event is None: 
    242242            return 
    243243        event.Skip() 
     
    257257        update units and input combobox 
    258258        """ 
    259         if event == None: 
     259        if event is None: 
    260260            return 
    261261        event.Skip() 
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    r959eb01 r235f514  
    487487        path = None 
    488488        filename = '' 
    489         if location == None: 
     489        if location is None: 
    490490            location = os.getcwd() 
    491491 
     
    864864            return 
    865865        self.sld_data = self.parent.get_sld_from_omf() 
    866         if self.sld_data == None: 
     866        if self.sld_data is None: 
    867867            if self.parent.parent != None: 
    868868                infor = 'Error' 
     
    880880            self.model.set_sld_data(self.sld_data) 
    881881            self.set_input_params() 
    882             if self.is_avg or self.is_avg == None: 
     882            if self.is_avg or self.is_avg is None: 
    883883                self._create_default_1d_data() 
    884884                i_out = np.zeros(len(self.data.y)) 
     
    979979        Update the progress bar 
    980980        """ 
    981         if self.parent.parent == None: 
     981        if self.parent.parent is None: 
    982982            return 
    983983        type = "progress" 
     
    10101010                out = np.append(out, outi) 
    10111011        #print time.time() - s 
    1012         if self.is_avg or self.is_avg == None: 
     1012        if self.is_avg or self.is_avg is None: 
    10131013            self._draw1D(out) 
    10141014        else: 
     
    12871287            key_low = key.lower() 
    12881288            if key_low.count('mx') > 0: 
    1289                 if sld_sets[key] == None: 
     1289                if sld_sets[key] is None: 
    12901290                    sld_sets[key] = self.sld_data.sld_mx 
    12911291                mx = sld_sets[key] 
    12921292            elif key_low.count('my') > 0: 
    1293                 if sld_sets[key] == None: 
     1293                if sld_sets[key] is None: 
    12941294                    sld_sets[key] = self.sld_data.sld_my 
    12951295                my = sld_sets[key] 
    12961296            elif key_low.count('mz') > 0: 
    1297                 if sld_sets[key] == None: 
     1297                if sld_sets[key] is None: 
    12981298                    sld_sets[key] = self.sld_data.sld_mz 
    12991299                mz = sld_sets[key] 
     
    13681368        """ 
    13691369 
    1370         if omfdata == None: 
     1370        if omfdata is None: 
    13711371            self._set_none_text() 
    13721372            return 
     
    14371437        self.slds = [] 
    14381438        omfdata = self.sld_data 
    1439         if omfdata == None: 
     1439        if omfdata is None: 
    14401440            raise 
    14411441        sld_key_list = self._get_slds_key_list(omfdata) 
     
    14771477        self.nodes = [] 
    14781478        omfdata = self.sld_data 
    1479         if omfdata == None: 
     1479        if omfdata is None: 
    14801480            raise 
    14811481        key_list = self._get_nodes_key_list(omfdata) 
     
    15121512        self.stepsize = [] 
    15131513        omfdata = self.sld_data 
    1514         if omfdata == None: 
     1514        if omfdata is None: 
    15151515            raise 
    15161516        key_list = self._get_step_key_list(omfdata) 
     
    16311631        Set sld textctrls 
    16321632        """ 
    1633         if sld_data == None: 
     1633        if sld_data is None: 
    16341634            for ctr_list in self.slds: 
    16351635                ctr_list[1].Enable(False) 
     
    17391739            if npts > 0: 
    17401740                nop = self.set_npts_from_slddata() 
    1741                 if nop == None: 
     1741                if nop is None: 
    17421742                    nop = npts 
    17431743                self.display_npts(nop) 
     
    19111911        Set omfdata 
    19121912        """ 
    1913         if data == None: 
     1913        if data is None: 
    19141914            return 
    19151915        self.sld_data = data 
    1916         enable = (not data == None) 
     1916        enable = (not data is None) 
    19171917        self._set_omfpanel_sld_data(self.sld_data) 
    19181918        self.omfpanel.bt_save.Enable(enable) 
  • src/sas/sasgui/perspectives/calculator/image_viewer.py

    r959eb01 r235f514  
    8585        """ 
    8686        path = None 
    87         if location == None: 
     87        if location is None: 
    8888            location = os.getcwd() 
    8989        dlg = wx.FileDialog(self.parent, "Image Viewer: Choose a image file", 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    r959eb01 r235f514  
    13881388 
    13891389    def _get_upper_name(self, name=None): 
    1390         if name == None: 
     1390        if name is None: 
    13911391            return "" 
    13921392        upper_name = "" 
  • src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py

    r959eb01 r235f514  
    839839        : Param image: pylab object 
    840840        """ 
    841         if image == None: 
     841        if image is None: 
    842842            return 
    843843        if color == 'g': 
     
    973973        if len(qx) != len(qy): 
    974974            return None 
    975         if qx == None or qy == None: 
     975        if qx is None or qy is None: 
    976976            return None 
    977977        return qx, qy 
     
    12611261        if selection == 'Add new': 
    12621262            path = self._selectDlg() 
    1263             if path == None: 
     1263            if path is None: 
    12641264                self.spectrum_cb.SetValue('Flat') 
    12651265                self.resolution.set_spectrum(self.spectrum_dic['Flat']) 
     
    13011301        """ 
    13021302        try: 
    1303             if path == None: 
     1303            if path is None: 
    13041304                wx.PostEvent(self.parent.parent, StatusEvent(status=\ 
    13051305                            " Selected Distribution was not loaded: %s" % path)) 
  • src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py

    rd0248bd r235f514  
    157157        path = None 
    158158        filename = '' 
    159         if location == None: 
     159        if location is None: 
    160160            location = os.getcwd() 
    161161 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r463e7ffc r235f514  
    327327        if datainfo.title is None or datainfo.title == '': 
    328328            datainfo.title = datainfo.name 
    329         if datainfo.run_name == None or datainfo.run_name == '': 
     329        if datainfo.run_name is None or datainfo.run_name == '': 
    330330            datainfo.run = [str(datainfo.name)] 
    331331            datainfo.run_name[0] = datainfo.name 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r9c0f3c17 r235f514  
    386386        help for setting list of the edit model menu labels 
    387387        """ 
    388         if menu == None: 
     388        if menu is None: 
    389389            menu = self.edit_custom_model 
    390390        list_fnames = os.listdir(models.find_plugins_dir()) 
     
    11251125        page = self.fit_panel.set_data(data) 
    11261126        # page could be None when loading state files 
    1127         if page == None: 
     1127        if page is None: 
    11281128            return page 
    11291129        #append Data1D to the panel containing its theory 
     
    11931193        """ 
    11941194        # case that uid is not specified 
    1195         if uid == None: 
     1195        if uid is None: 
    11961196            for page_id in self.page_finder.keys(): 
    11971197                self.page_finder[page_id].schedule_tofit(value) 
     
    12311231        """ 
    12321232        panel = self.plot_panel 
    1233         if panel == None: 
     1233        if panel is None: 
    12341234            raise ValueError, "Fitting:_onSelect: NonType panel" 
    12351235        Plugin.on_perspective(self, event=event) 
     
    13351335                if not correct_result or res.fitness is None or \ 
    13361336                    not np.isfinite(res.fitness) or \ 
    1337                         np.any(res.pvec == None) or not \ 
     1337                        np.any(res.pvec is None) or not \ 
    13381338                        np.all(np.isfinite(res.pvec)): 
    13391339                    data_name = str(None) 
     
    15261526                if res.fitness is None or \ 
    15271527                    not np.isfinite(res.fitness) or \ 
    1528                         np.any(res.pvec == None) or \ 
     1528                        np.any(res.pvec is None) or \ 
    15291529                    not np.all(np.isfinite(res.pvec)): 
    15301530                    fit_msg += "\nFitting did not converge!!!" 
     
    15871587        """ 
    15881588        event.Skip() 
    1589         if self.menu1 == None: 
     1589        if self.menu1 is None: 
    15901590            return 
    15911591        menu_item = self.menu1.FindItemById(self.id_reset_flag) 
     
    16461646        caption = evt.caption 
    16471647        enable_smearer = evt.enable_smearer 
    1648         if model == None: 
     1648        if model is None: 
    16491649            return 
    16501650        if uid not in self.page_finder.keys(): 
     
    16981698        new_plot.title = data.name 
    16991699        new_plot.group_id = data.group_id 
    1700         if new_plot.group_id == None: 
     1700        if new_plot.group_id is None: 
    17011701            new_plot.group_id = data.group_id 
    17021702        new_plot.id = data_id 
     
    20022002        chisqr = None 
    20032003        #to compute chisq make sure data has valid data 
    2004         # return None if data == None 
    2005         if not check_data_validity(data_copy) or data_copy == None: 
     2004        # return None if data is None 
     2005        if not check_data_validity(data_copy) or data_copy is None: 
    20062006            return chisqr 
    20072007 
    20082008        # Get data: data I, theory I, and data dI in order 
    20092009        if data_copy.__class__.__name__ == "Data2D": 
    2010             if index == None: 
     2010            if index is None: 
    20112011                index = np.ones(len(data_copy.data), dtype=bool) 
    20122012            if weight != None: 
     
    20172017            fn = data_copy.data[index] 
    20182018            theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) 
    2019             if theory_data == None: 
     2019            if theory_data is None: 
    20202020                return chisqr 
    20212021            gn = theory_data.data[index] 
     
    20232023        else: 
    20242024            # 1 d theory from model_thread is only in the range of index 
    2025             if index == None: 
     2025            if index is None: 
    20262026                index = np.ones(len(data_copy.y), dtype=bool) 
    20272027            if weight != None: 
    20282028                data_copy.dy = weight 
    2029             if data_copy.dy == None or data_copy.dy == []: 
     2029            if data_copy.dy is None or data_copy.dy == []: 
    20302030                dy = np.ones(len(data_copy.y)) 
    20312031            else: 
     
    20372037 
    20382038            theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) 
    2039             if theory_data == None: 
     2039            if theory_data is None: 
    20402040                return chisqr 
    20412041            gn = theory_data.y 
     
    20802080            theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) 
    20812081            gn = theory_data.data 
    2082             if weight == None: 
     2082            if weight is None: 
    20832083                en = data_copy.err_data 
    20842084            else: 
     
    21012101        else: 
    21022102            # 1 d theory from model_thread is only in the range of index 
    2103             if data_copy.dy == None or data_copy.dy == []: 
     2103            if data_copy.dy is None or data_copy.dy == []: 
    21042104                dy = np.ones(len(data_copy.y)) 
    21052105            else: 
    2106                 if weight == None: 
     2106                if weight is None: 
    21072107                    dy = np.ones(len(data_copy.y)) 
    21082108                ## Set consitently w/AbstractFitengine: 
     
    21422142        ##group_id specify on which panel to plot this data 
    21432143        group_id = self.page_finder[page_id].get_graph_id() 
    2144         if group_id == None: 
     2144        if group_id is None: 
    21452145            group_id = data.group_id 
    21462146        new_plot.group_id = "res" + str(group_id) 
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    r9a5097c r235f514  
    5353        self.starttime = time.time() 
    5454        # Determine appropriate q range 
    55         if self.qmin == None: 
     55        if self.qmin is None: 
    5656            self.qmin = 0 
    57         if self.qmax == None: 
     57        if self.qmax is None: 
    5858            if self.data != None: 
    5959                newx = math.pow(max(math.fabs(self.data.xmax), 
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    r959eb01 r235f514  
    240240        """ 
    241241 
    242         if state == None and data == None: 
     242        if state is None and data is None: 
    243243            self.state = IState() 
    244         elif state == None or data == None: 
     244        elif state is None or data is None: 
    245245            return 
    246246        else: 
     
    604604        compute invariant 
    605605        """ 
    606         if self._data == None: 
     606        if self._data is None: 
    607607            msg = "\n\nData must be loaded first in order" 
    608608            msg += " to perform a compution..." 
     
    792792        : param state_num: the given state number 
    793793        """ 
    794         if state_num == None: 
     794        if state_num is None: 
    795795            return 
    796796 
     
    924924        :param event: rb/cb event 
    925925        """ 
    926         if event == None: 
     926        if event is None: 
    927927            return 
    928928        obj = event.GetEventObject() 
     
    934934 
    935935        try: 
    936             if value == None or value.lstrip().rstrip() == '': 
     936            if value is None or value.lstrip().rstrip() == '': 
    937937                value = 'None' 
    938938            setattr(self.state, name, str(value)) 
     
    10131013        Used in 'set_current_data()' 
    10141014        """ 
    1015         #if data == None: return 
     1015        #if data is None: return 
    10161016        #temp_state = self.state.clone_state() 
    10171017        #copy.deepcopy(self.state.saved_state) 
     
    10491049 
    10501050        """ 
    1051         if self._data == None: 
     1051        if self._data is None: 
    10521052            return 
    10531053        # check if this event is from do/undo button 
     
    10721072        # try to add new state of the text changes in the state_list 
    10731073        try: 
    1074             if value.strip() == None: 
     1074            if value.strip() is None: 
    10751075                value = '' 
    10761076            setattr(self.state, name, str(value)) 
     
    11401140        the popup menu on bookmark context menu event 
    11411141        """ 
    1142         if self._data == None: 
     1142        if self._data is None: 
    11431143            return 
    1144         if event == None: 
     1144        if event is None: 
    11451145            return 
    11461146        self.bookmark_num += 1 
     
    12061206        : event: popUpMenu event 
    12071207        """ 
    1208         if event == None: 
     1208        if event is None: 
    12091209            return 
    12101210        # get the object 
     
    12461246        if self.parent != None: 
    12471247            self._default_save_location = self.parent.get_save_location() 
    1248         if self._default_save_location == None: 
     1248        if self._default_save_location is None: 
    12491249            self._default_save_location = os.getcwd() 
    12501250        dlg = wx.FileDialog(self, "Choose a file", 
  • src/sas/sasgui/perspectives/invariant/invariant_state.py

    r463e7ffc r235f514  
    787787            raise RuntimeError, msg 
    788788        # make sure title and data run is filled up. 
    789         if datainfo.title == None or datainfo.title == '': 
     789        if datainfo.title is None or datainfo.title == '': 
    790790            datainfo.title = datainfo.name 
    791         if datainfo.run_name == None or datainfo.run_name == {}: 
     791        if datainfo.run_name is None or datainfo.run_name == {}: 
    792792            datainfo.run = [str(datainfo.name)] 
    793793            datainfo.run_name[0] = datainfo.name 
  • src/sas/sasgui/perspectives/pr/inversion_panel.py

    rc1d5aea r235f514  
    920920        if flag: 
    921921            dataset = self.plot_data.GetValue() 
    922             if dataset == None or len(dataset.strip()) == 0: 
     922            if dataset is None or len(dataset.strip()) == 0: 
    923923                message = "No data to invert. Select a data set before" 
    924924                message += " proceeding with P(r) inversion." 
  • src/sas/sasgui/perspectives/pr/pr.py

    r959eb01 r235f514  
    291291        """ 
    292292        qtemp = pr.x 
    293         if not q == None: 
     293        if not q is None: 
    294294            qtemp = q 
    295295 
     
    303303 
    304304        # Check for user min/max 
    305         if not pr.q_min == None: 
     305        if not pr.q_min is None: 
    306306            minq = pr.q_min 
    307         if not pr.q_max == None: 
     307        if not pr.q_max is None: 
    308308            maxq = pr.q_max 
    309309 
     
    393393 
    394394        for i in range(len(x)): 
    395             if cov2 == None: 
     395            if cov2 is None: 
    396396                value = pr.pr(out, x[i]) 
    397397            else: 
     
    412412            dy = dy / pmax 
    413413 
    414         if cov2 == None: 
     414        if cov2 is None: 
    415415            new_plot = Data1D(x, y) 
    416416            new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
     
    487487        scale = None 
    488488        min_err = 0.0 
    489         if not path == None: 
     489        if not path is None: 
    490490            input_f = open(path, 'r') 
    491491            buff = input_f.read() 
     
    499499                        err = float(toks[2]) 
    500500                    else: 
    501                         if scale == None: 
     501                        if scale is None: 
    502502                            scale = 0.05 * math.sqrt(y) 
    503503                            #scale = 0.05/math.sqrt(y) 
     
    512512                    logger.error(sys.exc_value) 
    513513 
    514         if not scale == None: 
     514        if not scale is None: 
    515515            message = "The loaded file had no error bars, statistical errors are assumed." 
    516516            wx.PostEvent(self.parent, StatusEvent(status=message)) 
     
    537537 
    538538        data_started = False 
    539         if not path == None: 
     539        if not path is None: 
    540540            input_f = open(path, 'r') 
    541541            buff = input_f.read() 
     
    550550                            err = float(toks[2]) 
    551551                        else: 
    552                             if scale == None: 
     552                            if scale is None: 
    553553                                scale = 0.05 * math.sqrt(y) 
    554554                                #scale = 0.05/math.sqrt(y) 
     
    565565                    data_started = True 
    566566 
    567         if not scale == None: 
     567        if not scale is None: 
    568568            message = "The loaded file had no error bars, statistical errors are assumed." 
    569569            wx.PostEvent(self.parent, StatusEvent(status=message)) 
     
    761761        self.elapsed = elapsed 
    762762        self.control_panel.alpha_estimate = alpha 
    763         if not message == None: 
     763        if not message is None: 
    764764            wx.PostEvent(self.parent, StatusEvent(status=str(message))) 
    765765        self.perform_estimateNT() 
     
    779779        self.control_panel.nterms_estimate = nterms 
    780780        self.control_panel.alpha_estimate = alpha 
    781         if not message == None: 
     781        if not message is None: 
    782782            wx.PostEvent(self.parent, StatusEvent(status=str(message))) 
    783783 
     
    858858 
    859859        # Make a plot of I(q) data 
    860         if self.pr.err == None: 
     860        if self.pr.err is None: 
    861861            new_plot = Data1D(self.pr.x, self.pr.y) 
    862862            new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
     
    921921        try: 
    922922            pr = self._create_plot_pr() 
    923             if not pr == None: 
     923            if not pr is None: 
    924924                self.pr = pr 
    925925                self.perform_inversion() 
     
    944944        try: 
    945945            pr = self._create_plot_pr() 
    946             if not pr == None: 
     946            if not pr is None: 
    947947                self.pr = pr 
    948948                self.perform_estimate() 
     
    983983        err = self.current_plottable.dy 
    984984        all_zeros = True 
    985         if err == None: 
     985        if err is None: 
    986986            err = np.zeros(len(pr.y)) 
    987987        else: 
     
    995995            for i in range(len(pr.y)): 
    996996                # Scale the error so that we can fit over several decades of Q 
    997                 if scale == None: 
     997                if scale is None: 
    998998                    scale = 0.05 * math.sqrt(pr.y[i]) 
    999999                    min_err = 0.01 * pr.y[i] 
     
    10241024        try: 
    10251025            pr = self._create_file_pr(data) 
    1026             if not pr == None: 
     1026            if not pr is None: 
    10271027                self.pr = pr 
    10281028                self.perform_inversion() 
     
    10901090        # If we have not errors, add statistical errors 
    10911091        if y is not None: 
    1092             if err == None or np.all(err) == 0: 
     1092            if err is None or np.all(err) == 0: 
    10931093                err = np.zeros(len(y)) 
    10941094                scale = None 
     
    10961096                for i in range(len(y)): 
    10971097                    # Scale the error so that we can fit over several decades of Q 
    1098                     if scale == None: 
     1098                    if scale is None: 
    10991099                        scale = 0.05 * math.sqrt(y[i]) 
    11001100                        min_err = 0.01 * y[i] 
  • src/sas/sasgui/perspectives/pr/pr_thread.py

    r959eb01 r235f514  
    4242            pass 
    4343        except: 
    44             if not self.error_func == None: 
     44            if not self.error_func is None: 
    4545                self.error_func("CalcPr.compute: %s" % sys.exc_value) 
    4646 
     
    7070            pass 
    7171        except: 
    72             if not self.error_func == None: 
     72            if not self.error_func is None: 
    7373                self.error_func("EstimatePr.compute: %s" % sys.exc_value) 
    7474 
     
    110110            pass 
    111111        except: 
    112             if not self.error_func == None: 
     112            if not self.error_func is None: 
    113113                self.error_func("EstimatePr2.compute: %s" % sys.exc_value) 
Note: See TracChangeset for help on using the changeset viewer.