Index: sansmodels/src/sans/models/BinaryHSModel.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/BinaryHSModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class BinaryHSModel(CBinaryHSModel, BaseComponent):
     """ Class that evaluates a BinaryHSModel model. 
-    	This file was auto-generated from ..\c_extensions\binaryHS.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\binaryHS.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          l_radius        = 100.0 [A]
          s_radius        = 25.0 [A]
@@ -58,5 +58,5 @@
 		background: incoherent background"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['l_radius'] = ['[A]', None, None]
@@ -65,5 +65,5 @@
         self.details['vol_frac_ss'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['l_radius.width', 's_radius.width']
         
@@ -74,4 +74,23 @@
         """ Return a identical copy of self """
         return self._clone(BinaryHSModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/BinaryHSPSF11Model.py
===================================================================
--- sansmodels/src/sans/models/BinaryHSPSF11Model.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/BinaryHSPSF11Model.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class BinaryHSPSF11Model(CBinaryHSPSF11Model, BaseComponent):
     """ Class that evaluates a BinaryHSPSF11Model model. 
-    	This file was auto-generated from ..\c_extensions\binaryHS_PSF11.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\binaryHS_PSF11.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          l_radius        = 160.0 [A]
          s_radius        = 25.0 [A]
@@ -65,5 +65,5 @@
 		background: incoherent background"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['l_radius'] = ['[A]', None, None]
@@ -76,5 +76,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['l_radius.width', 's_radius.width']
         
@@ -85,4 +85,23 @@
         """ Return a identical copy of self """
         return self._clone(BinaryHSPSF11Model())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/CoreShellCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/CoreShellCylinderModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/CoreShellCylinderModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class CoreShellCylinderModel(CCoreShellCylinderModel, BaseComponent):
     """ Class that evaluates a CoreShellCylinderModel model. 
-    	This file was auto-generated from ..\c_extensions\core_shell_cylinder.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\core_shell_cylinder.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius          = 20.0 [A]
@@ -80,5 +80,5 @@
 		phi: the axis_phi of the cylinder..."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -93,5 +93,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'radius.width', 'thickness.width']
         
@@ -102,4 +102,23 @@
         """ Return a identical copy of self """
         return self._clone(CoreShellCylinderModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/CoreShellEllipsoidModel.py
===================================================================
--- sansmodels/src/sans/models/CoreShellEllipsoidModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/CoreShellEllipsoidModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class CoreShellEllipsoidModel(CCoreShellEllipsoidModel, BaseComponent):
     """ Class that evaluates a CoreShellEllipsoidModel model. 
-    	This file was auto-generated from ..\c_extensions\spheroid.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\spheroid.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          equat_core      = 200.0 [A]
@@ -75,5 +75,5 @@
 		prolate :  polar radius > equatorial radius"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -88,5 +88,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['equat_core.width', 'polar_core.width', 'equat_shell.width', 'polar_shell.width', 'axis_phi.width', 'axis_theta.width']
         
@@ -97,4 +97,23 @@
         """ Return a identical copy of self """
         return self._clone(CoreShellEllipsoidModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/CoreShellModel.py
===================================================================
--- sansmodels/src/sans/models/CoreShellModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/CoreShellModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class CoreShellModel(CCoreShellModel, BaseComponent):
     """ Class that evaluates a CoreShellModel model. 
-    	This file was auto-generated from ..\c_extensions\core_shell.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\core_shell.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius          = 60.0 [A]
@@ -63,5 +63,5 @@
 		John Wiley and Sons, New York, 1955."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -73,5 +73,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['thickness.width', 'radius.width']
         
@@ -82,4 +82,23 @@
         """ Return a identical copy of self """
         return self._clone(CoreShellModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/CylinderModel.py
===================================================================
--- sansmodels/src/sans/models/CylinderModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/CylinderModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class CylinderModel(CCylinderModel, BaseComponent):
     """ Class that evaluates a CylinderModel model. 
-    	This file was auto-generated from ..\c_extensions\cylinder.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\cylinder.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius          = 20.0 [A]
@@ -66,5 +66,5 @@
 		f(q)^(2)*sin(alpha)*dalpha+ bkg"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -76,5 +76,5 @@
         self.details['cyl_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['cyl_phi.width', 'cyl_theta.width', 'length.width', 'radius.width']
         
@@ -85,4 +85,23 @@
         """ Return a identical copy of self """
         return self._clone(CylinderModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/DiamCylFunc.py
===================================================================
--- sansmodels/src/sans/models/DiamCylFunc.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/DiamCylFunc.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class DiamCylFunc(CDiamCylFunc, BaseComponent):
     """ Class that evaluates a DiamCylFunc model. 
-    	This file was auto-generated from ..\c_extensions\DiamCyl.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\DiamCyl.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          radius          = 20.0 A
          length          = 400.0 A
@@ -52,10 +52,10 @@
 		virial coefficient."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['radius'] = ['A', None, None]
         self.details['length'] = ['A', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['radius.width', 'length.width']
         
@@ -66,4 +66,23 @@
         """ Return a identical copy of self """
         return self._clone(DiamCylFunc())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/DiamEllipFunc.py
===================================================================
--- sansmodels/src/sans/models/DiamEllipFunc.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/DiamEllipFunc.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class DiamEllipFunc(CDiamEllipFunc, BaseComponent):
     """ Class that evaluates a DiamEllipFunc model. 
-    	This file was auto-generated from ..\c_extensions\DiamEllip.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\DiamEllip.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          radius_a        = 20.0 A
          radius_b        = 400.0 A
@@ -56,10 +56,10 @@
 		radius_a < radius_b: Oblate spheroid."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['radius_a'] = ['A', None, None]
         self.details['radius_b'] = ['A', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['radius_a.width', 'radius_b.width']
         
@@ -70,4 +70,23 @@
         """ Return a identical copy of self """
         return self._clone(DiamEllipFunc())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/EllipsoidModel.py
===================================================================
--- sansmodels/src/sans/models/EllipsoidModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/EllipsoidModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class EllipsoidModel(CEllipsoidModel, BaseComponent):
     """ Class that evaluates a EllipsoidModel model. 
-    	This file was auto-generated from ..\c_extensions\ellipsoid.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\ellipsoid.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius_a        = 20.0 [A]
@@ -70,5 +70,5 @@
 		rotation axis of the ellipsoid"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -80,5 +80,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['axis_phi.width', 'axis_theta.width', 'radius_a.width', 'radius_b.width', 'length.width', 'r_minor.width']
         
@@ -89,4 +89,23 @@
         """ Return a identical copy of self """
         return self._clone(EllipsoidModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/EllipticalCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/EllipticalCylinderModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/EllipticalCylinderModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class EllipticalCylinderModel(CEllipticalCylinderModel, BaseComponent):
     """ Class that evaluates a EllipticalCylinderModel model. 
-    	This file was auto-generated from ..\c_extensions\elliptical_cylinder.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\elliptical_cylinder.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          r_minor         = 20.0 [A]
@@ -60,5 +60,5 @@
 		background = incoherent background"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -72,5 +72,5 @@
         self.details['cyl_psi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['cyl_phi.width', 'cyl_theta.width', 'cyl_psi.width', 'length.width', 'r_minor.width', 'r_ratio.width']
         
@@ -81,4 +81,23 @@
         """ Return a identical copy of self """
         return self._clone(EllipticalCylinderModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/FlexibleCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/FlexibleCylinderModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/FlexibleCylinderModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class FlexibleCylinderModel(CFlexibleCylinderModel, BaseComponent):
     """ Class that evaluates a FlexibleCylinderModel model. 
-    	This file was auto-generated from ..\c_extensions\flexible_cylinder.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\flexible_cylinder.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          length          = 1000.0 [A]
@@ -56,5 +56,5 @@
 		during model fitting."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -65,5 +65,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['length.width', 'kuhn_length.width', 'radius.width']
         
@@ -74,4 +74,23 @@
         """ Return a identical copy of self """
         return self._clone(FlexibleCylinderModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/Gaussian.py
===================================================================
--- sansmodels/src/sans/models/Gaussian.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/Gaussian.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class Gaussian(CGaussian, BaseComponent):
     """ Class that evaluates a Gaussian model. 
-    	This file was auto-generated from ..\c_extensions\gaussian.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\gaussian.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          sigma           = 1.0 
@@ -50,5 +50,5 @@
         self.description ="""f(x)=scale * 1/(sigma^2*2pi)e^(-(x-mu)^2/2sigma^2)"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -56,5 +56,5 @@
         self.details['center'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=[]
         
@@ -65,4 +65,23 @@
         """ Return a identical copy of self """
         return self._clone(Gaussian())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/HardsphereStructure.py
===================================================================
--- sansmodels/src/sans/models/HardsphereStructure.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/HardsphereStructure.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class HardsphereStructure(CHardsphereStructure, BaseComponent):
     """ Class that evaluates a HardsphereStructure model. 
-    	This file was auto-generated from ..\c_extensions\Hardsphere.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\Hardsphere.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          effect_radius   = 50.0 [A]
          volfraction     = 0.2 
@@ -60,10 +60,10 @@
 		Rev. 1958, 110, 1."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['effect_radius'] = ['[A]', None, None]
         self.details['volfraction'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['effect_radius.width']
         
@@ -74,4 +74,23 @@
         """ Return a identical copy of self """
         return self._clone(HardsphereStructure())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/HayterMSAStructure.py
===================================================================
--- sansmodels/src/sans/models/HayterMSAStructure.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/HayterMSAStructure.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class HayterMSAStructure(CHayterMSAStructure, BaseComponent):
     """ Class that evaluates a HayterMSAStructure model. 
-    	This file was auto-generated from ..\c_extensions\HayterMSA.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\HayterMSA.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          effect_radius   = 20.75 [A]
          charge          = 19.0 
@@ -66,5 +66,5 @@
 		"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['effect_radius'] = ['[A]', None, None]
@@ -75,5 +75,5 @@
         self.details['dielectconst'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['effect_radius.width']
         
@@ -84,4 +84,23 @@
         """ Return a identical copy of self """
         return self._clone(HayterMSAStructure())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/HollowCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/HollowCylinderModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/HollowCylinderModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class HollowCylinderModel(CHollowCylinderModel, BaseComponent):
     """ Class that evaluates a HollowCylinderModel model. 
-    	This file was auto-generated from ..\c_extensions\hollow_cylinder.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\hollow_cylinder.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          core_radius     = 20.0 [A]
@@ -60,5 +60,5 @@
 		background = incoherent background"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -71,5 +71,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', 'radius']
         
@@ -80,4 +80,23 @@
         """ Return a identical copy of self """
         return self._clone(HollowCylinderModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/LamellarFFHGModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarFFHGModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/LamellarFFHGModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class LamellarFFHGModel(CLamellarFFHGModel, BaseComponent):
     """ Class that evaluates a LamellarFFHGModel model. 
-    	This file was auto-generated from ..\c_extensions\lamellarFF_HG.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\lamellarFF_HG.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          t_length        = 15.0 [A]
@@ -61,5 +61,5 @@
 		"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -71,5 +71,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['t_length.width', 'h_thickness.width']
         
@@ -80,4 +80,23 @@
         """ Return a identical copy of self """
         return self._clone(LamellarFFHGModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/LamellarModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/LamellarModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class LamellarModel(CLamellarModel, BaseComponent):
     """ Class that evaluates a LamellarModel model. 
-    	This file was auto-generated from ..\c_extensions\lamellar.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\lamellar.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          bi_thick        = 50.0 [A]
@@ -60,5 +60,5 @@
 		"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -68,5 +68,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=[]
         
@@ -77,4 +77,23 @@
         """ Return a identical copy of self """
         return self._clone(LamellarModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/LamellarPSHGModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarPSHGModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/LamellarPSHGModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class LamellarPSHGModel(CLamellarPSHGModel, BaseComponent):
     """ Class that evaluates a LamellarPSHGModel model. 
-    	This file was auto-generated from ..\c_extensions\lamellarPS_HG.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\lamellarPS_HG.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          spacing         = 40.0 [A]
@@ -75,5 +75,5 @@
 		scale = scale factor ..."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -88,5 +88,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['deltaT.width', 'deltaH.width', 'spacing.width']
         
@@ -97,4 +97,23 @@
         """ Return a identical copy of self """
         return self._clone(LamellarPSHGModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/LamellarPSModel.py
===================================================================
--- sansmodels/src/sans/models/LamellarPSModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/LamellarPSModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class LamellarPSModel(CLamellarPSModel, BaseComponent):
     """ Class that evaluates a LamellarPSModel model. 
-    	This file was auto-generated from ..\c_extensions\lamellarPS.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\lamellarPS.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          spacing         = 400.0 [A]
@@ -71,5 +71,5 @@
 		scale = scale factor"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -81,5 +81,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['delta.width', 'spacing.width']
         
@@ -90,4 +90,23 @@
         """ Return a identical copy of self """
         return self._clone(LamellarPSModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/LogNormal.py
===================================================================
--- sansmodels/src/sans/models/LogNormal.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/LogNormal.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class LogNormal(CLogNormal, BaseComponent):
     """ Class that evaluates a LogNormal model. 
-    	This file was auto-generated from ..\c_extensions\logNormal.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\logNormal.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          sigma           = 1.0 
@@ -50,5 +50,5 @@
         self.description ="""f(x)=scale * 1/(sigma*math.sqrt(2pi))e^(-1/2*((math.log(x)-mu)/sigma)^2)"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -56,5 +56,5 @@
         self.details['center'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=[]
         
@@ -65,4 +65,23 @@
         """ Return a identical copy of self """
         return self._clone(LogNormal())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/Lorentzian.py
===================================================================
--- sansmodels/src/sans/models/Lorentzian.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/Lorentzian.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class Lorentzian(CLorentzian, BaseComponent):
     """ Class that evaluates a Lorentzian model. 
-    	This file was auto-generated from ..\c_extensions\lorentzian.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\lorentzian.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          gamma           = 1.0 
@@ -50,5 +50,5 @@
         self.description ="""f(x)=scale * 1/pi 0.5gamma / [ (x-x_0)^2 + (0.5gamma)^2 ]"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -56,5 +56,5 @@
         self.details['center'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=[]
         
@@ -65,4 +65,23 @@
         """ Return a identical copy of self """
         return self._clone(Lorentzian())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/MultiShellModel.py
===================================================================
--- sansmodels/src/sans/models/MultiShellModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/MultiShellModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class MultiShellModel(CMultiShellModel, BaseComponent):
     """ Class that evaluates a MultiShellModel model. 
-    	This file was auto-generated from ..\c_extensions\multishell.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\multishell.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          core_radius     = 60.0 [A]
@@ -63,5 +63,5 @@
 		background: incoherent background"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -74,5 +74,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['core_radius.width', 's_thickness.width', 'w_thickness.width']
         
@@ -83,4 +83,23 @@
         """ Return a identical copy of self """
         return self._clone(MultiShellModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/MultiplicationModel.py
===================================================================
--- sansmodels/src/sans/models/MultiplicationModel.py	(revision 1affe6428c00b7595341313f851a2277f11ea93e)
+++ sansmodels/src/sans/models/MultiplicationModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -58,5 +58,5 @@
         obj.p_model  = self.p_model.clone()
         obj.s_model  = self.s_model.clone()
-        
+        #obj = copy.deepcopy(self)
         return obj
     
Index: sansmodels/src/sans/models/OblateModel.py
===================================================================
--- sansmodels/src/sans/models/OblateModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/OblateModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class OblateModel(COblateModel, BaseComponent):
     """ Class that evaluates a OblateModel model. 
-    	This file was auto-generated from ..\c_extensions\oblate.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\oblate.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          major_core      = 200.0 [A]
@@ -73,5 +73,5 @@
 		that shell radii are larger than core radii."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -86,5 +86,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['major_core.width', 'minor_core.width', 'major_shell.width', 'minor_shell.width']
         
@@ -95,4 +95,23 @@
         """ Return a identical copy of self """
         return self._clone(OblateModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/ParallelepipedModel.py
===================================================================
--- sansmodels/src/sans/models/ParallelepipedModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/ParallelepipedModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class ParallelepipedModel(CParallelepipedModel, BaseComponent):
     """ Class that evaluates a ParallelepipedModel model. 
-    	This file was auto-generated from ..\c_extensions\parallelepiped.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\parallelepiped.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          short_a         = 35.0 [A]
@@ -63,5 +63,5 @@
 		background:Incoherent Background [1/cm]"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -75,5 +75,5 @@
         self.details['parallel_psi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['short_a.width', 'short_b.width', 'long_c.width', 'parallel_phi.width', 'parallel_psi.width', 'parallel_theta.width']
         
@@ -84,4 +84,23 @@
         """ Return a identical copy of self """
         return self._clone(ParallelepipedModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/ProlateModel.py
===================================================================
--- sansmodels/src/sans/models/ProlateModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/ProlateModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class ProlateModel(CProlateModel, BaseComponent):
     """ Class that evaluates a ProlateModel model. 
-    	This file was auto-generated from ..\c_extensions\prolate.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\prolate.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          major_core      = 100.0 [A]
@@ -71,5 +71,5 @@
 		that shell radii are larger than core radii."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -82,5 +82,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['major_core.width', 'minor_core.width', 'major_shell.width', 'minor_shell.width']
         
@@ -91,4 +91,23 @@
         """ Return a identical copy of self """
         return self._clone(ProlateModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/Schulz.py
===================================================================
--- sansmodels/src/sans/models/Schulz.py	(revision c5607face45b9ab9a29b4327be335352e037d1d6)
+++ sansmodels/src/sans/models/Schulz.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -17,5 +17,5 @@
 
 	WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY
- 	         DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/schulz.h
+ 	         DO NOT MODIFY THIS FILE, MODIFY ..\c_extensions\schulz.h
  	         AND RE-RUN THE GENERATOR SCRIPT
 
@@ -28,8 +28,8 @@
 class Schulz(CSchulz, BaseComponent):
     """ Class that evaluates a Schulz model. 
-    	This file was auto-generated from ../c_extensions/schulz.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\schulz.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          sigma           = 1.0 
@@ -52,5 +52,5 @@
 		z= math.pow[(1/(sigma/center),2]-1"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -58,5 +58,5 @@
         self.details['center'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=[]
         
@@ -67,4 +67,23 @@
         """ Return a identical copy of self """
         return self._clone(Schulz())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/SphereModel.py
===================================================================
--- sansmodels/src/sans/models/SphereModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/SphereModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class SphereModel(CSphereModel, BaseComponent):
     """ Class that evaluates a SphereModel model. 
-    	This file was auto-generated from ..\c_extensions\sphere.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\sphere.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius          = 60.0 [A]
@@ -60,5 +60,5 @@
 		"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -67,5 +67,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['radius.width']
         
@@ -76,4 +76,23 @@
         """ Return a identical copy of self """
         return self._clone(SphereModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/SquareWellStructure.py
===================================================================
--- sansmodels/src/sans/models/SquareWellStructure.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/SquareWellStructure.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class SquareWellStructure(CSquareWellStructure, BaseComponent):
     """ Class that evaluates a SquareWellStructure model. 
-    	This file was auto-generated from ..\c_extensions\SquareWell.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\SquareWell.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          effect_radius   = 50.0 [A]
          volfraction     = 0.04 
@@ -66,5 +66,5 @@
 		K. C., Physica, 1977, 89A, 213."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['effect_radius'] = ['[A]', None, None]
@@ -73,5 +73,5 @@
         self.details['wellwidth'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['effect_radius.width']
         
@@ -82,4 +82,23 @@
         """ Return a identical copy of self """
         return self._clone(SquareWellStructure())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/StackedDisksModel.py
===================================================================
--- sansmodels/src/sans/models/StackedDisksModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/StackedDisksModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class StackedDisksModel(CStackedDisksModel, BaseComponent):
     """ Class that evaluates a StackedDisksModel model. 
-    	This file was auto-generated from ..\c_extensions\stacked_disks.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\stacked_disks.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 0.01 
          radius          = 3000.0 [A]
@@ -67,5 +67,5 @@
 		solvent_sld = the SLD of the solvent"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -82,5 +82,5 @@
         self.details['axis_phi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['core_thick.width', 'layer_thick.width', 'radius.width', 'axis_theta.width', 'axis_phi.width']
         
@@ -91,4 +91,23 @@
         """ Return a identical copy of self """
         return self._clone(StackedDisksModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/StickyHSStructure.py
===================================================================
--- sansmodels/src/sans/models/StickyHSStructure.py	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/StickyHSStructure.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class StickyHSStructure(CStickyHSStructure, BaseComponent):
     """ Class that evaluates a StickyHSStructure model. 
-    	This file was auto-generated from ..\c_extensions\StickyHS.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\StickyHS.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          effect_radius   = 50.0 [A]
          volfraction     = 0.1 
@@ -66,5 +66,5 @@
 		Phys., 1991, 95(12), 9186-9190."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['effect_radius'] = ['[A]', None, None]
@@ -73,5 +73,5 @@
         self.details['stickiness'] = ['', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['effect_radius.width']
         
@@ -82,4 +82,23 @@
         """ Return a identical copy of self """
         return self._clone(StickyHSStructure())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/TriaxialEllipsoidModel.py
===================================================================
--- sansmodels/src/sans/models/TriaxialEllipsoidModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/TriaxialEllipsoidModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class TriaxialEllipsoidModel(CTriaxialEllipsoidModel, BaseComponent):
     """ Class that evaluates a TriaxialEllipsoidModel model. 
-    	This file was auto-generated from ..\c_extensions\triaxial_ellipsoid.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\triaxial_ellipsoid.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          semi_axisA      = 35.0 [A]
@@ -58,5 +58,5 @@
 		not be correct."""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -70,5 +70,5 @@
         self.details['axis_psi'] = ['[rad]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['axis_psi.width', 'axis_phi.width', 'axis_theta.width', 'semi_axisA.width', 'semi_axisB.width', 'semi_axisC.width']
         
@@ -79,4 +79,23 @@
         """ Return a identical copy of self """
         return self._clone(TriaxialEllipsoidModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/VesicleModel.py
===================================================================
--- sansmodels/src/sans/models/VesicleModel.py	(revision 27972c1dfdd57a50946a99914051e1713c997e78)
+++ sansmodels/src/sans/models/VesicleModel.py	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class VesicleModel(CVesicleModel, BaseComponent):
     """ Class that evaluates a VesicleModel model. 
-    	This file was auto-generated from ..\c_extensions\vesicle.h.
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	List of default parameters:
+        This file was auto-generated from ..\c_extensions\vesicle.h.
+        Refer to that file and the structure it contains
+        for details of the model.
+        List of default parameters:
          scale           = 1.0 
          radius          = 100.0 [A]
@@ -58,5 +58,5 @@
 		scale : scale factor"""
        
-		## Parameter details [units, min, max]
+        ## Parameter details [units, min, max]
         self.details = {}
         self.details['scale'] = ['', None, None]
@@ -67,5 +67,5 @@
         self.details['background'] = ['[1/cm]', None, None]
 
-		## fittable parameters
+        ## fittable parameters
         self.fixed=['radius.width', 'thickness.width']
         
@@ -76,4 +76,23 @@
         """ Return a identical copy of self """
         return self._clone(VesicleModel())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        print "__dict__",self.__dict__
+        #self.__dict__['params'] = self.params
+        #self.__dict__['dispersion'] = self.dispersion
+        #self.__dict__['log'] = self.log
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
Index: sansmodels/src/sans/models/c_models/modelTemplate.txt
===================================================================
--- sansmodels/src/sans/models/c_models/modelTemplate.txt	(revision f9bf66165686c721c2f0b3a197f7dda1822721ad)
+++ sansmodels/src/sans/models/c_models/modelTemplate.txt	(revision fe9c19b40dbe89e6d4c6ac8339eb8e3b843f7ab5)
@@ -28,8 +28,8 @@
 class [PYTHONCLASS]([CPYTHONCLASS], BaseComponent):
     """ Class that evaluates a [PYTHONCLASS] model. 
-    	This file was auto-generated from [INCLUDE_FILE].
-    	Refer to that file and the structure it contains
-    	for details of the model.
-    	[DEFAULT_LIST]
+        This file was auto-generated from [INCLUDE_FILE].
+        Refer to that file and the structure it contains
+        for details of the model.
+        [DEFAULT_LIST]
     """
         
@@ -46,6 +46,6 @@
         self.description ="""[DESCRIPTION]"""
        
-		[PAR_DETAILS]
-		## fittable parameters
+        [PAR_DETAILS]
+        ## fittable parameters
         self.fixed=[FIXED]
         
@@ -56,4 +56,19 @@
         """ Return a identical copy of self """
         return self._clone([PYTHONCLASS]())   
+        
+    def __getstate__(self):
+        """ return object state for pickling and copying """
+        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log}
+        
+        return self.__dict__, model_state
+        
+    def __setstate__(self, state):
+        """ create object from pickled state """
+        
+        self.__dict__, model_state = state
+        self.params = model_state['params']
+        self.dispersion = model_state['dispersion']
+        self.log = model_state['log']
+       	
    
     def run(self, x = 0.0):
