Index: sasmodels/kernelcl.py
===================================================================
--- sasmodels/kernelcl.py	(revision 664c8e7c9b7f15e584d3dee365484f8ac74ae4d5)
+++ sasmodels/kernelcl.py	(revision c85db69ebc61ae093eb2e72b7a6bf64a0142d56d)
@@ -32,5 +32,5 @@
     context = cl.create_some_context(interactive=False)
     del context
-except Exception,exc:
+except Exception, exc:
     warnings.warn(str(exc))
     raise RuntimeError("OpenCL not available")
@@ -39,5 +39,5 @@
 
 from . import generate
-from .kernelpy import PyInput, PyModel
+from .kernelpy import PyModel
 
 F64_DEFS = """\
@@ -63,5 +63,5 @@
     """
     source, info = generate.make(kernel_module)
-    if callable(info.get('Iq',None)):
+    if callable(info.get('Iq', None)):
         return PyModel(info)
     ## for debugging, save source to a .cl file, edit it, and reload as model
@@ -110,8 +110,8 @@
     device.min_data_type_align_size//4.
     """
-    remainder = vector.size%boundary
+    remainder = vector.size % boundary
     if remainder != 0:
         size = vector.size + (boundary - remainder)
-        vector = np.hstack((vector, [extra]*(size-vector.size)))
+        vector = np.hstack((vector, [extra] * (size - vector.size)))
     return np.ascontiguousarray(vector, dtype=dtype)
 
@@ -126,5 +126,5 @@
     """
     dtype = np.dtype(dtype)
-    if dtype==generate.F64 and not all(has_double(d) for d in context.devices):
+    if dtype == generate.F64 and not all(has_double(d) for d in context.devices):
         raise RuntimeError("Double precision not supported for devices")
 
@@ -135,5 +135,5 @@
     if context.devices[0].type == cl.device_type.GPU:
         header += "#define USE_SINCOS\n"
-    program  = cl.Program(context, header+source).build()
+    program = cl.Program(context, header + source).build()
     return program
 
@@ -173,5 +173,5 @@
         try:
             self.context = cl.create_some_context(interactive=False)
-        except Exception,exc:
+        except Exception, exc:
             warnings.warn(str(exc))
             warnings.warn("pyopencl.create_some_context() failed")
@@ -230,12 +230,12 @@
         self.__dict__ = state.copy()
 
-    def __call__(self, input):
-        if self.dtype != input.dtype:
+    def __call__(self, input_value):
+        if self.dtype != input_value.dtype:
             raise TypeError("data and kernel have different types")
         if self.program is None:
-            self.program = environment().compile_program(self.info['name'],self.source, self.dtype)
-        kernel_name = generate.kernel_name(self.info, input.is_2D)
+            self.program = environment().compile_program(self.info['name'], self.source, self.dtype)
+        kernel_name = generate.kernel_name(self.info, input_value.is_2D)
         kernel = getattr(self.program, kernel_name)
-        return GpuKernel(kernel, self.info, input)
+        return GpuKernel(kernel, self.info, input_value)
 
     def release(self):
@@ -285,5 +285,5 @@
         self.q_vectors = [_stretch_input(q, self.dtype, 32) for q in q_vectors]
         self.q_buffers = [
-            cl.Buffer(env.context,  mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=q)
+            cl.Buffer(env.context, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=q)
             for q in self.q_vectors
         ]
@@ -320,6 +320,6 @@
         self.res = np.empty(input.nq, input.dtype)
         dim = '2d' if input.is_2D else '1d'
-        self.fixed_pars = info['partype']['fixed-'+dim]
-        self.pd_pars = info['partype']['pd-'+dim]
+        self.fixed_pars = info['partype']['fixed-' + dim]
+        self.pd_pars = info['partype']['pd-' + dim]
 
         # Inputs and outputs for each kernel call
@@ -327,8 +327,8 @@
         env = environment()
         self.loops_b = [cl.Buffer(env.context, mf.READ_WRITE,
-                                  2*MAX_LOOPS*input.dtype.itemsize)
+                                  2 * MAX_LOOPS * input.dtype.itemsize)
                         for _ in env.queues]
         self.res_b = [cl.Buffer(env.context, mf.READ_WRITE,
-                                input.global_size[0]*input.dtype.itemsize)
+                                input.global_size[0] * input.dtype.itemsize)
                       for _ in env.queues]
 
@@ -344,5 +344,5 @@
             cutoff = real(cutoff)
             loops_N = [np.uint32(len(p[0])) for p in pd_pars]
-            loops = np.hstack(pd_pars) if pd_pars else np.empty(0,dtype=self.input.dtype)
+            loops = np.hstack(pd_pars) if pd_pars else np.empty(0, dtype=self.input.dtype)
             loops = np.ascontiguousarray(loops.T, self.input.dtype).flatten()
             #print "loops",Nloops, loops
@@ -350,5 +350,5 @@
             #import sys; print >>sys.stderr,"opencl eval",pars
             #print "opencl eval",pars
-            if len(loops) > 2*MAX_LOOPS:
+            if len(loops) > 2 * MAX_LOOPS:
                 raise ValueError("too many polydispersity points")
 
