Index: park_integration/AbstractFitEngine.py
===================================================================
--- park_integration/AbstractFitEngine.py	(revision 189be4ecb48d4ceaae77716ee32a7244f256ac29)
+++ park_integration/AbstractFitEngine.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -1,6 +1,9 @@
 
-
-import logging, sys
-import park,numpy,math, copy
+import  copy
+import logging
+import sys
+import numpy
+import math
+import park
 from DataLoader.data_info import Data1D
 from DataLoader.data_info import Data2D
@@ -18,5 +21,5 @@
         
         """
-        self._model, self._name = model,name
+        self._model, self._name = model, name
         #set the value for the parameter of the given name
         self.set(model.getParam(name))
@@ -31,5 +34,5 @@
         return self._model.getParam(self.name)
     
-    def _setvalue(self,value):
+    def _setvalue(self, value):
         """
         override the _setvalue pf park parameter
@@ -48,5 +51,5 @@
         """
         #if not  self.name in self._model.getDispParamList():
-        lo,hi = self._model.details[self.name][1:3]
+        lo, hi = self._model.details[self.name][1:3]
         if lo is None: lo = -numpy.inf
         if hi is None: hi = numpy.inf
@@ -58,7 +61,7 @@
             raise ValueError,"wrong fit range for parameters"
         
-        return lo,hi
-    
-    def _setrange(self,r):
+        return lo, hi
+    
+    def _setrange(self, r):
         """
         override _setrange of park parameter
@@ -68,5 +71,5 @@
         """
         self._model.details[self.name][1:3] = r
-    range = property(_getrange,_setrange)
+    range = property(_getrange, _setrange)
     
 class Model(park.Model):
@@ -87,8 +90,8 @@
         self.parkp = [SansParameter(p,sans_model) for p in self.sansp]
         #list of parameterset 
-        self.parameterset = park.ParameterSet(sans_model.name,pars=self.parkp)
-        self.pars=[]
+        self.parameterset = park.ParameterSet(sans_model.name, pars=self.parkp)
+        self.pars = []
   
-    def getParams(self,fitparams):
+    def getParams(self, fitparams):
         """
         return a list of value of paramter to fit
@@ -97,14 +100,14 @@
         
         """
-        list=[]
-        self.pars=[]
-        self.pars=fitparams
+        list = []
+        self.pars = []
+        self.pars = fitparams
         for item in fitparams:
             for element in self.parkp:
-                 if element.name ==str(item):
+                 if element.name == str(item):
                      list.append(element.value)
         return list
     
-    def setParams(self,paramlist, params):
+    def setParams(self, paramlist, params):
         """
         Set value for parameters to fit
@@ -116,11 +119,11 @@
             for i in range(len(self.parkp)):
                 for j in range(len(paramlist)):
-                    if self.parkp[i].name==paramlist[j]:
+                    if self.parkp[i].name == paramlist[j]:
                         self.parkp[i].value = params[j]
-                        self.model.setParam(self.parkp[i].name,params[j])
+                        self.model.setParam(self.parkp[i].name, params[j])
         except:
             raise
   
-    def eval(self,x):
+    def eval(self, x):
         """
         override eval method of park model. 
@@ -141,6 +144,5 @@
     a way to get residuals from data.
     """
-    def __init__(self,x, y,dx= None, dy=None, smearer=None):
-        Data1D.__init__(self, x=numpy.array(x), y=numpy.array(y), dx=dx, dy=dy)
+    def __init__(self, x, y, dx=None, dy=None, smearer=None):
         """
         :param smearer: is an object of class QSmearer or SlitSmearer
@@ -162,21 +164,24 @@
             
         """
+        Data1D.__init__(self, x=x, y=y, dx=dx, dy=dy)
+        
         self.smearer = smearer
         
         # Check error bar; if no error bar found, set it constant(=1)
         # TODO: Should provide an option for users to set it like percent, constant, or dy data
-        if dy ==None or dy==[] or dy.all()==0:
-            self.dy= numpy.ones(len(y))  
+        if dy == None or dy == [] or dy.all() == 0:
+            self.dy = numpy.ones(len(y))  
         else:
-            self.dy= numpy.asarray(dy).copy()
+            self.dy = numpy.asarray(dy).copy()
 
         ## Min Q-value
         #Skip the Q=0 point, especially when y(q=0)=None at x[0].
-        if min (self.x) ==0.0 and self.x[0]==0 and not numpy.isfinite(self.y[0]):
+        if min (self.x) == 0.0 and self.x[0] == 0 and\
+                     not numpy.isfinite(self.y[0]):
             self.qmin = min(self.x[self.x!=0])
         else:                              
-            self.qmin= min (self.x)
+            self.qmin = min(self.x)
         ## Max Q-value
-        self.qmax = max (self.x)
+        self.qmax = max(self.x)
         
         # Range used for input to smearing
@@ -184,21 +189,18 @@
         self._qmax_unsmeared = self.qmax
         # Identify the bin range for the unsmeared and smeared spaces
-        self.idx = (self.x>=self.qmin) & (self.x <= self.qmax)
-        self.idx_unsmeared = (self.x>=self._qmin_unsmeared) & (self.x <= self._qmax_unsmeared)
+        self.idx = (self.x >= self.qmin) & (self.x <= self.qmax)
+        self.idx_unsmeared = (self.x >= self._qmin_unsmeared) \
+                            & (self.x <= self._qmax_unsmeared)
   
-       
-       
-    def setFitRange(self,qmin=None,qmax=None):
+    def setFitRange(self, qmin=None, qmax=None):
         """ to set the fit range"""
         # Skip Q=0 point, (especially for y(q=0)=None at x[0]).
         # ToDo: Find better way to do it.
-        if qmin==0.0 and not numpy.isfinite(self.y[qmin]):
-            self.qmin = min(self.x[self.x!=0])
-        elif qmin!=None:                       
+        if qmin == 0.0 and not numpy.isfinite(self.y[qmin]):
+            self.qmin = min(self.x[self.x != 0])
+        elif qmin != None:                       
             self.qmin = qmin            
-
-        if qmax !=None:
+        if qmax != None:
             self.qmax = qmax
-            
         # Determine the range needed in unsmeared-Q to cover
         # the smeared Q range
@@ -207,17 +209,19 @@
         
         self._first_unsmeared_bin = 0
-        self._last_unsmeared_bin  = len(self.x)-1
+        self._last_unsmeared_bin  = len(self.x) - 1
         
         if self.smearer!=None:
-            self._first_unsmeared_bin, self._last_unsmeared_bin = self.smearer.get_bin_range(self.qmin, self.qmax)
+            self._first_unsmeared_bin, self._last_unsmeared_bin = \
+                    self.smearer.get_bin_range(self.qmin, self.qmax)
             self._qmin_unsmeared = self.x[self._first_unsmeared_bin]
             self._qmax_unsmeared = self.x[self._last_unsmeared_bin]
             
         # Identify the bin range for the unsmeared and smeared spaces
-        self.idx = (self.x>=self.qmin) & (self.x <= self.qmax)
-        self.idx = self.idx & (self.dy!=0)   ## zero error can not participate for fitting
-        self.idx_unsmeared = (self.x>=self._qmin_unsmeared) & (self.x <= self._qmax_unsmeared)
+        self.idx = (self.x >= self.qmin) & (self.x <= self.qmax)
+        ## zero error can not participate for fitting
+        self.idx = self.idx & (self.dy != 0)  
+        self.idx_unsmeared = (self.x >= self._qmin_unsmeared) \
+                            & (self.x <= self._qmax_unsmeared)
   
-        
     def getFitRange(self):
         """
@@ -239,17 +243,17 @@
         """
         # Compute theory data f(x)
-        fx= numpy.zeros(len(self.x))
+        fx = numpy.zeros(len(self.x))
         fx[self.idx_unsmeared] = fn(self.x[self.idx_unsmeared])
        
         ## Smear theory data
         if self.smearer is not None:
-            fx = self.smearer(fx, self._first_unsmeared_bin, self._last_unsmeared_bin)
-
+            fx = self.smearer(fx, self._first_unsmeared_bin, 
+                              self._last_unsmeared_bin)
         ## Sanity check
-        if numpy.size(self.dy)!= numpy.size(fx):
-            raise RuntimeError, "FitData1D: invalid error array %d <> %d" % (numpy.shape(self.dy),
-                                                                              numpy.size(fx))
-                                                                              
-        return (self.y[self.idx]-fx[self.idx])/self.dy[self.idx]
+        if numpy.size(self.dy) != numpy.size(fx):
+            msg = "FitData1D: invalid error array "
+            msg += "%d <> %d" % (numpy.shape(self.dy), numpy.size(fx))                                                      
+            raise RuntimeError, msg  
+        return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx]
      
     def residuals_deriv(self, model, pars=[]):
@@ -262,30 +266,29 @@
         return []
     
-    
 class FitData2D(Data2D):
     """ Wrapper class  for SANS data """
-    def __init__(self,sans_data2d ,data=None, err_data=None):
-        Data2D.__init__(self, data= data, err_data= err_data)
+    def __init__(self, sans_data2d, data=None, err_data=None):
+        Data2D.__init__(self, data=data, err_data= err_data)
         """
         Data can be initital with a data (sans plottable)
         or with vectors.
         """
-        self.res_err_image=[]
-        self.index_model=[]
-        self.qmin= None
-        self.qmax= None
+        self.res_err_image = []
+        self.index_model = []
+        self.qmin = None
+        self.qmax = None
         self.smearer = None
-        self.set_data(sans_data2d )
-
-        
-    def set_data(self, sans_data2d, qmin=None, qmax=None ):
+        self.set_data(sans_data2d)
+
+        
+    def set_data(self, sans_data2d, qmin=None, qmax=None):
         """
         Determine the correct qx_data and qy_data within range to fit
         """
-        self.data     = sans_data2d.data
+        self.data = sans_data2d.data
         self.err_data = sans_data2d.err_data
         self.qx_data = sans_data2d.qx_data
         self.qy_data = sans_data2d.qy_data
-        self.mask       = sans_data2d.mask
+        self.mask = sans_data2d.mask
 
         x_max = max(math.fabs(sans_data2d.xmin), math.fabs(sans_data2d.xmax))
@@ -296,16 +299,17 @@
             self.qmin = 1e-16
         if qmax == None:
-            self.qmax = math.sqrt(x_max*x_max +y_max*y_max)
+            self.qmax = math.sqrt(x_max * x_max + y_max * y_max)
         ## new error image for fitting purpose
-        if self.err_data== None or self.err_data ==[]:
-            self.res_err_data= numpy.ones(len(self.data))
+        if self.err_data == None or self.err_data == []:
+            self.res_err_data = numpy.ones(len(self.data))
         else:
             self.res_err_data = copy.deepcopy(self.err_data)
         #self.res_err_data[self.res_err_data==0]=1
         
-        self.radius= numpy.sqrt(self.qx_data**2 + self.qy_data**2)
+        self.radius = numpy.sqrt(self.qx_data**2 + self.qy_data**2)
         
         # Note: mask = True: for MASK while mask = False for NOT to mask
-        self.index_model = ((self.qmin <= self.radius)&(self.radius<= self.qmax))
+        self.index_model = ((self.qmin <= self.radius)&\
+                            (self.radius <= self.qmax))
         self.index_model = (self.index_model) & (self.mask)
         self.index_model = (self.index_model) & (numpy.isfinite(self.data))
@@ -321,14 +325,15 @@
         self.smearer.get_data()
 
-    def setFitRange(self,qmin=None,qmax=None):
+    def setFitRange(self, qmin=None, qmax=None):
         """ to set the fit range"""
-        if qmin==0.0:
+        if qmin == 0.0:
             self.qmin = 1e-16
-        elif qmin!=None:                       
+        elif qmin != None:                       
             self.qmin = qmin            
-        if qmax!=None:
-            self.qmax= qmax        
-        self.radius= numpy.sqrt(self.qx_data**2 + self.qy_data**2)
-        self.index_model = ((self.qmin <= self.radius)&(self.radius<= self.qmax))
+        if qmax != None:
+            self.qmax = qmax        
+        self.radius = numpy.sqrt(self.qx_data**2 + self.qy_data**2)
+        self.index_model = ((self.qmin <= self.radius)&\
+                            (self.radius <= self.qmax))
         self.index_model = (self.index_model) &(self.mask)
         self.index_model = (self.index_model) & (numpy.isfinite(self.data))
@@ -352,7 +357,9 @@
             gn = fn.get_value()  
         else:
-            gn = fn([self.qx_data[self.index_model],self.qy_data[self.index_model]])
+            gn = fn([self.qx_data[self.index_model],
+                     self.qy_data[self.index_model]])
         # use only the data point within ROI range
-        res=(self.data[self.index_model] - gn)/self.res_err_data[self.index_model]
+        res = (self.data[self.index_model] - gn)/\
+                    self.res_err_data[self.index_model]
         return res
         
@@ -418,5 +425,5 @@
         #import thread
         self.model.setParams(self.paramlist,params)
-        self.res= self.data.residuals(self.model.eval)
+        self.res = self.data.residuals(self.model.eval)
         if self.fitresult is not None and  self.handler is not None:
             self.fitresult.set_model(model=self.model)
@@ -450,10 +457,10 @@
         :param listdata: list of data 
         
-        :return Data: Data is wrapper class for sans plottable. it is created with all parameters
-            of data concatenanted
+        :return Data: Data is wrapper class for sans plottable.
+         it is created with all parameters of data concatenanted
             
         :raise: if listdata is empty  will return None
-        :raise: if data in listdata don't contain dy field ,will create an error
-            during fitting
+        :raise: if data in listdata don't contain dy field ,
+        will create an error during fitting
             
         """
@@ -467,34 +474,33 @@
         #return listdata[0]
         
-        if listdata==[]:
+        if listdata == []:
             raise ValueError, " data list missing"
         else:
-            xtemp=[]
-            ytemp=[]
-            dytemp=[]
-            self.mini=None
-            self.maxi=None
+            xtemp = []
+            ytemp = []
+            dytemp = []
+            self.mini = None
+            self.maxi = None
                
             for item in listdata:
-                data=item.data
-                mini,maxi=data.getFitRange()
-                if self.mini==None and self.maxi==None:
-                    self.mini=mini
-                    self.maxi=maxi
+                data = item.data
+                mini, maxi = data.getFitRange()
+                if self.mini == None and self.maxi == None:
+                    self.mini = mini
+                    self.maxi = maxi
                 else:
                     if mini < self.mini:
-                        self.mini=mini
+                        self.mini = mini
                     if self.maxi < maxi:
-                        self.maxi=maxi
-                        
-                    
+                        self.maxi = maxi
                 for i in range(len(data.x)):
                     xtemp.append(data.x[i])
                     ytemp.append(data.y[i])
-                    if data.dy is not None and len(data.dy)==len(data.y):   
+                    if data.dy is not None and len(data.dy) == len(data.y):   
                         dytemp.append(data.dy[i])
                     else:
-                        raise RuntimeError, "Fit._concatenateData: y-errors missing"
-            data= Data(x=xtemp,y=ytemp,dy=dytemp)
+                        msg = "Fit._concatenateData: y-errors missing"
+                        raise RuntimeError, msg
+            data = Data(x=xtemp, y=ytemp, dy=dytemp)
             data.setFitRange(self.mini, self.maxi)
             return data
@@ -525,20 +531,20 @@
             raise ValueError, "AbstractFitEngine: Need to set model to fit"
         
-        new_model= model
+        new_model = model
         if not issubclass(model.__class__, Model):
-            new_model= Model(model)
-        
-        if len(constraints)>0:
+            new_model = Model(model)
+        
+        if len(constraints) > 0:
             for constraint in constraints:
                 name, value = constraint
                 try:
-                    new_model.parameterset[ str(name)].set( str(value) )
+                    new_model.parameterset[str(name)].set(str(value))
                 except:
-                    msg= "Fit Engine: Error occurs when setting the constraint"
+                    msg = "Fit Engine: Error occurs when setting the constraint"
                     msg += " %s for parameter %s "%(value, name)
                     raise ValueError, msg
                 
-        if len(pars) >0:
-            temp=[]
+        if len(pars) > 0:
+            temp = []
             for item in pars:
                 if item in new_model.model.getParamList():
@@ -547,18 +553,19 @@
                 else:
                     
-                    msg = "wrong parameter %s used"%str(item)
-                    msg += "to set model %s. Choose"%str(new_model.model.name)
-                    msg += "parameter name within %s"%str(new_model.model.getParamList())
-                    raise ValueError,msg
+                    msg = "wrong parameter %s used" % str(item)
+                    msg += "to set model %s. Choose" % str(new_model.model.name)
+                    msg += "parameter name within %s" % \
+                                str(new_model.model.getParamList())
+                    raise ValueError, msg
               
             #A fitArrange is already created but contains dList only at Uid
             if self.fitArrangeDict.has_key(Uid):
                 self.fitArrangeDict[Uid].set_model(new_model)
-                self.fitArrangeDict[Uid].pars= pars
+                self.fitArrangeDict[Uid].pars = pars
             else:
             #no fitArrange object has been create with this Uid
                 fitproblem = FitArrange()
                 fitproblem.set_model(new_model)
-                fitproblem.pars= pars
+                fitproblem.pars = pars
                 self.fitArrangeDict[Uid] = fitproblem
                 
@@ -566,5 +573,5 @@
             raise ValueError, "park_integration:missing parameters"
     
-    def set_data(self,data,Uid,smearer=None,qmin=None,qmax=None):
+    def set_data(self, data, Uid, smearer=None, qmin=None, qmax=None):
         """ 
         Receives plottable, creates a list of data to fit,set data
@@ -576,10 +583,12 @@
         
         """
-        if data.__class__.__name__=='Data2D':
-            fitdata=FitData2D(sans_data2d=data, data=data.data, err_data= data.err_data)
+        if data.__class__.__name__ == 'Data2D':
+            fitdata = FitData2D(sans_data2d=data, data=data.data,
+                                 err_data=data.err_data)
         else:
-            fitdata=FitData1D(x=data.x, y=data.y , dx= data.dx,dy=data.dy,smearer=smearer)
+            fitdata = FitData1D(x=data.x, y=data.y ,
+                                 dx=data.dx, dy=data.dy, smearer=smearer)
        
-        fitdata.setFitRange(qmin=qmin,qmax=qmax)
+        fitdata.setFitRange(qmin=qmin, qmax=qmax)
         #A fitArrange is already created but contains model only at Uid
         if self.fitArrangeDict.has_key(Uid):
@@ -587,9 +596,9 @@
         else:
         #no fitArrange object has been create with this Uid
-            fitproblem= FitArrange()
+            fitproblem = FitArrange()
             fitproblem.add_data(fitdata)
-            self.fitArrangeDict[Uid]=fitproblem    
+            self.fitArrangeDict[Uid] = fitproblem    
    
-    def get_model(self,Uid):
+    def get_model(self, Uid):
         """ 
         
@@ -605,10 +614,10 @@
             return None
     
-    def remove_Fit_Problem(self,Uid):
+    def remove_Fit_Problem(self, Uid):
         """remove   fitarrange in Uid"""
         if self.fitArrangeDict.has_key(Uid):
             del self.fitArrangeDict[Uid]
             
-    def select_problem_for_fit(self,Uid,value):
+    def select_problem_for_fit(self, Uid, value):
         """
         select a couple of model and data at the Uid position in dictionary
@@ -620,7 +629,7 @@
         """
         if self.fitArrangeDict.has_key(Uid):
-             self.fitArrangeDict[Uid].set_to_fit( value)
+             self.fitArrangeDict[Uid].set_to_fit(value)
              
-    def get_problem_to_fit(self,Uid):
+    def get_problem_to_fit(self, Uid):
         """
         return the self.selected value of the fit problem of Uid
@@ -644,11 +653,11 @@
         """
         self.model = None
-        self.dList =[]
-        self.pars=[]
+        self.dList = []
+        self.pars = []
         #self.selected  is zero when this fit problem is not schedule to fit 
         #self.selected is 1 when schedule to fit 
         self.selected = 0
         
-    def set_model(self,model):
+    def set_model(self, model):
         """ 
         set_model save a copy of the model
@@ -659,5 +668,5 @@
         self.model = model
         
-    def add_data(self,data):
+    def add_data(self, data):
         """ 
         add_data fill a self.dList with data to fit
@@ -686,5 +695,5 @@
         return self.dList[0] 
       
-    def remove_data(self,data):
+    def remove_data(self, data):
         """
         Remove one element from the list
@@ -703,5 +712,5 @@
         
         """
-        self.selected= value
+        self.selected = value
         
     def get_to_fit(self):
Index: park_integration/Fitting.py
===================================================================
--- park_integration/Fitting.py	(revision aa36f962b10b61665ca22df9bb4bc57c0e3bee55)
+++ park_integration/Fitting.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -5,5 +5,5 @@
 """
 
-from scipy import optimize
+#from scipy import optimize
 from ScipyFitting import ScipyFit
 from ParkFitting import ParkFit
@@ -33,5 +33,5 @@
         self.set_engine(engine)
           
-    def set_engine(self,word):
+    def set_engine(self, word):
         """
         Select the type of Fit 
@@ -43,7 +43,7 @@
              
         """
-        if word=="scipy":
-            self._engine=ScipyFit()
-        elif word=="park":
+        if word == "scipy":
+            self._engine = ScipyFit()
+        elif word == "park":
             self._engine=ParkFit()
         else:
@@ -53,16 +53,15 @@
         """Perform the fit """
         try:
-            return self._engine.fit(q,handler, curr_thread= curr_thread)
+            return self._engine.fit(q,handler, curr_thread=curr_thread)
         except:
             raise
     
-    def set_model(self,model,Uid,pars=[],constraints=[]):
+    def set_model(self, model, Uid, pars=[], constraints=[]):
         """
         store a model model to fit at the position Uid of the fit engine
         """
-        self._engine.set_model(model,Uid,pars,constraints)
+        self._engine.set_model(model, Uid, pars, constraints)
    
-   
-    def set_data(self,data,Uid,smearer=None,qmin=None, qmax=None):
+    def set_data(self, data, Uid, smearer=None, qmin=None, qmax=None):
         """
         Store data to fit at the psotion Uid of the fit engine
@@ -74,18 +73,16 @@
         
         """
-        self._engine.set_data(data,Uid,smearer,qmin, qmax)
+        self._engine.set_data(data, Uid, smearer, qmin, qmax)
         
-        
-    def get_model(self,Uid):
+    def get_model(self, Uid):
         """ return list of data"""
         self._engine.get_model(Uid)
 
 
-    def remove_Fit_Problem(self,Uid):
+    def remove_Fit_Problem(self, Uid):
         """remove fitarrange in Uid"""
         self._engine.remove_Fit_Problem(Uid)
         
-        
-    def select_problem_for_fit(self,Uid,value):
+    def select_problem_for_fit(self, Uid, value):
         """
         select a couple of model and data at the Uid position in dictionary
@@ -95,8 +92,7 @@
              can only have the value one or zero
         """
-        self._engine.select_problem_for_fit(Uid,value)
+        self._engine.select_problem_for_fit(Uid, value)
         
-        
-    def get_problem_to_fit(self,Uid):
+    def get_problem_to_fit(self, Uid):
         """
         return the self.selected value of the fit problem of Uid
Index: park_integration/Loader.py
===================================================================
--- park_integration/Loader.py	(revision aa36f962b10b61665ca22df9bb4bc57c0e3bee55)
+++ park_integration/Loader.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -1,5 +1,6 @@
 # class Loader  to load any king of file
-import wx
-import string,numpy
+#import wx
+#import string
+import numpy
 class Load:
     """
@@ -7,5 +8,5 @@
     """
     
-    def _init_(self,x=None,y=None,dx=None,dy=None):
+    def _init_(self, x=None, y=None, dx=None, dy=None):
         # variable to store loaded values
         self.x = x
@@ -15,5 +16,5 @@
         self.filename = None
         
-    def set_filename(self,path=None):
+    def set_filename(self, path=None):
         """
         Store path into a variable.If the user doesn't give a path as a parameter a pop-up
@@ -25,5 +26,4 @@
         self.filename = path
        
-
     def get_filename(self):
         """ return the file's path"""
@@ -33,11 +33,11 @@
         """ Store the values loaded from file in local variables"""
         if not self.filename == None:
-            input_f =  open(self.filename,'r')
+            input_f =  open(self.filename, 'r')
             buff = input_f.read()
             lines = buff.split('\n')
-            self.x=[]
-            self.y=[]
+            self.x = []
+            self.y = []
             self.dx = [] 
-            self.dy=[]
+            self.dy = []
             for line in lines:
                 try:
@@ -64,7 +64,7 @@
     def get_values(self):
         """ Return x, y, dx, dy"""
-        return self.x,self.y,self.dx,self.dy
+        return self.x, self.y, self.dx, self.dy
     
-    def load_data(self,data):
+    def load_data(self, data):
         """ Return plottable"""
         #load data
@@ -72,5 +72,5 @@
         data.y = self.y
         data.dx = self.dx
-        data.dy =self.dy
+        data.dy = self.dy
         #Load its View class
         #plottable.reset_view()
@@ -78,5 +78,5 @@
     
 if __name__ == "__main__": 
-    load= Load()
+    load = Load()
     load.set_filename("testdata_line.txt")
     print load.get_filename() 
Index: park_integration/ParkFitting.py
===================================================================
--- park_integration/ParkFitting.py	(revision aa36f962b10b61665ca22df9bb4bc57c0e3bee55)
+++ park_integration/ParkFitting.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -7,8 +7,8 @@
 simple fit with park optimizer.
 """
-import time
-import numpy
+#import time
+#import numpy
 import park
-from park import fit,fitresult
+from park import fit, fitresult
 from park import assembly
 from park.fitmc import FitSimplex, FitMC
@@ -52,6 +52,6 @@
         with Uid as keys
         """
-        self.fitArrangeDict={}
-        self.paramList=[]
+        self.fitArrangeDict = {}
+        self.paramList = []
         
     def createAssembly(self):
@@ -61,13 +61,12 @@
         create an assembly self.problem=  park.Assembly([(parkmodel,parkdata)])
         """
-        mylist=[]
-        listmodel=[]
-        i=0
-        fitproblems=[]
-        for id ,fproblem in self.fitArrangeDict.iteritems():
-            if fproblem.get_to_fit()==1:
+        mylist = []
+        listmodel = []
+        i = 0
+        fitproblems = []
+        for id,fproblem in self.fitArrangeDict.iteritems():
+            if fproblem.get_to_fit() == 1:
                 fitproblems.append(fproblem)
-                
-        if len(fitproblems)==0 : 
+        if len(fitproblems) == 0: 
             raise RuntimeError, "No Assembly scheduled for Park fitting."
             return
@@ -76,22 +75,19 @@
             for p in parkmodel.parameterset:
                 ## does not allow status change for constraint parameters
-                if p.status!= 'computed':
+                if p.status != 'computed':
                     if p._getname()in item.pars:
                         ## make parameters selected for fit will be between boundaries
-                        p.set( p.range )
-                                
+                        p.set(p.range)         
                     else:
-                        p.status= 'fixed'
-             
-            i+=1
-            Ldata=item.get_data()
+                        p.status = 'fixed'
+            i += 1
+            Ldata = item.get_data()
             #parkdata=self._concatenateData(Ldata)
-            parkdata=Ldata
-            fitness=(parkmodel,parkdata)
+            parkdata = Ldata
+            fitness = (parkmodel, parkdata)
             mylist.append(fitness)
+        self.problem = park.Assembly(mylist)
         
-        self.problem =  park.Assembly(mylist)
-        
-    def fit(self,q=None,handler=None, curr_thread= None):
+    def fit(self, q=None, handler=None, curr_thread=None):
         """
         Performs fit with park.fit module.It can  perform fit with one model
@@ -112,5 +108,4 @@
         """
         self.createAssembly()
-    
         localfit = FitSimplex()
         localfit.ftol = 1e-8
@@ -119,13 +114,11 @@
         fitter = FitMC(localfit=localfit, start_points=1)
         if handler == None:
-            handler= fitresult.ConsoleUpdate(improvement_delta=0.1)
-      
-            
+            handler = fitresult.ConsoleUpdate(improvement_delta=0.1)
         result = fit.fit(self.problem,
                          fitter=fitter,
-                         handler= handler)
+                         handler=handler)
         self.problem.all_results(result)
-        if result !=None:
-            if q !=None:
+        if result != None:
+            if q != None:
                 q.put(result)
                 return q
Index: park_integration/ScipyFitting.py
===================================================================
--- park_integration/ScipyFitting.py	(revision aa36f962b10b61665ca22df9bb4bc57c0e3bee55)
+++ park_integration/ScipyFitting.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -10,5 +10,5 @@
 from scipy import optimize
 
-from AbstractFitEngine import FitEngine, SansAssembly,FitAbort
+from AbstractFitEngine import FitEngine, SansAssembly, FitAbort
 
 class fitresult(object):
@@ -17,13 +17,13 @@
     """
     def __init__(self, model=None, paramList=None):
-        self.calls     = None
-        self.fitness   = None
-        self.chisqr    = None
-        self.pvec      = None
-        self.cov       = None
-        self.info      = None
-        self.mesg      = None
-        self.success   = None
-        self.stderr    = None
+        self.calls = None
+        self.fitness = None
+        self.chisqr = None
+        self.pvec = None
+        self.cov = None
+        self.info = None
+        self.mesg = None
+        self.success = None
+        self.stderr = None
         self.parameters = None
         self.model = model
@@ -48,6 +48,7 @@
 
         result_param = zip(xrange(n), self.model.parameterset)
-        L = ["P%-3d  %s......|.....%s"%(p[0], p[1], p[1].value) for p in result_param if p[1].name in self.paramList ]
-        L.append("=== goodness of fit: %s"%(str(self.fitness)))
+        L = ["P%-3d  %s......|.....%s"%(p[0], p[1], p[1].value)\
+              for p in result_param if p[1].name in self.paramList]
+        L.append("=== goodness of fit: %s" % (str(self.fitness)))
         return "\n".join(L)
     
@@ -89,6 +90,6 @@
         with Uid as keys
         """
-        self.fitArrangeDict={}
-        self.paramList=[]
+        self.fitArrangeDict = {}
+        self.paramList = []
     #def fit(self, *args, **kw):
     #    return profile(self._fit, *args, **kw)
@@ -97,22 +98,22 @@
         """
         """
-        fitproblem=[]
-        for id ,fproblem in self.fitArrangeDict.iteritems():
-            if fproblem.get_to_fit()==1:
+        fitproblem = []
+        for id, fproblem in self.fitArrangeDict.iteritems():
+            if fproblem.get_to_fit() == 1:
                 fitproblem.append(fproblem)
-        if len(fitproblem)>1 : 
+        if len(fitproblem) > 1 : 
             msg = "Scipy can't fit more than a single fit problem at a time."
             raise RuntimeError, msg
             return
-        elif len(fitproblem)==0 : 
+        elif len(fitproblem) == 0 : 
             raise RuntimeError, "No Assembly scheduled for Scipy fitting."
             return
     
-        listdata=[]
+        listdata = []
         model = fitproblem[0].get_model()
         listdata = fitproblem[0].get_data()
         # Concatenate dList set (contains one or more data)before fitting
         data = listdata
-        self.curr_thread= curr_thread
+        self.curr_thread = curr_thread
         result = fitresult(model=model, paramList=self.paramList)
         if handler is not None:
@@ -120,5 +121,5 @@
         #try:
         functor = SansAssembly(self.paramList, model, data, handler=handler,
-                                fitresult=result,curr_thread= self.curr_thread)
+                         fitresult=result, curr_thread= self.curr_thread)
        
        
@@ -146,5 +147,5 @@
                 return result
         else:  
-            raise ValueError, "SVD did not converge"+str(success)
+            raise ValueError, "SVD did not converge" + str(success)
     
 
Index: park_integration/temp_code_exchange.py
===================================================================
--- park_integration/temp_code_exchange.py	(revision aa36f962b10b61665ca22df9bb4bc57c0e3bee55)
+++ park_integration/temp_code_exchange.py	(revision 89f3b661379c219e6763af21e8d87d6e236695b7)
@@ -8,5 +8,5 @@
 # This code belongs in AbstractFitEngine
 class FitData1D:
-    def setFitRange(self,qmin=None,qmax=None):
+    def setFitRange(self, qmin=None, qmax=None):
         """ 
         Change the fit range.
@@ -18,10 +18,10 @@
         # Skip Q=0 point, (especially for y(q=0)=None at x[0]).
         #ToDo: Fix this.
-        if qmin==0.0 and not numpy.isfinite(self.data.y[qmin]):
+        if qmin == 0.0 and not numpy.isfinite(self.data.y[qmin]):
             self.qmin = min(self.data.x[self.data.x!=0])
-        elif qmin!=None:                       
+        elif qmin != None:                       
             self.qmin = qmin            
 
-        if qmax !=None:
+        if qmax != None:
             self.qmax = qmax
             
@@ -40,5 +40,5 @@
             # Take 3 sigmas as the offset between smeared and unsmeared space.
             try:
-                offset = 3.0*max(self.smearer.width)
+                offset = 3.0 * max(self.smearer.width)
                 self._qmin_unsmeared = max([min(self.data.x), self.qmin-offset])
                 self._qmax_unsmeared = min([max(self.data.x), self.qmax+offset])
@@ -64,28 +64,27 @@
         
         """
-        x,y = [numpy.asarray(v) for v in (self.x,self.y)]
-        if self.dy ==None or self.dy==[]:
-            dy= numpy.zeros(len(y))  
+        x, y = [numpy.asarray(v) for v in (self.x, self.y)]
+        if self.dy == None or self.dy == []:
+            dy = numpy.zeros(len(y))  
         else:
-            dy= numpy.asarray(dy)
-     
-        dy[dy==0]=1
-        idx_unsmeared = (x>=self._qmin_unsmeared) & (x <= self._qmax_unsmeared)
-  
+            dy = numpy.asarray(dy)
+        dy[dy == 0] = 1
+        idx_unsmeared = (x >= self._qmin_unsmeared) \
+                        & (x <= self._qmax_unsmeared)
         # Compute theory data f(x)
-        idx=[]
-        tempy=[]
-        tempfx=[]
-        tempdy=[]
-    
+        idx = []
+        tempy = []
+        tempfx = []
+        tempdy = []
         _first_bin = None
         for i_x in range(len(x)):
             try:
-                if idx_unsmeared[i_x]==True:
+                if idx_unsmeared[i_x] == True:
                     if _first_bin is None:
                         _first_bin = i_x
                     
-                    value= fn(x[i_x])
-                    idx.append(x[i_x]>=self.qmin and x[i_x]<=self.qmax)
+                    value = fn(x[i_x])
+                    idx.append(x[i_x] >= self.qmin and \
+                                x[i_x] <= self.qmax)
                     tempfx.append( value)
                     tempy.append(y[i_x])
@@ -101,13 +100,13 @@
        
         newy = numpy.asarray(tempy)
-        newfx= numpy.asarray(tempfx)
-        newdy= numpy.asarray(tempdy)
+        newfx = numpy.asarray(tempfx)
+        newdy = numpy.asarray(tempdy)
        
         ## Sanity check
-        if numpy.size(newdy)!= numpy.size(newfx):
-            raise RuntimeError, "FitData1D: invalid error array %d <> %d" % (numpy.size(newdy), numpy.size(newfx))
-
-        return (newy[idx]-newfx[idx])/newdy[idx]
-     
+        if numpy.size(newdy) != numpy.size(newfx):
+            msg = "FitData1D: invalid error "
+            msg += "array %d <> %d" % (numpy.size(newdy), numpy.size(newfx))
+            raise RuntimeError, msg
+        return (newy[idx] - newfx[idx]) / newdy[idx]
      
     def residuals_alt(self, fn):
@@ -137,17 +136,15 @@
         # Make sure the arrays are numpy arrays, which are
         # expected by the fitter.
-        x,y = [numpy.asarray(v) for v in (self.x,self.y)]
-        if self.dy ==None or self.dy==[]:
-            dy= numpy.zeros(len(y))  
+        x, y = [numpy.asarray(v) for v in (self.x, self.y)]
+        if self.dy == None or self.dy == []:
+            dy = numpy.zeros(len(y))  
         else:
-            dy= numpy.asarray(dy)
-     
-        dy[dy==0]=1
-        idx = (x>=self.qmin) & (x <= self.qmax)
-        idx_unsmeared = (x>=self._qmin_unsmeared) & (x <= self._qmax_unsmeared)
-  
+            dy = numpy.asarray(dy)
+        dy[dy ==0 ] = 1
+        idx = (x >= self.qmin) & (x <= self.qmax)
+        idx_unsmeared = (x >= self._qmin_unsmeared) \
+                            & (x <= self._qmax_unsmeared)
         # Compute theory data f(x)
-        fx= numpy.zeros(len(x))
-    
+        fx = numpy.zeros(len(x))
         # First and last bins of the array, corresponding to
         # the Q range to be smeared
@@ -156,10 +153,9 @@
         for i_x in range(len(x)):
             try:
-                if idx_unsmeared[i_x]==True:
+                if idx_unsmeared[i_x] == True:
                     if _first_bin is None:
                         _first_bin = i_x
                     else:
                         _last_bin  = i_x
-                    
                     value = fn(x[i_x])
                     fx[i_x] = value
@@ -168,15 +164,15 @@
                 ## Should properly log the error
                 pass
-                 
         # Smear theory data
         if self.smearer is not None:
             fx = self.smearer(fx, _first_bin, _last_bin)
-       
         # Sanity check
-        if numpy.size(dy)!= numpy.size(fx):
-            raise RuntimeError, "FitData1D: invalid error array %d <> %d" % (numpy.size(dy), numpy.size(fx))
-
+        if numpy.size(dy) != numpy.size(fx):
+            msg = "FitData1D: invalid error array"
+            msg += " %d <> %d" % (numpy.size(dy), numpy.size(fx))
+
+            raise RuntimeError, msg
         # Return the residuals for the smeared (observed) Q range
-        return (y[idx]-fx[idx])/dy[idx]
+        return (y[idx] - fx[idx]) / dy[idx]
      
 # The following code belongs in DataLoader.qsmearing
@@ -202,6 +198,8 @@
         """
         # Sanity check
-        if len(iq)+first_bin > self.nbins:
-            raise RuntimeError, "Invalid I(q) vector: inconsistent array length %s > %s" % (str(len(iq)+first_bin), str(self.nbins))
+        if len(iq) + first_bin > self.nbins:
+            msg = "Invalid I(q) vector: inconsistent array length "
+            msg += " %s > %s" % (str(len(iq) + first_bin), str(self.nbins))
+            raise RuntimeError, msg
         
         if self._weights == None:
@@ -210,5 +208,5 @@
         iq_smeared = numpy.zeros(len(iq))
         # Loop over q-values
-        idwb=[]
+        idwb = []
         
         for q_i in range(len(iq)):
@@ -216,13 +214,15 @@
             counts = 0.0  
             for i in range(len(iq)):
-                if iq[i]==0 or self._weights[q_i+first_bin][i+first_bin]==0:
+                if iq[i] == 0 or \
+                    self._weights[q_i+first_bin][i+first_bin] == 0:
                     continue
                 else:
                     sum += iq[i] * self._weights[q_i+first_bin][i+first_bin] 
                     counts += self._weights[q_i+first_bin][i+first_bin]
-            
             if counts == 0:
                 iq_smeared[q_i] = 0
             else:
                 iq_smeared[q_i] = sum/counts 
-        return iq_smeared              
+        return iq_smeared   
+    
+           
