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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/plottools/plottables.py

    r9c0f3c17 r235f514  
    229229            if p.hidden == True: 
    230230                continue 
    231             if not p.x == None: 
     231            if not p.x is None: 
    232232                for x_i in p.x: 
    233                     if min_value == None or x_i < min_value: 
     233                    if min_value is None or x_i < min_value: 
    234234                        min_value = x_i 
    235                     if max_value == None or x_i > max_value: 
     235                    if max_value is None or x_i > max_value: 
    236236                        max_value = x_i 
    237237        return min_value, max_value 
     
    562562        Returns True if there is no data stored in the plottable 
    563563        """ 
    564         if not self.x == None and len(self.x) == 0 \ 
    565             and not self.y == None and len(self.y) == 0: 
     564        if not self.x is None and len(self.x) == 0 \ 
     565            and not self.y is None and len(self.y) == 0: 
    566566            return True 
    567567        return False 
     
    679679        # Sanity check 
    680680        # Do the transofrmation only when x and y are empty 
    681         has_err_x = not (dx == None or len(dx) == 0) 
    682         has_err_y = not (dy == None or len(dy) == 0) 
     681        has_err_x = not (dx is None or len(dx) == 0) 
     682        has_err_y = not (dy is None or len(dy) == 0) 
    683683 
    684684        if(x != None) and (y != None): 
    685             if not dx == None and not len(dx) == 0 and not len(x) == len(dx): 
     685            if not dx is None and not len(dx) == 0 and not len(x) == len(dx): 
    686686                msg = "Plottable.View: Given x and dx are not" 
    687687                msg += " of the same length" 
     
    693693                raise ValueError, msg 
    694694 
    695             if not dy == None and not len(dy) == 0 and not len(y) == len(dy): 
     695            if not dy is None and not len(dy) == 0 and not len(y) == len(dy): 
    696696                msg = "Plottable.View: Given y and dy are not of the same " 
    697697                msg += "length: len(y)=%s, len(dy)=%s" % (len(y), len(dy)) 
     
    797797        tempy = [] 
    798798        tempdy = [] 
    799         if self.dx == None: 
     799        if self.dx is None: 
    800800            self.dx = np.zeros(len(self.x)) 
    801         if self.dy == None: 
     801        if self.dy is None: 
    802802            self.dy = np.zeros(len(self.y)) 
    803803        if self.xLabel == "log10(x)": 
     
    827827        tempy = [] 
    828828        tempdy = [] 
    829         if self.dx == None: 
     829        if self.dx is None: 
    830830            self.dx = np.zeros(len(self.x)) 
    831         if self.dy == None: 
     831        if self.dy is None: 
    832832            self.dy = np.zeros(len(self.y)) 
    833833        if self.yLabel == "log10(y)": 
     
    860860        tempy = [] 
    861861        tempdy = [] 
    862         if self.dx == None: 
     862        if self.dx is None: 
    863863            self.dx = np.zeros(len(self.x)) 
    864         if self.dy == None: 
     864        if self.dy is None: 
    865865            self.dy = np.zeros(len(self.y)) 
    866866        if xmin != None and xmax != None: 
     
    12061206        """ 
    12071207        """ 
    1208         if  self._chisq == None: 
     1208        if  self._chisq is None: 
    12091209            chisqTxt = r'$\chi^2=$' 
    12101210        else: 
Note: See TracChangeset for help on using the changeset viewer.