Index: extra/pylint.rc
===================================================================
--- extra/pylint.rc	(revision 37a725200a1edb6dbd7a029a236c3ea2cfc7522c)
+++ extra/pylint.rc	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -64,4 +64,5 @@
     star-args,
     unbalanced-tuple-unpacking,
+    locally-enabled,
     locally-disabled,
 
@@ -107,10 +108,11 @@
 good-names=_,
     input,
-    i,j,k,n,x,y,z,
+    h,i,j,k,n,w,x,y,z,
     q,qx,qy,qz,
     dt,dx,dy,dz,id,
-    Iq,dIq,Qx,Qy,Qz,
+    Iq,dIq,Qx,Qy,Qz,Iqxy,
     p,
     ER, call_ER, VR, call_VR,
+    Rmax, SElength,
 
 # Bad variable names which should always be refused, separated by a comma
@@ -335,5 +337,5 @@
 
 # Maximum number of arguments for function / method
-max-args=5
+max-args=15
 
 # Argument names that match this expression will be ignored. Default to name
@@ -342,5 +344,5 @@
 
 # Maximum number of locals for function / method body
-max-locals=15
+max-locals=25
 
 # Maximum number of return / yield for function / method body
Index: sasmodels/compare.py
===================================================================
--- sasmodels/compare.py	(revision 4f2478e77cdc4e495cf403a9aeb9c6544bcdf468)
+++ sasmodels/compare.py	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -533,10 +533,10 @@
     if Nbase > 0:
         if Ncomp > 0: plt.subplot(131)
-        plot_theory(data, base_value, view=view, plot_data=False, limits=limits)
+        plot_theory(data, base_value, view=view, use_data=False, limits=limits)
         plt.title("%s t=%.1f ms"%(base.engine, base_time))
         #cbar_title = "log I"
     if Ncomp > 0:
         if Nbase > 0: plt.subplot(132)
-        plot_theory(data, comp_value, view=view, plot_data=False, limits=limits)
+        plot_theory(data, comp_value, view=view, use_data=False, limits=limits)
         plt.title("%s t=%.1f ms"%(comp.engine, comp_time))
         #cbar_title = "log I"
@@ -548,5 +548,5 @@
             err, errstr, errview = abs(relerr), "rel err", "log"
         #err,errstr = base/comp,"ratio"
-        plot_theory(data, None, resid=err, view=errview, plot_data=False)
+        plot_theory(data, None, resid=err, view=errview, use_data=False)
         plt.title("max %s = %.3g"%(errstr, max(abs(err))))
         #cbar_title = errstr if errview=="linear" else "log "+errstr
Index: sasmodels/models/be_polyelectrolyte.py
===================================================================
--- sasmodels/models/be_polyelectrolyte.py	(revision 07a67009fbffd10e53d8cc1a1dc34bfb80de75c5)
+++ sasmodels/models/be_polyelectrolyte.py	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -50,29 +50,32 @@
 """
 
-from numpy import inf, power, pi, sqrt
+from numpy import inf, pi, sqrt
 
 name = "be_polyelectrolyte"
 title = "Polyelectrolyte with the RPA expression derived by Borue and Erukhimovich"
 description = """
-            Evaluate
-            F(x) = K 1/(4 pi Lb (alpha)^(2)) (q^(2)+k2)/(1+(r02)^(2))
-                 (q^(2)+k2) (q^(2)-(12 h C/b^(2)))
+    Evaluate
+    F(x) = K 1/(4 pi Lb (alpha)^(2)) (q^(2)+k2)/(1+(r02)^(2))
+         (q^(2)+k2) (q^(2)-(12 h C/b^(2)))
 
-            has 3 internal parameters :
-                   The inverse Debye Length: K2 = 4 pi Lb (2 Cs+alpha C)
-                   r02 =1/alpha/Ca^(0.5) (B/(48 pi Lb)^(0.5))
-                   Ca = 6.022136e-4 C
-            """
+    has 3 internal parameters :
+           The inverse Debye Length: K2 = 4 pi Lb (2 Cs+alpha C)
+           r02 =1/alpha/Ca^(0.5) (B/(48 pi Lb)^(0.5))
+           Ca = 6.022136e-4 C
+    """
 category = "shape-independent"
 
-#            ["name", "units", default, [lower, upper], "type", "description"],
-parameters = [["contrast_factor",       "barns",   10.0,  [-inf, inf], "", "Contrast factor of the polymer"],
-              ["bjerrum_length",        "Ang",      7.1,  [0, inf],    "", "Bjerrum length"],
-              ["virial_param",          "1/Ang^2", 12.0,  [-inf, inf], "", "Virial parameter"],
-              ["monomer_length",        "Ang",     10.0,  [0, inf],    "", "Monomer length"],
-              ["salt_concentration",    "mol/L",    0.0,  [-inf, inf], "", "Concentration of monovalent salt"],
-              ["ionization_degree",     "",         0.05, [0, inf],    "", "Degree of ionization"],
-              ["polymer_concentration", "mol/L",    0.7,  [0, inf],    "", "Polymer molar concentration"],
-              ]
+# pylint: disable=bad-whitespace,line-too-long
+#   ["name",                  "units", default, [lower, upper], "type", "description"],
+parameters = [
+    ["contrast_factor",       "barns",    10.0,  [-inf, inf], "", "Contrast factor of the polymer"],
+    ["bjerrum_length",        "Ang",       7.1,  [0, inf],    "", "Bjerrum length"],
+    ["virial_param",          "1/Ang^2",  12.0,  [-inf, inf], "", "Virial parameter"],
+    ["monomer_length",        "Ang",      10.0,  [0, inf],    "", "Monomer length"],
+    ["salt_concentration",    "mol/L",     0.0,  [-inf, inf], "", "Concentration of monovalent salt"],
+    ["ionization_degree",     "",          0.05, [0, inf],    "", "Degree of ionization"],
+    ["polymer_concentration", "mol/L",     0.7,  [0, inf],    "", "Polymer molar concentration"],
+    ]
+# pylint: enable=bad-whitespace,line-too-long
 
 
@@ -106,7 +109,5 @@
 
 def Iqxy(qx, qy, *args):
-        iq = Iq(sqrt(qx**2 + qy**2), *args)
-
-        return iq
+    return Iq(sqrt(qx**2 + qy**2), *args)
 
 Iqxy.vectorized = True  # Iqxy accepts an array of qx, qy values
@@ -133,43 +134,45 @@
                polymer_concentration='c')
 
+# pylint: disable=bad-whitespace
 tests = [
-         # Accuracy tests based on content in test/utest_other_models.py
-         [{'contrast_factor':       10.0,
-           'bjerrum_length':         7.1,
-           'virial_param':          12.0,
-           'monomer_length':        10.0,
-           'salt_concentration':     0.0,
-           'ionization_degree':      0.05,
-           'polymer_concentration':  0.7,
-           'background':             0.001,
-           }, 0.001, 0.0948379],
+    # Accuracy tests based on content in test/utest_other_models.py
+    [{'contrast_factor':       10.0,
+      'bjerrum_length':         7.1,
+      'virial_param':          12.0,
+      'monomer_length':        10.0,
+      'salt_concentration':     0.0,
+      'ionization_degree':      0.05,
+      'polymer_concentration':  0.7,
+      'background':             0.001,
+     }, 0.001, 0.0948379],
 
-         # Additional tests with larger range of parameters
-         [{'contrast_factor':       10.0,
-           'bjerrum_length':       100.0,
-           'virial_param':           3.0,
-           'monomer_length':         1.0,
-           'salt_concentration':    10.0,
-           'ionization_degree':      2.0,
-           'polymer_concentration': 10.0,
-           }, 0.1, -3.75693800588],
+    # Additional tests with larger range of parameters
+    [{'contrast_factor':       10.0,
+      'bjerrum_length':       100.0,
+      'virial_param':           3.0,
+      'monomer_length':         1.0,
+      'salt_concentration':    10.0,
+      'ionization_degree':      2.0,
+      'polymer_concentration': 10.0,
+     }, 0.1, -3.75693800588],
 
-         [{'contrast_factor':       10.0,
-           'bjerrum_length':       100.0,
-           'virial_param':           3.0,
-           'monomer_length':         1.0,
-           'salt_concentration':    10.0,
-           'ionization_degree':      2.0,
-           'polymer_concentration': 10.0,
-           'background':           100.0
-           }, 5.0, 100.029142149],
+    [{'contrast_factor':       10.0,
+      'bjerrum_length':       100.0,
+      'virial_param':           3.0,
+      'monomer_length':         1.0,
+      'salt_concentration':    10.0,
+      'ionization_degree':      2.0,
+      'polymer_concentration': 10.0,
+      'background':           100.0
+     }, 5.0, 100.029142149],
 
-         [{'contrast_factor':     100.0,
-           'bjerrum_length':       10.0,
-           'virial_param':        180.0,
-           'monomer_length':        1.0,
-           'salt_concentration':    0.1,
-           'ionization_degree':     0.5,
-           'polymer_concentration': 0.1,
-           }, 200., 1.80664667511e-06],
-         ]
+    [{'contrast_factor':     100.0,
+      'bjerrum_length':       10.0,
+      'virial_param':        180.0,
+      'monomer_length':        1.0,
+      'salt_concentration':    0.1,
+      'ionization_degree':     0.5,
+      'polymer_concentration': 0.1,
+     }, 200., 1.80664667511e-06],
+    ]
+# pylint: enable=bad-whitespace
Index: sasmodels/models/pearl_necklace.py
===================================================================
--- sasmodels/models/pearl_necklace.py	(revision cf404cbf1344577110785a29f1390cbabc7969b2)
+++ sasmodels/models/pearl_necklace.py	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -1,7 +1,7 @@
 r"""
-This model provides the form factor for a pearl necklace composed of two 
-elements: *N* pearls (homogeneous spheres of radius *R*) freely jointed by *M* 
+This model provides the form factor for a pearl necklace composed of two
+elements: *N* pearls (homogeneous spheres of radius *R*) freely jointed by *M*
 rods (like strings - with a total mass *Mw* = *M* \* *m*\ :sub:`r` + *N* \* *m*\
-:sub:`s`, and the string segment length (or edge separation) *l* 
+:sub:`s`, and the string segment length (or edge separation) *l*
 (= *A* - 2\ *R*)). *A* is the center-to-center pearl separation distance.
 
@@ -13,5 +13,5 @@
 ----------
 
-The output of the scattering intensity function for the PearlNecklaceModel is 
+The output of the scattering intensity function for the PearlNecklaceModel is
 given by (Schweins, 2004)
 
@@ -37,8 +37,8 @@
     \beta(q) &= \frac{\int_{qR}^{q(A-R)}\frac{sin(t)}{t}dt}{ql}
 
-where the mass *m*\ :sub:`i` is (SLD\ :sub:`i` - SLD\ :sub:`solvent`) \* 
+where the mass *m*\ :sub:`i` is (SLD\ :sub:`i` - SLD\ :sub:`solvent`) \*
 (volume of the *N* pearls/rods). *V* is the total volume of the necklace.
 
-The 2D scattering intensity is the same as $P(q)$ above, regardless of the 
+The 2D scattering intensity is the same as $P(q)$ above, regardless of the
 orientation of the *q* vector.
 
@@ -54,5 +54,5 @@
 REFERENCE
 
-R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*, 
+R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*,
 *Macromol. Symp.* 211 (2004) 25-42 2004
 """
@@ -79,19 +79,19 @@
 
 #             ["name", "units", default, [lower, upper], "type","description"],
-parameters = [["radius", "Angstrom", 80.0, [0, inf], "volume", 
+parameters = [["radius", "Angstrom", 80.0, [0, inf], "volume",
                "Mean radius of the chained spheres"],
-              ["edge_separation", "Angstrom", 350.0, [0, inf], "volume", 
+              ["edge_separation", "Angstrom", 350.0, [0, inf], "volume",
                "Mean separation of chained particles"],
-              ["string_thickness", "Angstrom", 2.5, [0, inf], "volume", 
+              ["string_thickness", "Angstrom", 2.5, [0, inf], "volume",
                "Thickness of the chain linkage"],
-              ["number_of_pearls", "none", 3, [0, inf], "volume", 
+              ["number_of_pearls", "none", 3, [0, inf], "volume",
                "Mean number of pearls in each necklace"],
-              ["sld", "Angstrom^2", 1.0, [-inf, inf], "", 
+              ["sld", "Angstrom^2", 1.0, [-inf, inf], "",
                "Scattering length density of the chained spheres"],
-              ["string_sld", "Angstrom^2", 1.0, [-inf, inf], "", 
+              ["string_sld", "Angstrom^2", 1.0, [-inf, inf], "",
                "Scattering length density of the chain linkage"],
-              ["solvent_sld", "Angstrom^2", 6.3, [-inf, inf], "", 
+              ["solvent_sld", "Angstrom^2", 6.3, [-inf, inf], "",
                "Scattering length density of the solvent"],
-              ]
+             ]
 
 source = ["lib/Si.c", "pearl_necklace.c"]
@@ -110,5 +110,5 @@
 # names and the target sasview model name.
 oldname = 'PearlNecklaceModel'
-oldpars = dict(scale='scale',background='background',radius='radius',
+oldpars = dict(scale='scale', background='background', radius='radius',
                number_of_pearls='num_pearls', solvent_sld='sld_solv',
                string_thickness='thick_string', sld='sld_pearl',
Index: sasmodels/models/power_law.py
===================================================================
--- sasmodels/models/power_law.py	(revision eb69cce00f0781ad8f3eec0eb5965a8576d815b5)
+++ sasmodels/models/power_law.py	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -12,9 +12,9 @@
     I(q) = \text{scale} \cdot q^{-\text{power}} + \text{background}
 
-Note the minus sign in front of the exponent. The exponent *power* 
+Note the minus sign in front of the exponent. The exponent *power*
 should therefore be entered as a **positive** number for fitting.
 
-Also note that unlike many other models, *scale* in this model 
-is NOT explicitly related to a volume fraction. Be careful if 
+Also note that unlike many other models, *scale* in this model
+is NOT explicitly related to a volume fraction. Be careful if
 combining this model with other models.
 
@@ -31,12 +31,12 @@
 from numpy import inf, sqrt
 
-name =  "power_law"
+name = "power_law"
 title = "Simple power law with a flat background"
 
-description = """\
-        Evaluates the function
-        I(q) = scale * q^(-power) + background
-        NB: enter power as a positive number!
-        """
+description = """
+    Evaluates the function
+    I(q) = scale * q^(-power) + background
+    NB: enter power as a positive number!
+    """
 category = "shape-independent"
 
@@ -45,5 +45,6 @@
 
 # NB: Scale and Background are implicit parameters on every model
-def Iq(q,power):
+def Iq(q, power):
+    # pylint: disable=missing-docstring
     inten = (q**-power)
     return inten
@@ -51,4 +52,5 @@
 
 def Iqxy(qx, qy, *args):
+    # pylint: disable=missing-docstring
     return Iq(sqrt(qx ** 2 + qy ** 2), *args)
 Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values
@@ -64,4 +66,5 @@
 
 tests = [
-        [ {'scale': 1.0, 'power': 4.0, 'background' : 0.0}, [0.0106939, 0.469418], [7.64644e+07, 20.5949]]
-        ]
+    [{'scale': 1.0, 'power': 4.0, 'background' : 0.0},
+     [0.0106939, 0.469418], [7.64644e+07, 20.5949]],
+    ]
Index: sasmodels/resolution2d.py
===================================================================
--- sasmodels/resolution2d.py	(revision 9404dd3f599fcbe72790aae8a6d176e64f292ea6)
+++ sasmodels/resolution2d.py	(revision 841753cbac7824298effa1aec88a7ee977eb257f)
@@ -2,5 +2,5 @@
 #This software was developed by the University of Tennessee as part of the
 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-#project funded by the US National Science Foundation. 
+#project funded by the US National Science Foundation.
 #See the license text in license.txt
 """
@@ -19,5 +19,5 @@
 ## Defaults
 NR = {'xhigh':10, 'high':5, 'med':5, 'low':3}
-NPHI ={'xhigh':20, 'high':12, 'med':6, 'low':4}
+NPHI = {'xhigh':20, 'high':12, 'med':6, 'low':4}
 
 class Pinhole2D(Resolution):
@@ -25,10 +25,10 @@
     Gaussian Q smearing class for SAS 2d data
     """
-     
+
     def __init__(self, data=None, index=None,
                  nsigma=NSIGMA, accuracy='Low', coords='polar'):
         """
         Assumption: equally spaced bins in dq_r, dq_phi space.
-        
+
         :param data: 2d data used to set the smearing parameters
         :param index: 1d array with len(data) to define the range
@@ -42,8 +42,8 @@
         ## number of bins in r axis for over-sampling
         self.nr = NR[accuracy.lower()]
-        ## number of bins in phi axis for over-sampling 
+        ## number of bins in phi axis for over-sampling
         self.nphi = NPHI[accuracy.lower()]
         ## maximum nsigmas
-        self.nsigma= nsigma
+        self.nsigma = nsigma
         self.coords = coords
         self._init_data(data, index)
@@ -85,7 +85,7 @@
     def _calc_res(self):
         """
-        Over sampling of r_nbins times phi_nbins, calculate Gaussian weights, 
+        Over sampling of r_nbins times phi_nbins, calculate Gaussian weights,
         then find smeared intensity
-        """    
+        """
         nr, nphi = self.nr, self.nphi
         # Total number of bins = # of bins
@@ -143,5 +143,5 @@
         if self.coords == 'polar':
             q_r = sqrt(qx**2 + qy**2)
-            qx_res = ( (dqx*cos(dphi) + q_r) * cos(-q_phi) +
+            qx_res = ((dqx*cos(dphi) + q_r) * cos(-q_phi) +
                            dqy*sin(dphi) * sin(-q_phi))
             qy_res = (-(dqx*cos(dphi) + q_r) * sin(-q_phi) +
@@ -167,70 +167,2 @@
         else:
             return theory
-
-"""
-if __name__ == '__main__':
-    ## Test w/ 2D linear function
-    x = 0.001*np.arange(1, 11)
-    dx = np.ones(len(x))*0.0003
-    y = 0.001*np.arange(1, 11)
-    dy = np.ones(len(x))*0.001
-    z = np.ones(10)
-    dz = sqrt(z)
-
-    from sas.dataloader import Data2D
-    #for i in range(10): print(i, 0.001 + i*0.008/9.0)
-    #for i in range(100): print(i, int(math.floor( (i/ (100/9.0)) )))
-    out = Data2D()
-    out.data = z
-    out.qx_data = x
-    out.qy_data = y
-    out.dqx_data = dx
-    out.dqy_data = dy
-    out.q_data = sqrt(dx * dx + dy * dy)
-    index = np.ones(len(x), dtype = bool)
-    out.mask = index
-    from sas.models.LineModel import LineModel
-    model = LineModel()
-    model.setParam("A", 0)
-
-    smear = Smearer2D(out, model, index)
-    #smear.set_accuracy('Xhigh')
-    value = smear.get_value()
-    ## All data are ones, so the smeared should also be ones.
-    print("Data length =", len(value))
-    print(" 2D linear function, I = 0 + 1*qy")
-    text = " Gaussian weighted averaging on a 2D linear function will "
-    text += "provides the results same as without the averaging."
-    print(text)
-    print("qx_data", "qy_data", "I_nonsmear", "I_smeared")
-    for ind in range(len(value)):
-        print(x[ind], y[ind], model.evalDistribution([x, y])[ind], value[ind])
-
-
-if __name__ == '__main__':
-    ## Another Test w/ constant function
-    x = 0.001*np.arange(1,11)
-    dx = np.ones(len(x))*0.001
-    y = 0.001*np.arange(1,11)
-    dy = np.ones(len(x))*0.001
-    z = np.ones(10)
-    dz = sqrt(z)
-
-    from DataLoader import Data2D
-    #for i in range(10): print(i, 0.001 + i*0.008/9.0)
-    #for i in range(100): print(i, int(math.floor( (i/ (100/9.0)) )))
-    out = Data2D()
-    out.data = z
-    out.qx_data = x
-    out.qy_data = y
-    out.dqx_data = dx
-    out.dqy_data = dy
-    index = np.ones(len(x), dtype = bool)
-    out.mask = index
-    from sas.models.Constant import Constant
-    model = Constant()
-
-    value = Smearer2D(out,model,index).get_value()
-    ## All data are ones, so the smeared values should also be ones.
-    print("Data length =",len(value), ", Data=",value)
-"""
