Ignore:
Timestamp:
Apr 9, 2017 5: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/calculator
Files:
9 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 
Note: See TracChangeset for help on using the changeset viewer.