Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision cd289474f05b7a39cccd795f21f84befdf2a8788)
+++ sasmodels/generate.py	(revision b297ba9e837aada12de87cd46ea7a01bfe549da7)
@@ -190,4 +190,12 @@
 
 def get_data_path(external_dir, target_file):
+    """
+    Search for the target file relative in the installed application.
+
+    Search first in the location of the generate module in case we are
+    running directly from the distribution.  Search next to the python
+    executable for windows installs.  Search in the ../Resources directory
+    next to the executable for Mac OS/X installs.
+    """
     path = abspath(dirname(__file__))
     if exists(joinpath(path, target_file)):
@@ -225,6 +233,6 @@
 #
 # NOTE: there is an RST_PROLOG at the end of this file which is NOT
-# used for the bundled documentation. Still as long as we are defining the macros
-# in two places any new addition should define the macro in both places.
+# used for the bundled documentation. Still as long as we are defining the
+# macros in two places any new addition should define the macro in both places.
 RST_UNITS = {
     "Ang": "|Ang|",
@@ -530,5 +538,5 @@
 
 def test_tag_float():
-    """check that floating point constants are properly identified and tagged with 'f'"""
+    """Check that floating point constants are identified and tagged with 'f'"""
 
     cases = """
@@ -707,5 +715,6 @@
     return False
 
-_SHELL_VOLUME_PATTERN = re.compile(r"(^|\s)double\s+shell_volume[(]", flags=re.MULTILINE)
+_SHELL_VOLUME_PATTERN = re.compile(r"(^|\s)double\s+shell_volume[(]",
+                                   flags=re.MULTILINE)
 def contains_shell_volume(source):
     # type: (List[str]) -> bool
@@ -801,5 +810,5 @@
             logger.warn("oriented shapes should define Iqac or Iqabc")
         else:
-            raise ValueError("Expected function Iqac or Iqabc for oriented shape")
+            raise ValueError("Expected Iqac or Iqabc for oriented shape")
 
     # Define the parameter table
@@ -815,14 +824,24 @@
         refs = _call_pars("_v.", partable.form_volume_parameters)
         if is_hollow:
-            call_volume = "#define CALL_VOLUME(_form, _shell, _v) do { _form = form_volume(%s); _shell = shell_volume(%s); } while (0)"%((",".join(refs),)*2)
+            call_volume = (
+                "#define CALL_VOLUME(_form, _shell, _v) "
+                "do { _form = form_volume(%s); _shell = shell_volume(%s); } "
+                "while (0)") % ((",".join(refs),)*2)
         else:
-            call_volume = "#define CALL_VOLUME(_form, _shell, _v) do { _form = _shell = form_volume(%s); } while (0)"%(",".join(refs))
+            call_volume = (
+                "#define CALL_VOLUME(_form, _shell, _v) "
+                "do { _form = _shell = form_volume(%s); } "
+                "while (0)") % (",".join(refs))
         if model_info.effective_radius_type:
-            call_effective_radius = "#define CALL_EFFECTIVE_RADIUS(_mode, _v) effective_radius(_mode, %s)"%(",".join(refs))
+            call_effective_radius = (
+                "#define CALL_EFFECTIVE_RADIUS(_mode, _v) "
+                "effective_radius(_mode, %s)") % (",".join(refs))
     else:
         # Model doesn't have volume.  We could make the kernel run a little
         # faster by not using/transferring the volume normalizations, but
         # the ifdef's reduce readability more than is worthwhile.
-        call_volume = "#define CALL_VOLUME(_form, _shell, _v) do { _form = _shell = 1.0; } while (0)"
+        call_volume = (
+            "#define CALL_VOLUME(_form, _shell, _v) "
+            "do { _form = _shell = 1.0; } while (0)")
     source.append(call_volume)
     source.append(call_effective_radius)
@@ -879,12 +898,11 @@
     source.append("#define MAGNETIC_PARS %s"%",".join(str(k) for k in magpars))
     source.append("#define PROJECTION %d"%PROJECTION)
-    # TODO: allow mixed python/opencl kernels?
-    ocl = _kernels(kernel_code, call_iq, clear_iq, call_iqxy, clear_iqxy, model_info.name)
-    dll = _kernels(kernel_code, call_iq, clear_iq, call_iqxy, clear_iqxy, model_info.name)
-
-    result = {
-        'dll': '\n'.join(source+dll[0]+dll[1]+dll[2]),
-        'opencl': '\n'.join(source+ocl[0]+ocl[1]+ocl[2]),
-    }
+    wrappers = _kernels(kernel_code, call_iq, clear_iq,
+                        call_iqxy, clear_iqxy, model_info.name)
+    code = '\n'.join(source + wrappers[0] + wrappers[1] + wrappers[2])
+
+    # Note: Identical code for dll and opencl.  This may not always be the case
+    # so leave them as separate entries in the returned value.
+    result = {'dll': code, 'opencl': code}
     return result
 
