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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/data_info.py

    r959eb01 r235f514  
    806806            # create zero vector 
    807807            dy_other = other.dy 
    808             if other.dy == None or (len(other.dy) != len(other.y)): 
     808            if other.dy is None or (len(other.dy) != len(other.y)): 
    809809                dy_other = np.zeros(len(other.y)) 
    810810 
    811811        # Check that we have errors, otherwise create zero vector 
    812812        dy = self.dy 
    813         if self.dy == None or (len(self.dy) != len(self.y)): 
     813        if self.dy is None or (len(self.dy) != len(self.y)): 
    814814            dy = np.zeros(len(self.y)) 
    815815 
     
    822822        dy, dy_other = self._validity_check(other) 
    823823        result = self.clone_without_data(len(self.x)) 
    824         if self.dxw == None: 
     824        if self.dxw is None: 
    825825            result.dxw = None 
    826826        else: 
    827827            result.dxw = np.zeros(len(self.x)) 
    828         if self.dxl == None: 
     828        if self.dxl is None: 
    829829            result.dxl = None 
    830830        else: 
     
    884884        self._validity_check_union(other) 
    885885        result = self.clone_without_data(len(self.x) + len(other.x)) 
    886         if self.dy == None or other.dy is None: 
     886        if self.dy is None or other.dy is None: 
    887887            result.dy = None 
    888888        else: 
    889889            result.dy = np.zeros(len(self.x) + len(other.x)) 
    890         if self.dx == None or other.dx is None: 
     890        if self.dx is None or other.dx is None: 
    891891            result.dx = None 
    892892        else: 
    893893            result.dx = np.zeros(len(self.x) + len(other.x)) 
    894         if self.dxw == None or other.dxw is None: 
     894        if self.dxw is None or other.dxw is None: 
    895895            result.dxw = None 
    896896        else: 
    897897            result.dxw = np.zeros(len(self.x) + len(other.x)) 
    898         if self.dxl == None or other.dxl is None: 
     898        if self.dxl is None or other.dxl is None: 
    899899            result.dxl = None 
    900900        else: 
     
    10301030            # Check that the scales match 
    10311031            err_other = other.err_data 
    1032             if other.err_data == None or \ 
     1032            if other.err_data is None or \ 
    10331033                (len(other.err_data) != len(other.data)): 
    10341034                err_other = np.zeros(len(other.data)) 
     
    10361036        # Check that we have errors, otherwise create zero vector 
    10371037        err = self.err_data 
    1038         if self.err_data == None or \ 
     1038        if self.err_data is None or \ 
    10391039            (len(self.err_data) != len(self.data)): 
    10401040            err = np.zeros(len(other.data)) 
     
    10511051        dy, dy_other = self._validity_check(other) 
    10521052        result = self.clone_without_data(np.size(self.data)) 
    1053         if self.dqx_data == None or self.dqy_data == None: 
     1053        if self.dqx_data is None or self.dqy_data is None: 
    10541054            result.dqx_data = None 
    10551055            result.dqy_data = None 
     
    11251125        result.ymin = self.ymin 
    11261126        result.ymax = self.ymax 
    1127         if self.dqx_data == None or self.dqy_data == None or \ 
    1128                 other.dqx_data == None or other.dqy_data == None: 
     1127        if self.dqx_data is None or self.dqy_data is None or \ 
     1128                other.dqx_data is None or other.dqy_data is None: 
    11291129            result.dqx_data = None 
    11301130            result.dqy_data = None 
Note: See TracChangeset for help on using the changeset viewer.