Ignore:
Timestamp:
Apr 9, 2017 5:46:10 AM (8 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/guiframe/local_perspectives
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py

    rc1d5aea r235f514  
    7575        path = None 
    7676        self._default_save_location = self.parent._default_save_location 
    77         if self._default_save_location == None: 
     77        if self._default_save_location is None: 
    7878            self._default_save_location = os.getcwd() 
    7979 
     
    116116        path = None 
    117117        self._default_save_location = self.parent._default_save_location 
    118         if self._default_save_location == None: 
     118        if self._default_save_location is None: 
    119119            self._default_save_location = os.getcwd() 
    120120        dlg = wx.DirDialog(self.parent, "Choose a directory", 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py

    rd85c194 r235f514  
    122122        data = self.base.data2D 
    123123        # If we have no data, just return 
    124         if data == None: 
     124        if data is None: 
    125125            return 
    126126 
     
    132132        # if the user does not specify the numbers of points to plot 
    133133        # the default number will be nbins= 36 
    134         if nbins == None: 
     134        if nbins is None: 
    135135            self.nbins = 36 
    136136        else: 
     
    521521 
    522522        # If we have no data, just return 
    523         if data == None: 
     523        if data is None: 
    524524            return 
    525525        mask = data.mask 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Arc.py

    r959eb01 r235f514  
    8181        npts = int((self.theta2 - self.theta1) / (math.pi / 120)) 
    8282 
    83         if r == None: 
     83        if r is None: 
    8484            self.radius = math.sqrt(math.pow(self._mouse_x, 2) + \ 
    8585                                     math.pow(self._mouse_y, 2)) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    r959eb01 r235f514  
    212212        On Qmin Qmax vertical line event 
    213213        """ 
    214         if event == None: 
     214        if event is None: 
    215215            return 
    216216        event.Skip() 
    217217        active_ctrl = event.active 
    218         if active_ctrl == None: 
     218        if active_ctrl is None: 
    219219            return 
    220220        if hasattr(event, 'is_corfunc'): 
     
    231231                colors.append('purple') 
    232232                values.append(min(x_data.max(), float(ctrl[2].GetValue()))) 
    233             if self.ly == None: 
     233            if self.ly is None: 
    234234                self.ly = [] 
    235235                for c, v in zip(colors, values): 
     
    336336        if hasattr(event, "action"): 
    337337            dclick = event.action == 'dclick' 
    338             if ax == None or dclick: 
     338            if ax is None or dclick: 
    339339                # remove the vline 
    340340                self._check_zoom_plot() 
     
    361361        Move the cursor line to write Q range 
    362362        """ 
    363         if self.q_ctrl == None: 
     363        if self.q_ctrl is None: 
    364364            return 
    365365        # release a q range vline 
     
    370370            return 
    371371        ax = event.inaxes 
    372         if ax == None or not hasattr(event, 'action'): 
     372        if ax is None or not hasattr(event, 'action'): 
    373373            return 
    374374        end_drag = event.action != 'drag' and event.xdata != None 
     
    618618            # add menu of other plugins 
    619619            item_list = self.parent.get_current_context_menu(self) 
    620             if (not item_list == None) and (not len(item_list) == 0): 
     620            if (not item_list is None) and (not len(item_list) == 0): 
    621621                for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 
    622622 
     
    811811        curr_label = self.appearance_selected_plot.label 
    812812 
    813         if curr_color == None: 
     813        if curr_color is None: 
    814814            curr_color = self._color_labels['Blue'] 
    815815            curr_symbol = 13 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r959eb01 r235f514  
    144144        """ 
    145145        # Not implemented 
    146         if event == None: 
     146        if event is None: 
    147147            return 
    148148        event.Skip() 
     
    227227        if self._is_changed_legend_label: 
    228228            data.label = self.title_label 
    229         if data.label == None: 
     229        if data.label is None: 
    230230            data.label = data.name 
    231231        if not self.title_font: 
     
    320320        if len(self.data2D.detector) <= 1: 
    321321            item_list = self.parent.get_current_context_menu(self) 
    322             if (not item_list == None) and (not len(item_list) == 0) and\ 
     322            if (not item_list is None) and (not len(item_list) == 0) and\ 
    323323                self.data2D.name.split(" ")[0] != 'Residuals': 
    324324                for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 
     
    533533        """ 
    534534        ## Clear current slicer 
    535         if not self.slicer == None: 
     535        if not self.slicer is None: 
    536536            self.slicer.clear() 
    537537        ## Create a new slicer 
     
    719719        Clear the slicer on the plot 
    720720        """ 
    721         if not self.slicer == None: 
     721        if not self.slicer is None: 
    722722            self.slicer.clear() 
    723723            self.subplot.figure.canvas.draw() 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py

    r959eb01 r235f514  
    144144        data = self.base.data2D 
    145145        # If we have no data, just return 
    146         if data == None: 
     146        if data is None: 
    147147            return 
    148148        ## Averaging 
     
    151151        phimin = -self.left_line.phi + self.main_line.theta 
    152152        phimax = self.left_line.phi + self.main_line.theta 
    153         if nbins == None: 
     153        if nbins is None: 
    154154            nbins = 20 
    155155        sect = SectorQ(r_min=0.0, r_max=radius, 
     
    364364        if phi != None: 
    365365            self.phi = phi 
    366         if delta == None: 
     366        if delta is None: 
    367367            delta = 0 
    368368        if  right: 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SlicerParameters.py

    rd85c194 r235f514  
    4646        """ 
    4747        event.Skip() 
    48         if event.obj_class == None: 
     48        if event.obj_class is None: 
    4949            self.set_slicer(None, None) 
    5050        else: 
     
    5757        self.bck.Clear(True) 
    5858        self.type = type 
    59         if type == None: 
     59        if type is None: 
    6060            label = "Right-click on 2D plot for slicer options" 
    6161            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py

    r959eb01 r235f514  
    139139 
    140140        """ 
    141         if self.direction == None: 
     141        if self.direction is None: 
    142142            self.direction = direction 
    143143 
     
    149149        if nbins != None: 
    150150            self.nbins = nbins 
    151         if self.averager == None: 
    152             if new_slab == None: 
     151        if self.averager is None: 
     152            if new_slab is None: 
    153153                msg = "post data:cannot average , averager is empty" 
    154154                raise ValueError, msg 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/detector_dialog.py

    r959eb01 r235f514  
    9090            zmin = self.reset_zmin_ctl 
    9191            zmax = self.reset_zmax_ctl 
    92             if zmin == None: 
     92            if zmin is None: 
    9393                zmin = "" 
    94             if zmax == None: 
     94            if zmax is None: 
    9595                zmax = "" 
    9696            self.zmin_ctl.SetValue(str(zmin)) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py

    r959eb01 r235f514  
    249249        Add new mask to old mask 
    250250        """ 
    251         if not self.slicer == None: 
     251        if not self.slicer is None: 
    252252            data = Data2D() 
    253253            data = self.data 
     
    269269        Erase new mask from old mask 
    270270        """ 
    271         if not self.slicer == None: 
     271        if not self.slicer is None: 
    272272            self.slicer_mask = self.slicer.update() 
    273273            mask = self.data.mask 
     
    307307        Clear the slicer on the plot 
    308308        """ 
    309         if not self.slicer == None: 
     309        if not self.slicer is None: 
    310310            self.slicer.clear() 
    311311            self.subplot.figure.canvas.draw() 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py

    r959eb01 r235f514  
    8888        On Qmin Qmax vertical line event 
    8989        """ 
    90         if event == None: 
     90        if event is None: 
    9191            return 
    9292        if event.id in self.plot_panels.keys(): 
     
    9999 
    100100    def _on_plot_lim(self, event=None): 
    101         if event == None: 
     101        if event is None: 
    102102            return 
    103103        if event.id in self.plot_panels.keys(): 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py

    r959eb01 r235f514  
    117117        data = self.base.data 
    118118        # If we have no data, just return 
    119         if data == None: 
     119        if data is None: 
    120120            return 
    121121        ## Averaging 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py

    rd85c194 r235f514  
    3737        self.bck = wx.GridBagSizer(5, 5) 
    3838        self.SetSizer(self.bck) 
    39         if type == None and params == None: 
     39        if type is None and params is None: 
    4040            label = "Right-click on 2D plot for slicer options" 
    4141            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
     
    5757        """ 
    5858        event.Skip() 
    59         if event.obj_class == None: 
     59        if event.obj_class is None: 
    6060            self.set_slicer(None, None) 
    6161        else: 
     
    6868        self.bck.Clear(True) 
    6969        self.type = type 
    70         if type == None: 
     70        if type is None: 
    7171            label = "Right-click on 2D plot for slicer options" 
    7272            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
Note: See TracChangeset for help on using the changeset viewer.