Changeset 3c3a440 in sasview


Ignore:
Timestamp:
Mar 3, 2015 11:17:47 AM (10 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
7425bcf
Parents:
c8a6c3d7
Message:

pylint fixes

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • build_tools/pylint.rc

    re3f77d8b r3c3a440  
    6464 
    6565# Include message's id in output 
    66 include-ids=no 
     66include-ids=yes 
    6767 
    6868# Put messages in a separate file for each module / package specified on the 
     
    140140 
    141141# Good variable names which should always be accepted, separated by a comma 
    142 good-names=i,j,k,ex,Run,_ 
     142good-names=i,j,k,ex,Run,_,x,y,z,qx,qy,qz,n,q,dx,dy,dz 
    143143 
    144144# Bad variable names which should always be refused, separated by a comma 
     
    260260 
    261261# Minimum number of public methods for a class (see R0903). 
    262 min-public-methods=2 
     262min-public-methods=0 
    263263 
    264264# Maximum number of public methods for a class (see R0904). 
     
    294294indent-string='    ' 
    295295 
     296no-space-check=trailing-comma,dict-separator 
    296297 
    297298# checks for similarities and duplicated code. This computation may be 
  • src/sas/dataloader/manipulations.py

    rc8a6c3d7 r3c3a440  
    206206 
    207207            #TODO: find better definition of x[i_q] based on q_data 
    208             x[i_q] += frac * q_value  # min_value + (i_q + 1) * self.bin_width / 2.0 
     208            # min_value + (i_q + 1) * self.bin_width / 2.0 
     209            x[i_q] += frac * q_value 
    209210            y[i_q] += frac * data[npts] 
    210211 
     
    573574        Apply the ring to the data set. 
    574575        Returns the angular distribution for a given q range 
    575          
    576         :param data2D: Data2D object 
    577          
     576 
     577        :param data2D: Data2D object 
     578 
    578579        :return: Data1D object 
    579580        """ 
     
    596597        phi_err = numpy.zeros(self.nbins_phi) 
    597598 
    598         # Shift to apply to calculated phi values in order to center first bin at zero 
     599        # Shift to apply to calculated phi values in order 
     600        # to center first bin at zero 
    599601        phi_shift = Pi / self.nbins_phi 
    600602 
     
    612614            if frac == 0: 
    613615                continue 
    614             # binning            
    615             i_phi = int(math.floor((self.nbins_phi) * (phi_value + phi_shift) / (2 * Pi))) 
     616            # binning 
     617            i_phi = int(math.floor((self.nbins_phi) * \ 
     618                                   (phi_value + phi_shift) / (2 * Pi))) 
    616619 
    617620            # Take care of the edge case at phi = 2pi. 
     
    649652    the four corners (q_00, q_01, q_10, q_11) that 
    650653    has q < qmax.:: 
    651      
     654 
    652655                q_01                q_11 
    653656        y=1         +--------------+ 
     
    657660        y=0         +--------------+ 
    658661                q_00                q_10 
    659          
     662 
    660663                    x=0            x=1 
    661      
     664 
    662665    """ 
    663666    # y side for x = minx 
     
    714717    The values returned is the fraction ON THE SIDE 
    715718    OF THE LOWEST Q. :: 
    716      
    717      
     719 
    718720            A           B 
    719721        +-----------+--------+    <--- pixel size 
     
    723725        if Q_1 < Q_0, B is returned 
    724726        if Q is outside the range of [Q_0, Q_1], None is returned 
    725           
     727 
    726728    """ 
    727729    if q_1 > q_0: 
    728         if (q > q_0 and q <= q_1): 
     730        if q > q_0 and q <= q_1: 
    729731            return (q - q_0) / (q_1 - q_0) 
    730732    else: 
    731         if (q > q_1 and q <= q_0): 
     733        if q > q_1 and q <= q_0: 
    732734            return (q - q_1) / (q_0 - q_1) 
    733735    return None 
    734736 
    735737 
    736 class _Sector: 
     738class _Sector(object): 
    737739    """ 
    738740    Defines a sector region on a 2D data set. 
     
    742744    and left lines wrt central line 
    743745    and phi_max could be less than phi_min. 
    744     
     746 
    745747    Phi is defined between 0 and 2*pi in anti-clockwise 
    746748    starting from the x- axis on the left-hand side 
     
    756758        """ 
    757759        Perform sector averaging. 
    758          
     760 
    759761        :param data2D: Data2D object 
    760762        :param run:  define the varying parameter ('phi' , 'q' , or 'q2') 
    761          
     763 
    762764        :return: Data1D object 
    763765        """ 
     
    940942    Sector average as a function of phi. 
    941943    I(phi) is return and the data is averaged over Q. 
    942      
     944 
    943945    A sector is defined by r_min, r_max, phi_min, phi_max. 
    944946    The number of bin in phi also has to be defined. 
     
    947949        """ 
    948950        Perform sector average and return I(phi). 
    949          
     951 
    950952        :param data2D: Data2D object 
    951953        :return: Data1D object 
     
    958960    Sector average as a function of Q for both symatric wings. 
    959961    I(Q) is return and the data is averaged over phi. 
    960      
     962 
    961963    A sector is defined by r_min, r_max, phi_min, phi_max. 
    962964    r_min, r_max, phi_min, phi_max >0. 
     
    966968        """ 
    967969        Perform sector average and return I(Q). 
    968          
    969         :param data2D: Data2D object 
    970          
     970 
     971        :param data2D: Data2D object 
     972 
    971973        :return: Data1D object 
    972974        """ 
     
    979981    The ring is defined by r_min, r_max, and 
    980982    the position of the center of the ring. 
    981      
     983 
    982984    The data returned is the region inside the ring 
    983      
     985 
    984986    Phi_min and phi_max should be defined between 0 and 2*pi 
    985987    in anti-clockwise starting from the x- axis on the left-hand side 
     
    9991001        Apply the ring to the data set. 
    10001002        Returns the angular distribution for a given q range 
    1001          
    1002         :param data2D: Data2D object 
    1003          
     1003 
     1004        :param data2D: Data2D object 
     1005 
    10041006        :return: index array in the range 
    10051007        """ 
     
    10141016        # check whether or not the data point is inside ROI 
    10151017        out = (self.r_min <= q_data) & (self.r_max >= q_data) 
    1016  
    1017         return (out) 
     1018        return out 
    10181019 
    10191020 
     
    10351036        """ 
    10361037       Find a rectangular 2D region of interest. 
    1037           
     1038 
    10381039       :param data2D: Data2D object 
    10391040       :return: mask, 1d array (len = len(data)) 
     
    10471048        """ 
    10481049        Find a rectangular 2D region of interest. 
    1049          
    1050         :param data2D: Data2D object 
    1051          
     1050 
     1051        :param data2D: Data2D object 
     1052 
    10521053        :return: out, 1d array (length = len(data)) 
    10531054           with Trues where the data points are inside ROI, otherwise Falses 
     
    10631064        outy = (self.y_min <= qy_data) & (self.y_max > qy_data) 
    10641065 
    1065         return (outx & outy) 
     1066        return outx & outy 
    10661067 
    10671068 
     
    10721073    where phi_min and phi_max are defined by the right 
    10731074    and left lines wrt central line. 
    1074     
     1075 
    10751076    Phi_min and phi_max are given in units of radian 
    10761077    and (phi_max-phi_min) should not be larger than pi 
     
    10831084        """ 
    10841085        Find a rectangular 2D region of interest. 
    1085          
    1086         :param data2D: Data2D object 
    1087          
     1086 
     1087        :param data2D: Data2D object 
     1088 
    10881089        :return: mask, 1d array (len = len(data)) 
    1089          
     1090 
    10901091        with Trues where the data points are inside ROI, otherwise False 
    10911092        """ 
     
    10971098        """ 
    10981099        Find a rectangular 2D region of interest. 
    1099          
    1100         :param data2D: Data2D object 
    1101          
     1100 
     1101        :param data2D: Data2D object 
     1102 
    11021103        :return: out, 1d array (length = len(data)) 
    1103          
     1104 
    11041105        with Trues where the data points are inside ROI, otherwise Falses 
    11051106        """ 
     
    11071108            raise RuntimeError, "Sectorcut take only plottable_2D objects" 
    11081109        Pi = math.pi 
    1109         # Get data  
     1110        # Get data 
    11101111        qx_data = data2D.qx_data 
    11111112        qy_data = data2D.qy_data 
Note: See TracChangeset for help on using the changeset viewer.