Index: park_integration/ParkFitting.py
===================================================================
--- park_integration/ParkFitting.py	(revision 79240427dd9f605c4edfbd8bb18d8df49123d390)
+++ park_integration/ParkFitting.py	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
@@ -49,14 +49,14 @@
     def __init__(self, sans_model):
         self.model = sans_model
-        print "ParkFitting:sans model",self.model
+        #print "ParkFitting:sans model",self.model
         sansp = sans_model.getParamList()
-        print "ParkFitting: sans model parameter list",sansp
+        #print "ParkFitting: sans model parameter list",sansp
         parkp = [SansParameter(p,sans_model) for p in sansp]
-        print "ParkFitting: park model parameter ",parkp
+        #print "ParkFitting: park model parameter ",parkp
         self.parameterset = park.ParameterSet(sans_model.name,pars=parkp)
         
     def eval(self,x):
-        print "eval",self.parameterset[0].value,self.parameterset[1].value
-        print "model run ",self.model.run(x)
+        #print "eval",self.parameterset[0].value,self.parameterset[1].value
+        #print "model run ",self.model.run(x)
         return self.model.run(x)
     
@@ -156,8 +156,9 @@
             #wrap sans model
             parkmodel = Model(sansmodel)
-            print "ParkFitting: createproblem: just create a model",parkmodel.parameterset
+            #print "ParkFitting: createproblem: just create a model",parkmodel.parameterset
             for p in parkmodel.parameterset:
                 #self.param_list.append(p._getname())
-                if p.isfixed() and p._getname()in self.paramList:
+                if p.isfixed():
+                #if p.isfixed() and p._getname()in self.paramList:
                     p.set([-numpy.inf,numpy.inf])
             
@@ -167,7 +168,7 @@
             parkdata=Data(x,y,dy,None)
             couple=(parkmodel,parkdata)
-            print "Parkfitting: fitness",couple   
+            #print "Parkfitting: fitness",couple   
             mylist.append(couple)
-        print "mylist",mylist
+        #print "mylist",mylist
         self.problem =  park.Assembly(mylist)
         
@@ -190,6 +191,6 @@
         """
         #from numpy.linalg.linalg.LinAlgError import LinAlgError
-        print "Parkfitting: fit method probably breaking just right before \
-        call fit"
+        #print "Parkfitting: fit method probably breaking just right before \
+        #call fit"
         self.createProblem()
         pars=self.problem.fit_parameters()
@@ -206,7 +207,7 @@
                          handler= fitresult.ConsoleUpdate(improvement_delta=0.1))
           
-            for p in result.parameters:
-                print "fit in park fitting", p.name, p.value
-            return result.fitness,result.pvec,result.cov
+            #for p in result.parameters:
+            #    print "fit in park fitting", p.name, p.value,p.stderr
+            return result.fitness,result.pvec,result.cov,result
            
         except :
Index: park_integration/test/test_fitting_panel.py
===================================================================
--- park_integration/test/test_fitting_panel.py	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
+++ park_integration/test/test_fitting_panel.py	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
@@ -0,0 +1,197 @@
+"""
+    Unit tests for fitting module 
+"""
+import unittest
+from sans.guitools.plottables import Theory1D
+from sans.guitools.plottables import Data1D
+from sans.fit.ScipyFitting import Parameter
+import math
+import logging
+logging.basicConfig(level=logging.DEBUG,
+                    format='%(asctime)s %(levelname)s %(message)s',
+                    filename='test_log.txt',
+                    filemode='w')
+class testFitModule(unittest.TestCase):
+    def test0(self):
+        """ test fitting for two set of data  and one model B constraint"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first set of data
+        load.set_filename("testdata1.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
+        
+        #Load the second set of data
+        load.set_filename("testdata2.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('park')
+        # Receives the type of model for the fitting
+        from sans.guitools.LineModel import LineModel
+        model1  = LineModel()
+        model2  = LineModel()
+        
+        #Do the fit
+        
+        fitter.set_model(model1,"M1",1, {'A':1,'B':1})
+        fitter.set_data(data1,1)
+       
+        fitter.set_model(model2,"M2",2, {'A':'M1.A','B':'M1.B'})
+        fitter.set_data(data2,2)
+    
+        
+        chisqr1, out1, cov1,result= fitter.fit()
+        self.assert_(chisqr1)
+        print "chisqr1",chisqr1
+        print "out1", out1
+        print " cov1", cov1
+        
+    def test01(self):
+        """ test fitting for two set of data  and one model B constraint"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first set of data
+        load.set_filename("testdata1.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
+        
+        #Load the second set of data
+        load.set_filename("testdata2.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('park')
+        # Receives the type of model for the fitting
+        from sans.guitools.LineModel import LineModel
+        model1  = LineModel()
+        model2  = LineModel()
+        
+        #Do the fit
+        
+        fitter.set_model(model1,"M1",1, {'A':1,'B':1})
+        fitter.set_data(data1,1)
+       
+        fitter.set_model(model2,"M2",2, {'A':'M1.A','B':'M1.B'})
+        fitter.set_data(data2,2)
+    
+        
+        chisqr1, out1, cov1= fitter.fit()
+        print "chisqr1",chisqr1
+        print "out1", out1
+        print " cov1", cov1
+       
+      
+    
+    
+    def test1(self):
+        """ test fitting for two set of data  and one model 1 constraint"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first set of data
+        load.set_filename("testdata_line.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
+        
+        #Load the second set of data
+        load.set_filename("testdata_line1.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('park')
+        # Receives the type of model for the fitting
+        from sans.guitools.LineModel import LineModel
+        model1  = LineModel()
+        model2  = LineModel()
+        
+        #Do the fit
+        
+        fitter.set_model(model1,"M1",1, {'A':1,'B':1})
+        fitter.set_data(data1,1)
+       
+        fitter.set_model(model2,"M2",2, {'A':'M1.A','B':1})
+        fitter.set_data(data2,2)
+    
+        
+        chisqr1, out1, cov1= fitter.fit()
+        print "chisqr1",chisqr1
+        print "out1", out1
+        print " cov1", cov1
+       
+      
+    
+    def test2(self):
+        """ test fitting for two set of data  and one model no constraint"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first set of data
+        load.set_filename("testdata_line.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
+        
+        #Load the second set of data
+        load.set_filename("testdata_line1.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('scipy')
+        # Receives the type of model for the fitting
+        from sans.guitools.LineModel import LineModel
+        model1  = LineModel()
+        model2  = LineModel()
+        
+        #Do the fit
+        
+        fitter.set_model(model1,"M1",1, {'A':1,'B':1})
+        fitter.set_data(data1,1)
+       
+        fitter.set_model(model2,"M2",2, {'A':1,'B':1})
+        fitter.set_data(data2,2)
+    
+        
+        chisqr1, out1, cov1= fitter.fit()
+        print "chisqr1",chisqr1
+        print "out1", out1
+        print " cov1", cov1
+     
+        
+        fitter= Fit('park')
+        # Receives the type of model for the fitting
+        from sans.guitools.LineModel import LineModel
+        model1  = LineModel()
+        model2  = LineModel()
+        
+        #Do the fit
+        
+        fitter.set_model(model1,"M1",1, {'A':1,'B':1})
+        fitter.set_data(data1,1)
+       
+        fitter.set_model(model2,"M2",2, {'A':1,'B':1})
+        fitter.set_data(data2,2)
+    
+        
+        chisqr2, out2, cov2,result= fitter.fit()
+        print "chisqr2",chisqr2
+        print "out2", out2
+        print " cov2", cov2
+        
+        
+       
+    
+      
Index: park_integration/test/testdata_line.txt
===================================================================
--- park_integration/test/testdata_line.txt	(revision 792db7d542f8814e2fad10b22652d74f24c7e14f)
+++ park_integration/test/testdata_line.txt	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
@@ -33,2 +33,21 @@
 5.91837  14.9428  2.81939
 6.12245  22.1974  2.89592
+6.32653  17.3418  2.97245
+6.53061  19.8174  3.04898
+6.73469  17.6186  3.12551
+6.93878  21.329  3.20204
+7.14286  20.2873  3.27857
+7.34694  23.4112  3.3551
+7.55102  26.063  3.43163
+7.7551  29.8775  3.50816
+7.95918  19.0027  3.58469
+8.16327  19.4248  3.66122
+8.36735  27.4876  3.73776
+8.57143  33.8399  3.81429
+8.77551  24.2611  3.89082
+8.97959  29.8796  3.96735
+9.18367  24.6149  4.04388
+9.38776  35.7664  4.12041
+9.59184  32.145  4.19694
+9.79592  24.8085  4.27347
+10  31.3767  4.35
Index: park_integration/test/testdata_line1.txt
===================================================================
--- park_integration/test/testdata_line1.txt	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
+++ park_integration/test/testdata_line1.txt	(revision 6b126e8c0609d8c6835c7d3cc15aa30f50dfd05d)
@@ -0,0 +1,47 @@
+#y=A*x+B
+#A=2.5
+#B=4
+0  2.83954  0.6
+0.204082  3.44938  0.6
+0.408163  5.82026  0.7
+0.612245  5.27591  0.8
+0.816327  5.2781  0.906122
+1.02041  5.22531  0.982653
+1.22449  7.47487  1
+1.42857  7.85852  1.13571
+1.63265  10.2278  1.21224
+1.83673  8.33195  1.28878
+2.04082  9.22407  1.36
+2.2449  7.95013  1.44184
+2.44898  10.0289  1.51837
+2.65306  11.0736  1.5949
+2.85714  12.2957  1.67143
+3.06122  12.3108  1.74796
+3.26531  12.6916  1.82449
+3.46939  12.5859  1.90102
+3.67347  14.5972  1.97755
+
+5.30612  21.4745  2.5898
+5.5102  20.0393  2.66633
+5.71429  13.2472  2.74286
+5.91837  14.9428  2.81939
+6.12245  22.1974  2.89592
+6.32653  17.3418  2.97245
+6.53061  19 3.04898
+6.73469  17.6186  3.12551
+6.93878  21  3.20204
+7.14286  20.2873  3.27857
+7.34694  23.4112  3.3551
+7.55102  26.063  3.43163
+7.7551  29.8775  3.50816
+7.95918  19.0027  3.58469
+8.16327  19.4248  3.66122
+8.36735  27.4876  3.73776
+8.57143  33.8399  3.81429
+8.77551  24.2611  3.89082
+8.97959  29.8796  3.96735
+9.18367  24.6149  4.04388
+9.38776  35.7664  4.12041
+9.59184  32.145  4.19694
+9.79592  24.8085  4.27347
+
