Changeset ac07a3a in sasview for src/sas


Ignore:
Timestamp:
Apr 9, 2017 4:08:43 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:
7432acb
Parents:
235f514
Message:

MAINT: replace 'not x is None' by 'x is not None'

Location:
src/sas
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/fit/Loader.py

    r235f514 rac07a3a  
    3434    def set_values(self): 
    3535        """ Store the values loaded from file in local variables""" 
    36         if not self.filename is None: 
     36        if self.filename is not None: 
    3737            input_f =  open(self.filename, 'r') 
    3838            buff = input_f.read() 
  • src/sas/sascalc/pr/fit/Loader.py

    r235f514 rac07a3a  
    3434    def set_values(self): 
    3535        """ Store the values loaded from file in local variables""" 
    36         if not self.filename is None: 
     36        if self.filename is not None: 
    3737            input_f =  open(self.filename, 'r') 
    3838            buff = input_f.read() 
  • src/sas/sascalc/pr/invertor.py

    r235f514 rac07a3a  
    395395        Check q-value against user-defined range 
    396396        """ 
    397         if not self.q_min is None and q < self.q_min: 
     397        if self.q_min is not None and q < self.q_min: 
    398398            return False 
    399         if not self.q_max is None and q > self.q_max: 
     399        if self.q_max is not None and q > self.q_max: 
    400400            return False 
    401401        return True 
  • src/sas/sascalc/pr/num_term.py

    r235f514 rac07a3a  
    159159    scale = None 
    160160    min_err = 0.0 
    161     if not path is None: 
     161    if path is not None: 
    162162        input_f = open(path, 'r') 
    163163        buff = input_f.read() 
  • src/sas/sasgui/guiframe/data_processor.py

    r235f514 rac07a3a  
    10171017                            if index - 1 >= 0: 
    10181018                                new_row, _ = temp_list[index - 1] 
    1019                                 if not new_row is None and new_row != ' ': 
     1019                                if new_row is not None and new_row != ' ': 
    10201020                                    label += create_label(col_name, None, 
    10211021                                                          int(new_row) + 1) 
     
    10251025                            if index + 1 < len(temp_list): 
    10261026                                new_row, _ = temp_list[index + 1] 
    1027                                 if not new_row is None: 
     1027                                if new_row is not None: 
    10281028                                    label += create_label(col_name, 
    10291029                                                          int(new_row) + 1, None) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    r235f514 rac07a3a  
    618618            # add menu of other plugins 
    619619            item_list = self.parent.get_current_context_menu(self) 
    620             if (not item_list is None) and (not len(item_list) == 0): 
     620            if (item_list is not None) and (len(item_list)): 
    621621                for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 
    622  
    623622                    try: 
    624623                        plot_menu.Append(wx_id, item[0], name) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r235f514 rac07a3a  
    320320        if len(self.data2D.detector) <= 1: 
    321321            item_list = self.parent.get_current_context_menu(self) 
    322             if (not item_list is None) and (not len(item_list) == 0) and\ 
    323                 self.data2D.name.split(" ")[0] != 'Residuals': 
     322            if ((item_list is not None) and len(item_list) and 
     323                self.data2D.name.split(" ")[0] != 'Residuals'): 
    324324                for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 
    325325                    try: 
     
    533533        """ 
    534534        ## Clear current slicer 
    535         if not self.slicer is None: 
     535        if self.slicer is not None: 
    536536            self.slicer.clear() 
    537537        ## Create a new slicer 
     
    719719        Clear the slicer on the plot 
    720720        """ 
    721         if not self.slicer is None: 
     721        if self.slicer is not None: 
    722722            self.slicer.clear() 
    723723            self.subplot.figure.canvas.draw() 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py

    r235f514 rac07a3a  
    249249        Add new mask to old mask 
    250250        """ 
    251         if not self.slicer is None: 
     251        if self.slicer is not None: 
    252252            data = Data2D() 
    253253            data = self.data 
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    r235f514 rac07a3a  
    19141914            return 
    19151915        self.sld_data = data 
    1916         enable = (not data is None) 
     1916        enable = (data is not None) 
    19171917        self._set_omfpanel_sld_data(self.sld_data) 
    19181918        self.omfpanel.bt_save.Enable(enable) 
  • src/sas/sasgui/perspectives/pr/pr.py

    r235f514 rac07a3a  
    291291        """ 
    292292        qtemp = pr.x 
    293         if not q is None: 
     293        if q is not None: 
    294294            qtemp = q 
    295295 
     
    303303 
    304304        # Check for user min/max 
    305         if not pr.q_min is None: 
     305        if pr.q_min is not None: 
    306306            minq = pr.q_min 
    307         if not pr.q_max is None: 
     307        if pr.q_max is not None: 
    308308            maxq = pr.q_max 
    309309 
     
    487487        scale = None 
    488488        min_err = 0.0 
    489         if not path is None: 
     489        if path is not None: 
    490490            input_f = open(path, 'r') 
    491491            buff = input_f.read() 
     
    512512                    logger.error(sys.exc_value) 
    513513 
    514         if not scale is None: 
     514        if scale is not 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 is None: 
     539        if path is not None: 
    540540            input_f = open(path, 'r') 
    541541            buff = input_f.read() 
     
    565565                    data_started = True 
    566566 
    567         if not scale is None: 
     567        if scale is not 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 is None: 
     763        if message is not 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 is None: 
     781        if message is not None: 
    782782            wx.PostEvent(self.parent, StatusEvent(status=str(message))) 
    783783 
     
    921921        try: 
    922922            pr = self._create_plot_pr() 
    923             if not pr is None: 
     923            if pr is not None: 
    924924                self.pr = pr 
    925925                self.perform_inversion() 
     
    944944        try: 
    945945            pr = self._create_plot_pr() 
    946             if not pr is None: 
     946            if pr is not None: 
    947947                self.pr = pr 
    948948                self.perform_estimate() 
     
    10241024        try: 
    10251025            pr = self._create_file_pr(data) 
    1026             if not pr is None: 
     1026            if pr is not None: 
    10271027                self.pr = pr 
    10281028                self.perform_inversion() 
  • src/sas/sasgui/perspectives/pr/pr_thread.py

    r235f514 rac07a3a  
    4242            pass 
    4343        except: 
    44             if not self.error_func is None: 
     44            if self.error_func is not None: 
    4545                self.error_func("CalcPr.compute: %s" % sys.exc_value) 
    4646 
     
    7070            pass 
    7171        except: 
    72             if not self.error_func is None: 
     72            if self.error_func is not None: 
    7373                self.error_func("EstimatePr.compute: %s" % sys.exc_value) 
    7474 
     
    110110            pass 
    111111        except: 
    112             if not self.error_func is None: 
     112            if self.error_func is not None: 
    113113                self.error_func("EstimatePr2.compute: %s" % sys.exc_value) 
  • src/sas/sasgui/plottools/fittings.py

    r235f514 rac07a3a  
    2525        self.model = model 
    2626        self.name = name 
    27         if not value is None: 
     27        if value is not None: 
    2828            self.model.setParam(self.name, value) 
    2929 
  • src/sas/sasgui/plottools/plottable_interactor.py

    r235f514 rac07a3a  
    5050            l_width = markersize * 0.4 
    5151            return self.step(x=x, y=y, color=color, label=label, width=l_width) 
    52         if not self.marker is None: 
    53             self.base.connect.clear([self.marker]) 
    54         self.color = self._color(color) 
    55         if self.markersize != None: 
     52        if self.marker is not None: 
     53            self.base.connect.clear([self.marker]) 
     54        self.color = self._color(color) 
     55        if self.markersize is not None: 
    5656            markersize = self.markersize 
    5757        # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 
  • src/sas/sasgui/plottools/plottables.py

    r235f514 rac07a3a  
    229229            if p.hidden == True: 
    230230                continue 
    231             if not p.x is None: 
     231            if p.x is not None: 
    232232                for x_i in p.x: 
    233233                    if min_value is None or x_i < min_value: 
Note: See TracChangeset for help on using the changeset viewer.