Index: sansmodels/src/sans/models/c_extensions/CSphereModel.c
===================================================================
--- sansmodels/src/sans/models/c_extensions/CSphereModel.c	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ sansmodels/src/sans/models/c_extensions/CSphereModel.c	(revision 9316609c953db33f23a48a9b91ce5b283ea935f4)
@@ -1,3 +1,3 @@
-/** CSphereModel
+/** [PYTHONCLASS]
  *
  * C extension 
@@ -20,5 +20,5 @@
 
 /// Error object for raised exceptions
-static PyObject * CSphereModelError = NULL;
+static PyObject * [PYTHONCLASS]Error = NULL;
 
 
@@ -32,9 +32,9 @@
     /// Model parameters
 	SphereParameters model_pars;
-} CSphereModel;
+} [PYTHONCLASS];
 
 
 static void
-CSphereModel_dealloc(CSphereModel* self)
+[PYTHONCLASS]_dealloc([PYTHONCLASS]* self)
 {
     self->ob_type->tp_free((PyObject*)self);
@@ -44,9 +44,9 @@
 
 static PyObject *
-CSphereModel_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+[PYTHONCLASS]_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-    CSphereModel *self;
-    
-    self = (CSphereModel *)type->tp_alloc(type, 0);
+    [PYTHONCLASS] *self;
+    
+    self = ([PYTHONCLASS] *)type->tp_alloc(type, 0);
    
     return (PyObject *)self;
@@ -54,5 +54,5 @@
 
 static int
-CSphereModel_init(CSphereModel *self, PyObject *args, PyObject *kwds)
+[PYTHONCLASS]_init([PYTHONCLASS] *self, PyObject *args, PyObject *kwds)
 {
     if (self != NULL) {
@@ -77,8 +77,8 @@
 }
 
-static PyMemberDef CSphereModel_members[] = {
-    {"params", T_OBJECT, offsetof(CSphereModel, params), 0,
+static PyMemberDef [PYTHONCLASS]_members[] = {
+    {"params", T_OBJECT, offsetof([PYTHONCLASS], params), 0,
      "Parameters"},
-    {"log", T_OBJECT, offsetof(CSphereModel, log), 0,
+    {"log", T_OBJECT, offsetof([PYTHONCLASS], log), 0,
      "Log"},
     {NULL}  /* Sentinel */
@@ -89,5 +89,5 @@
     @return double
 */
-double CSphereModel_readDouble(PyObject *p) {
+double [PYTHONCLASS]_readDouble(PyObject *p) {
     if (PyFloat_Check(p)==1) {
         return (double)(((PyFloatObject *)(p))->ob_fval);
@@ -107,5 +107,5 @@
  * @return: function value
  */
-static PyObject * run(CSphereModel *self, PyObject *args) {
+static PyObject * run([PYTHONCLASS] *self, PyObject *args) {
 	double q_value, phi_value;
 	PyObject* pars;
@@ -123,6 +123,6 @@
 	// Get input and determine whether we have to supply a 1D or 2D return value.
 	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
-	    PyErr_SetString(CSphereModelError, 
-	    	"CSphereModel.run expects a q value.");
+	    PyErr_SetString([PYTHONCLASS]Error, 
+	    	"[PYTHONCLASS].run expects a q value.");
 		return NULL;
 	}
@@ -134,12 +134,12 @@
 	    npars = PyList_GET_SIZE(pars); 
 	    if(npars!=2) {
-	    	PyErr_SetString(CSphereModelError, 
-	    		"CSphereModel.run expects a double or a list of dimension 2.");
+	    	PyErr_SetString([PYTHONCLASS]Error, 
+	    		"[PYTHONCLASS].run expects a double or a list of dimension 2.");
 	    	return NULL;
 	    }
 	    // We have a vector q, get the q and phi values at which
 	    // to evaluate I(q,phi)
-	    q_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,0));
-	    phi_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    q_value = [PYTHONCLASS]_readDouble(PyList_GET_ITEM(pars,0));
+	    phi_value = [PYTHONCLASS]_readDouble(PyList_GET_ITEM(pars,1));
 	    // Skip zero
 	    if (q_value==0) {
@@ -151,5 +151,5 @@
 
 		// We have a scalar q, we will evaluate I(q)
-		q_value = CSphereModel_readDouble(pars);		
+		q_value = [PYTHONCLASS]_readDouble(pars);		
 		
 		return Py_BuildValue("d",sphere_analytical_1D(&(self->model_pars),q_value));
@@ -162,5 +162,5 @@
  * @return: function value
  */
-static PyObject * runXY(CSphereModel *self, PyObject *args) {
+static PyObject * runXY([PYTHONCLASS] *self, PyObject *args) {
 	double qx_value, qy_value;
 	PyObject* pars;
@@ -178,6 +178,6 @@
 	// Get input and determine whether we have to supply a 1D or 2D return value.
 	if ( !PyArg_ParseTuple(args,"O",&pars) ) {
-	    PyErr_SetString(CSphereModelError, 
-	    	"CSphereModel.run expects a q value.");
+	    PyErr_SetString([PYTHONCLASS]Error, 
+	    	"[PYTHONCLASS].run expects a q value.");
 		return NULL;
 	}
@@ -189,12 +189,12 @@
 	    npars = PyList_GET_SIZE(pars); 
 	    if(npars!=2) {
-	    	PyErr_SetString(CSphereModelError, 
-	    		"CSphereModel.run expects a double or a list of dimension 2.");
+	    	PyErr_SetString([PYTHONCLASS]Error, 
+	    		"[PYTHONCLASS].run expects a double or a list of dimension 2.");
 	    	return NULL;
 	    }
 	    // We have a vector q, get the qx and qy values at which
 	    // to evaluate I(qx,qy)
-	    qx_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,0));
-	    qy_value = CSphereModel_readDouble(PyList_GET_ITEM(pars,1));
+	    qx_value = [PYTHONCLASS]_readDouble(PyList_GET_ITEM(pars,0));
+	    qy_value = [PYTHONCLASS]_readDouble(PyList_GET_ITEM(pars,1));
 		return Py_BuildValue("d",sphere_analytical_2DXY(&(self->model_pars),qx_value,qy_value));
 
@@ -202,5 +202,5 @@
 
 		// We have a scalar q, we will evaluate I(q)
-		qx_value = CSphereModel_readDouble(pars);		
+		qx_value = [PYTHONCLASS]_readDouble(pars);		
 		
 		return Py_BuildValue("d",sphere_analytical_1D(&(self->model_pars),qx_value));
@@ -208,5 +208,5 @@
 }
 
-static PyObject * reset(CSphereModel *self, PyObject *args) {
+static PyObject * reset([PYTHONCLASS] *self, PyObject *args) {
     
 
@@ -215,5 +215,5 @@
 
 
-static PyMethodDef CSphereModel_methods[] = {
+static PyMethodDef [PYTHONCLASS]_methods[] = {
     {"run",      (PyCFunction)run     , METH_VARARGS,
       "Evaluate the model at a given Q or Q, phi"},
@@ -227,11 +227,11 @@
 };
 
-static PyTypeObject CSphereModelType = {
+static PyTypeObject [PYTHONCLASS]Type = {
     PyObject_HEAD_INIT(NULL)
     0,                         /*ob_size*/
-    "CSphereModel",             /*tp_name*/
-    sizeof(CSphereModel),             /*tp_basicsize*/
+    "[PYTHONCLASS]",             /*tp_name*/
+    sizeof([PYTHONCLASS]),             /*tp_basicsize*/
     0,                         /*tp_itemsize*/
-    (destructor)CSphereModel_dealloc, /*tp_dealloc*/
+    (destructor)[PYTHONCLASS]_dealloc, /*tp_dealloc*/
     0,                         /*tp_print*/
     0,                         /*tp_getattr*/
@@ -249,5 +249,5 @@
     0,                         /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-    "CSphereModel objects",           /* tp_doc */
+    "[PYTHONCLASS] objects",           /* tp_doc */
     0,		               /* tp_traverse */
     0,		               /* tp_clear */
@@ -256,6 +256,6 @@
     0,		               /* tp_iter */
     0,		               /* tp_iternext */
-    CSphereModel_methods,             /* tp_methods */
-    CSphereModel_members,             /* tp_members */
+    [PYTHONCLASS]_methods,             /* tp_methods */
+    [PYTHONCLASS]_members,             /* tp_members */
     0,                         /* tp_getset */
     0,                         /* tp_base */
@@ -264,7 +264,7 @@
     0,                         /* tp_descr_set */
     0,                         /* tp_dictoffset */
-    (initproc)CSphereModel_init,      /* tp_init */
+    (initproc)[PYTHONCLASS]_init,      /* tp_init */
     0,                         /* tp_alloc */
-    CSphereModel_new,                 /* tp_new */
+    [PYTHONCLASS]_new,                 /* tp_new */
 };
 
@@ -278,16 +278,16 @@
  * @param module: module to add the class to
  */ 
-void addCSphereModel(PyObject *module) {
+void add[PYTHONCLASS](PyObject *module) {
 	PyObject *d;
 	
-    if (PyType_Ready(&CSphereModelType) < 0)
+    if (PyType_Ready(&[PYTHONCLASS]Type) < 0)
         return;
 
-    Py_INCREF(&CSphereModelType);
-    PyModule_AddObject(module, "CSphereModel", (PyObject *)&CSphereModelType);
+    Py_INCREF(&[PYTHONCLASS]Type);
+    PyModule_AddObject(module, "[PYTHONCLASS]", (PyObject *)&[PYTHONCLASS]Type);
     
     d = PyModule_GetDict(module);
-    CSphereModelError = PyErr_NewException("CSphereModel.error", NULL, NULL);
-    PyDict_SetItemString(d, "CSphereModelError", CSphereModelError);
-}
-
+    [PYTHONCLASS]Error = PyErr_NewException("[PYTHONCLASS].error", NULL, NULL);
+    PyDict_SetItemString(d, "[PYTHONCLASS]Error", [PYTHONCLASS]Error);
+}
+
