Ignore:
Timestamp:
Apr 9, 2017 6:11:31 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:
45dffa69
Parents:
ac07a3a
Message:

MAINT: search+replace '!= None' by 'is not None'

File:
1 edited

Legend:

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

    r235f514 r7432acb  
    422422 
    423423        # Get the dq for resolution averaging 
    424         if data2D.dqx_data != None and data2D.dqy_data != None: 
     424        if data2D.dqx_data is not None and data2D.dqy_data is not None: 
    425425            # The pinholes and det. pix contribution present 
    426426            # in both direction of the 2D which must be subtracted when 
     
    508508            else: 
    509509                err_y[i_q] += frac * frac * err_data[npt] * err_data[npt] 
    510             if dq_data != None: 
     510            if dq_data is not None: 
    511511                # To be consistent with dq calculation in 1d reduction, 
    512512                # we need just the averages (not quadratures) because 
     
    523523                err_y[n] = -err_y[n] 
    524524            err_y[n] = math.sqrt(err_y[n]) 
    525             #if err_x != None: 
     525            #if err_x is not None: 
    526526            #    err_x[n] = math.sqrt(err_x[n]) 
    527527 
     
    532532        idx = (numpy.isfinite(y)) & (numpy.isfinite(x)) 
    533533 
    534         if err_x != None: 
     534        if err_x is not None: 
    535535            d_x = err_x[idx] / y_counts[idx] 
    536536        else: 
     
    777777 
    778778        # Get the dq for resolution averaging 
    779         if data2D.dqx_data != None and data2D.dqy_data != None: 
     779        if data2D.dqx_data is not None and data2D.dqy_data is not None: 
    780780            # The pinholes and det. pix contribution present 
    781781            # in both direction of the 2D which must be subtracted when 
     
    895895                y_err[i_bin] += frac * frac * err_data[n] * err_data[n] 
    896896 
    897             if dq_data != None: 
     897            if dq_data is not None: 
    898898                # To be consistent with dq calculation in 1d reduction, 
    899899                # we need just the averages (not quadratures) because 
     
    925925        y_err[y_err == 0] = numpy.average(y_err) 
    926926        idx = (numpy.isfinite(y) & numpy.isfinite(y_err)) 
    927         if x_err != None: 
     927        if x_err is not None: 
    928928            d_x = x_err[idx] / y_counts[idx] 
    929929        else: 
Note: See TracChangeset for help on using the changeset viewer.