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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/sas_gen.py

    r9c0f3c17 r235f514  
    9797        :Param volume: pixel volume [float] 
    9898        """ 
    99         if self.data_vol == None: 
     99        if self.data_vol is None: 
    100100            raise 
    101101        self.data_vol = volume 
     
    119119        pos_z = self.data_z 
    120120        len_x = len(pos_x) 
    121         if self.is_avg == None: 
     121        if self.is_avg is None: 
    122122            len_x *= -1 
    123123            pos_x, pos_y, pos_z = transform_center(pos_x, pos_y, pos_z) 
     
    257257        self.sld_n = np.zeros(length) 
    258258 
    259         if omfdata.mx == None: 
     259        if omfdata.mx is None: 
    260260            self.mx = np.zeros(length) 
    261         if omfdata.my == None: 
     261        if omfdata.my is None: 
    262262            self.my = np.zeros(length) 
    263         if omfdata.mz == None: 
     263        if omfdata.mz is None: 
    264264            self.mz = np.zeros(length) 
    265265 
     
    703703        :Param data: MagSLD data object 
    704704        """ 
    705         if path == None: 
     705        if path is None: 
    706706            raise ValueError, "Missing the file path." 
    707         if data == None: 
     707        if data is None: 
    708708            raise ValueError, "Missing the data to save." 
    709709        x_val = data.pos_x 
     
    713713        length = len(x_val) 
    714714        sld_n = data.sld_n 
    715         if sld_n == None: 
     715        if sld_n is None: 
    716716            sld_n = np.zeros(length) 
    717717        sld_mx = data.sld_mx 
    718         if sld_mx == None: 
     718        if sld_mx is None: 
    719719            sld_mx = np.zeros(length) 
    720720            sld_my = np.zeros(length) 
     
    935935        :Params pixel: str; pixel or atomic symbol, or array of strings 
    936936        """ 
    937         if self.sld_n == None: 
     937        if self.sld_n is None: 
    938938            return 
    939939        if symbol.__class__.__name__ == 'str': 
     
    947947        :Params pixel: str; pixel or atomic symbol, or array of strings 
    948948        """ 
    949         if self.sld_n == None: 
     949        if self.sld_n is None: 
    950950            return 
    951951        if vol.__class__.__name__ == 'ndarray': 
Note: See TracChangeset for help on using the changeset viewer.