Index: sasmodels/resolution.py
===================================================================
--- sasmodels/resolution.py	(revision 29aa28f4aa10013a08bfb4f8b4b3bc7e86f863fe)
+++ sasmodels/resolution.py	(revision 33c8d731de1592fa12dc4ad97723f4bac228a31e)
@@ -28,7 +28,7 @@
     q = None
     q_calc = None
-    def apply(self, Iq_calc):
-        """
-        Smear *Iq_calc* by the resolution function, returning *Iq*.
+    def apply(self, theory):
+        """
+        Smear *theory* by the resolution function, returning *Iq*.
         """
         raise NotImplementedError("Subclass does not define the apply function")
@@ -43,6 +43,6 @@
         self.q_calc = self.q = q
 
-    def apply(self, Iq_calc):
-        return Iq_calc
+    def apply(self, theory):
+        return theory
 
 class Pinhole1D(Resolution1D):
@@ -52,8 +52,8 @@
     *q* points at which the data is measured.
 
-    *dq* gaussian 1-sigma resolution at each data point.
+    *q_width* gaussian 1-sigma resolution at each data point.
 
     *q_calc* is the list of points to calculate, or None if this should
-    be autogenerated from the *q,dq*.
+    be autogenerated from the *q,q_width*.
     """
     def __init__(self, q, q_width, q_calc=None):
@@ -74,6 +74,6 @@
                 self.q, np.maximum(q_width, MINIMUM_RESOLUTION))
 
-    def apply(self, Iq_calc):
-        return apply_resolution_matrix(self.weight_matrix, Iq_calc)
+    def apply(self, theory):
+        return apply_resolution_matrix(self.weight_matrix, theory)
 
 class Slit1D(Resolution1D):
@@ -98,14 +98,14 @@
             slit_resolution(self.q_calc, self.q, self.qx_width, self.qy_width)
 
-    def apply(self, Iq_calc):
-        return apply_resolution_matrix(self.weight_matrix, Iq_calc)
-
-
-def apply_resolution_matrix(weight_matrix, Iq_calc):
+    def apply(self, theory):
+        return apply_resolution_matrix(self.weight_matrix, theory)
+
+
+def apply_resolution_matrix(weight_matrix, theory):
     """
     Apply the resolution weight matrix to the computed theory function.
     """
-    #print "apply shapes",Iq_calc.shape, self.weight_matrix.shape
-    Iq = np.dot(Iq_calc[None,:], weight_matrix)
+    #print "apply shapes",theory.shape, self.weight_matrix.shape
+    Iq = np.dot(theory[None,:], weight_matrix)
     #print "result shape",Iq.shape
     return Iq.flatten()
@@ -123,5 +123,5 @@
     edges = bin_edges(q_calc)
     edges[edges<0.0] = 0.0 # clip edges below zero
-    index = (q_width>0.0) # treat perfect resolution differently
+    index = (q_width > 0.0) # treat perfect resolution differently
     G = erf( (edges[:,None] - q[None,:]) / (sqrt(2.0)*q_width)[None,:] )
     weights = G[1:] - G[:-1]
@@ -168,5 +168,5 @@
     # Make q_calc into a row vector, and q, qx_width, qy_width into columns
     # Make weights match [ q_calc X q ]
-    weights = np.zeros((len(q),len(q_calc)),'d')
+    weights = np.zeros((len(q),len(q_calc)), 'd')
     q_calc = q_calc[None,:]
     q, qx_width, qy_width, edges = [
@@ -226,5 +226,5 @@
 
     def setUp(self):
-        self.x = 0.001*np.arange(1,11)
+        self.x = 0.001*np.arange(1, 11)
         self.y = self.Iq(self.x)
 
@@ -238,6 +238,6 @@
         """
         resolution = Perfect1D(self.x)
-        Iq_calc = self.Iq(resolution.q_calc)
-        output = resolution.apply(Iq_calc)
+        theory = self.Iq(resolution.q_calc)
+        output = resolution.apply(theory)
         np.testing.assert_equal(output, self.y)
 
@@ -247,6 +247,6 @@
         """
         resolution = Slit1D(self.x, 0., 0.)
-        Iq_calc = self.Iq(resolution.q_calc)
-        output = resolution.apply(Iq_calc)
+        theory = self.Iq(resolution.q_calc)
+        output = resolution.apply(theory)
         np.testing.assert_equal(output, self.y)
 
@@ -257,9 +257,8 @@
         """
         resolution = Slit1D(self.x, 0., 0.005)
-        Iq_calc = self.Iq(resolution.q_calc)
-        output = resolution.apply(Iq_calc)
-        # The following commented line was the correct output for even bins [see smearer.cpp for details]
-        #answer = [ 9.666,  9.056,  8.329,  7.494,  6.642,  5.721,  4.774,  3.824,  2.871, 2.   ]
-        answer = [ 9.0618,  8.6401,  8.1186,  7.1391,  6.1528,  5.5555,     4.5584,  3.5606,  2.5623, 2.    ]
+        theory = self.Iq(resolution.q_calc)
+        output = resolution.apply(theory)
+        answer = [ 9.0618, 8.6401, 8.1186, 7.1391, 6.1528,
+                   5.5555, 4.5584, 3.5606, 2.5623, 2. ]
         np.testing.assert_allclose(output, answer, atol=1e-4)
 
@@ -269,6 +268,6 @@
         """
         resolution = Pinhole1D(self.x, 0.0*self.x)
-        Iq_calc = self.Iq(resolution.q_calc)
-        output = resolution.apply(Iq_calc)
+        theory = self.Iq(resolution.q_calc)
+        output = resolution.apply(theory)
         np.testing.assert_equal(output, self.y)
 
@@ -279,9 +278,9 @@
         resolution = Pinhole1D(self.x, 0.001*np.ones_like(self.x),
                                q_calc=self.x)
-        Iq_calc = 12.0-1000.0*resolution.q_calc
-        output = resolution.apply(Iq_calc)
-        answer = [ 10.44785079,   9.84991299,   8.98101708,
-                  7.99906585,   6.99998311,   6.00001689,
-                  5.00093415,   4.01898292,   3.15008701,   2.55214921]
+        theory = 12.0-1000.0*resolution.q_calc
+        output = resolution.apply(theory)
+        answer = [ 10.44785079, 9.84991299, 8.98101708,
+                  7.99906585, 6.99998311, 6.00001689,
+                  5.00093415, 4.01898292, 3.15008701, 2.55214921]
         np.testing.assert_allclose(output, answer, atol=1e-8)
 
@@ -395,18 +394,18 @@
 
     def setUp(self):
-        # sample q, dq, I(q) calculated by NIST Igor SANS package
+        # sample q, q_width, I(q) calculated by NIST Igor SANS package
         self.data = np.loadtxt(SPHERE_RESOLUTION_TEST_DATA.split('\n')).T
         self.pars = dict(scale=1.0, background=0.01, radius=60.0,
                          solvent_sld=6.3, sld=1)
 
-    def Iq(self, q, dq):
+    def Iq(self, q, q_width):
         from sasmodels import core
         from sasmodels.models import sphere
 
         model = core.load_model(sphere)
-        resolution = Pinhole1D(q, dq)
+        resolution = Pinhole1D(q, q_width)
         kernel = core.make_kernel(model, [resolution.q_calc])
-        Iq_calc = core.call_kernel(kernel, self.pars)
-        result = resolution.apply(Iq_calc)
+        theory = core.call_kernel(kernel, self.pars)
+        result = resolution.apply(theory)
         return result
 
@@ -415,6 +414,6 @@
         Compare pinhole resolution smearing with NIST Igor SANS
         """
-        q, dq, answer = self.data
-        output = self.Iq(q, dq)
+        q, q_width, answer = self.data
+        output = self.Iq(q, q_width)
         np.testing.assert_allclose(output, answer, rtol=0.006)
 
@@ -425,6 +424,6 @@
         Compare pinhole resolution smearing with NIST Igor SANS on sparse data
         """
-        q, dq, answer = self.data[:, ::20]  # Take every nth point
-        output = self.Iq(q, dq)
+        q, q_width, answer = self.data[:, ::20]  # Take every nth point
+        output = self.Iq(q, q_width)
         np.testing.assert_allclose(output, answer, rtol=0.006)
 
@@ -459,9 +458,9 @@
 
     kernel = core.make_kernel(model, [resolution.q_calc])
-    Iq_calc = core.call_kernel(kernel, {'length':210, 'radius':500})
-    Iq = resolution.apply(Iq_calc)
+    theory = core.call_kernel(kernel, {'length':210, 'radius':500})
+    Iq = resolution.apply(theory)
 
     import matplotlib.pyplot as plt
-    plt.loglog(resolution.q_calc, Iq_calc, label='unsmeared')
+    plt.loglog(resolution.q_calc, theory, label='unsmeared')
     plt.loglog(resolution.q, Iq, label='smeared', hold=True)
     plt.legend()
@@ -471,11 +470,11 @@
 
 def demo_pinhole_1d():
-    q = np.logspace(-3,-1,400)
-    dq = 0.1*q
-    resolution = Pinhole1D(q, dq)
+    q = np.logspace(-3, -1, 400)
+    q_width = 0.1*q
+    resolution = Pinhole1D(q, q_width)
     _eval_demo_1d(resolution, title="10% dQ/Q Pinhole Resolution")
 
 def demo_slit_1d():
-    q = np.logspace(-3,-1,400)
+    q = np.logspace(-3, -1, 400)
     qx_width = 0.005
     qy_width = 0.0
