Index: sansmodels/src/sans/models/qsmearing.py
===================================================================
--- sansmodels/src/sans/models/qsmearing.py	(revision 946b4527178d910cc365e06f5e3dd4d10d613182)
+++ sansmodels/src/sans/models/qsmearing.py	(revision 2b44050468fac236bb1e3762fd4afa1c6d0bf1e2)
@@ -11,6 +11,5 @@
 import logging
 import sys
-import copy
-import sans_extension.smearer as smearer 
+import sans.models.sans_extension.smearer as smearer 
 from sans.models.smearing_2d import Smearer2D
 
@@ -95,5 +94,15 @@
         self._smearer = None
         self.model = None
-    
+        
+    def __deepcopy__(self, memo={}):
+        """
+        Return a valid copy of self.
+        Avoid copying the _smearer C object and force a matrix recompute
+        when the copy is used.  
+        """
+        result = _BaseSmearer()
+        result.nbins = self.nbins
+        return result
+
     def _compute_matrix(self):
         """
@@ -116,4 +125,5 @@
         if q_max == None:
             q_max = self.max
+
         _qmin_unsmeared, _qmax_unsmeared = self.get_unsmeared_range(q_min,
                                                                      q_max)
@@ -162,10 +172,10 @@
         iq_in_temp = iq_in
         if self.model != None:
-            temp_first, temp_last = self._get_extrapolated_bin(first_bin, 
-                                                               last_bin)
+            temp_first, temp_last = self._get_extrapolated_bin( \
+                                                        first_bin, last_bin)
             if self.nbins_low > 0:
-                iq_in_low = self.model.evalDistribution(
+                iq_in_low = self.model.evalDistribution( \
                                     numpy.fabs(self.qvalues[0:self.nbins_low]))
-            iq_in_high = self.model.evalDistribution(
+            iq_in_high = self.model.evalDistribution( \
                                             self.qvalues[(len(self.qvalues) - \
                                             self.nbins_high - 1):])
@@ -181,4 +191,6 @@
             temp_first = first_bin
             temp_last = last_bin
+            #iq_in_temp = iq_in
+
         # Sanity check
         if len(iq_in_temp) != self.nbins:
@@ -288,5 +300,4 @@
         self.qvalues  = None
         
-   
     def _initialize_smearer(self):
         """
@@ -332,5 +343,4 @@
         self.nbins_low = 0
         self.nbins_high = 0
-        self.data = data1D
         self.model = model
         if data1D.dxw is not None and len(data1D.dxw) == len(data1D.x):
@@ -377,52 +387,4 @@
         self.qvalues = data1d_x
         
-    def __deepcopy__(self, memo={}):
-        """
-        Return a valid copy of self.
-        Avoid copying the _smearer C object and force a matrix recompute
-        when the copy is used.  
-        """
-        result = SlitSmearer(self.data, self.model)
-        result.width = self.width
-        result.height = self.height
-        result.nbins_low = self.nbins_low
-        result.nbins_high = self.nbins_high
-        result.data = copy.deepcopy(self.data)
-        result.model = copy.deepcopy(self.model)
-        result.nbins = self.nbins
-        result.nbins_low = self.nbins_low
-        result.nbins_high = self.nbins_high
-        result._weights = self._weights
-        ## Internal flag to keep track of C++ smearer initialization
-        result._init_complete = self._init_complete
-        import sans_extension.smearer as smearer 
-        result._smearer =  smearer.new_slit_smearer_with_q(self.width, 
-                                                    self.height, self.qvalues)
-        return result
-
-        
-    def __setstate__(self, state):
-        """
-        Restore the state of the object by reconstruction the (smearer) object
-        """
-        self.__dict__, self.model,  self.data = state
-        import sans_extension.smearer as smearer 
-        self._smearer = smearer.new_slit_smearer_with_q(self.width, 
-                                                    self.height, self.qvalues)
-        self.__dict__['_smearer'] = self._smearer
-        
-    def __reduce_ex__(self, proto):
-        """
-        Overwrite the __reduce_ex__to avoid pickle PyCobject(smearer)
-        """
-        model = copy.deepcopy(self.model)
-        data = copy.deepcopy(self.data)
-        dict = {}
-        for k , v in self.__dict__.iteritems():
-            if k != "_smearer":
-                dict[k] = v
-        state = (dict, model, data)
-        return (SlitSmearer, (data, model), state, None, None)
-        
 
 class _QSmearer(_BaseSmearer):
@@ -452,5 +414,4 @@
         self._weights = None
         self.qvalues  = None
-      
         
     def _initialize_smearer(self):
@@ -496,8 +457,7 @@
         super(QSmearer, self).__init__()
         data1d_x = []
-        self.data =  copy.deepcopy(data1D)
         self.nbins_low = 0
         self.nbins_high = 0
-        self.model = copy.deepcopy(model)
+        self.model = model
         ## Resolution
         #self.width = numpy.zeros(len(data1D.x))
@@ -510,4 +470,5 @@
             self.nbins_low, self.nbins_high, self.width, data1d_x = \
                                 get_qextrapolate(self.width, data1D.x)
+
         ## Number of Q bins
         self.nbins = len(data1d_x)
@@ -518,52 +479,4 @@
         ## Q-values
         self.qvalues = data1d_x
-       
-        
-    def __deepcopy__(self, memo={}):
-        """
-        Return a valid copy of self.
-        Avoid copying the _smearer C object and force a matrix recompute
-        when the copy is used.  
-        """
-        result = QSmearer(self.data, self.model)
-        result.nbins = self.nbins
-        result.min = self.min
-        result.max = self.max
-        result.nbins_low = self.nbins_low
-        result.nbins_high = self.nbins_high
-        result.width = copy.deepcopy(self.width)
-        result._weights = copy.deepcopy(self._weights)
-        result.qvalues = copy.deepcopy(self.qvalues)
-        ## Internal flag to keep track of C++ smearer initialization
-        result._init_complete = self._init_complete
-        import sans_extension.smearer as smearer 
-        result._smearer =  smearer.new_q_smearer_with_q(numpy.asarray(result.width),
-                                                      result.qvalues)
-        return result
-
-        
-    def __setstate__(self, state):
-        """
-        Restore the state of the object by reconstruction the (smearer) object
-        """
-        self.__dict__, self.model,  self.data = state
-        import sans_extension.smearer as smearer 
-        self._smearer =  smearer.new_q_smearer_with_q(numpy.asarray(self.width),
-                                                      self.qvalues)
-        self.__dict__['_smearer'] = self._smearer
- 
-    def __reduce_ex__(self, proto):
-        """
-        Overwrite the __reduce_ex__to avoid pickle PyCobject(smearer)
-        """
-        model = copy.deepcopy(self.model)
-        data = copy.deepcopy(self.data)
-        dict = {}
-        for k , v in self.__dict__.iteritems():
-            if k != "_smearer":
-                dict[k] = v
-        state = (dict, model, data)
-        return (QSmearer, (data, model), state, None, None)
-    
 
         
