Index: park_integration/AbstractFitEngine.py
===================================================================
--- park_integration/AbstractFitEngine.py	(revision 3c404d37d101d08da02112743e2f9739f0e0e242)
+++ park_integration/AbstractFitEngine.py	(revision d831626c10346da20b9b7a000586aa31c32ca89e)
@@ -36,4 +36,5 @@
     def __init__(self, sans_model):
         self.model = sans_model
+        self.name=sans_model.name
         #print "ParkFitting:sans model",self.model
         self.sansp = sans_model.getParamList()
@@ -67,5 +68,5 @@
   
     def eval(self,x):
-        #print "eval",self.parameterset[0].value,self.parameterset[1].value
+       
         return self.model.runXY(x)
        
@@ -193,4 +194,5 @@
             else:
                 model.model.name = name
+                model.name = name
                 self.paramList=pars
             #A fitArrange is already created but contains dList only at Uid
Index: park_integration/test/test_large_model.py
===================================================================
--- park_integration/test/test_large_model.py	(revision 48882d14c03b61d8a22b600abadcccba552c8697)
+++ park_integration/test/test_large_model.py	(revision d831626c10346da20b9b7a000586aa31c32ca89e)
@@ -31,5 +31,5 @@
         
         #Do the fit SCIPY
-        fitter.set_data(data1,1)
+        
         import math
         #pars1=['background','contrast', 'length']
Index: park_integration/test/testnewscipys.py
===================================================================
--- park_integration/test/testnewscipys.py	(revision 48882d14c03b61d8a22b600abadcccba552c8697)
+++ park_integration/test/testnewscipys.py	(revision d831626c10346da20b9b7a000586aa31c32ca89e)
@@ -1,4 +1,4 @@
 """
-    Unit tests for fitting module 
+    test Data, Model , fucntor classes of AbstractFittingModule
 """
 import unittest
@@ -12,5 +12,5 @@
     
     def test_Data(self):
-        """ test data"""
+        """ test Data"""
         #load data
         from sans.fit.Loader import Load
@@ -37,5 +37,5 @@
         #fitter.set_model_assembly(model,"M1",1,['A','B'])
     def test_Model(self):
-        """ test model"""
+        """ test Model"""
         #load data
         from sans.fit.Loader import Load
Index: park_integration/test/testpark.py
===================================================================
--- park_integration/test/testpark.py	(revision 985c88b87a5cf7319bfda1d8af0737566479cd84)
+++ park_integration/test/testpark.py	(revision d831626c10346da20b9b7a000586aa31c32ca89e)
@@ -1,14 +1,15 @@
 """
-    Unit tests for fitting module 
+    Unit tests for fitting module  using park integration
+    fitting 2 data with 2 model and one constraint on only one parameter is not working
 """
 import unittest
 from sans.guitools.plottables import Theory1D
 from sans.guitools.plottables import Data1D
-from sans.fit.ScipyFitting import Parameter
+from sans.fit.AbstractFitEngine import Model,Data
 import math
 class testFitModule(unittest.TestCase):
     
-    def test2models2dataonconstraint(self):
-        """ test fitting for two set of data  and one model"""
+    def test2models2data2constraints(self):
+        """ test fitting for two data , 2 model , 2 constraints"""
         from sans.fit.Loader import Load
         load= Load()
@@ -42,14 +43,18 @@
         model1.setParam( 'A', 2.5)
         model1.setParam( 'B', 4)
-        fitter.set_model(model1,"M1",1, ['A','B'])
-        fitter.set_data(data1,1)
+        model1.name="M1"
+        fitter.set_model(Model(model1),"M1",1, ['A','B'])
+        fitter.set_data(Data(sans_data=data1),1)
+        model2.name="M2"
+        model2.setParam( 'A', "M1.A+1")
+        model2.setParam( 'B', 'M1.B*2')
         
-        model1.setParam( 'A', 2)
-        model1.setParam( 'B', 3)
-        fitter.set_model(model2,"M2",2, ['A','B'])
-        fitter.set_data(data2,2)
+        fitter.set_model(Model(model2),"M2",2, ['A','B'])
+        fitter.set_data(Data(sans_data=data2),2)
         
-        chisqr1, out1, cov1,result= fitter.fit()
-        
+        result = fitter.fit()
+        chisqr1 = result.fitness
+        out1 = result.pvec
+        cov1 = result.cov
         self.assert_(math.fabs(out1[1]-2.5)/math.sqrt(cov1[1][1]) < 2)
         print math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0])
@@ -61,44 +66,120 @@
         print chisqr1/len(data2.x)
         #self.assert_(chisqr2/len(data2.x) < 2)
+    
+    def test2models2data1constraint(self):
+        """ test fitting for two data , 2 model ,1 constraint"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first data
+        load.set_filename("testdata1.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
         
+        #Load the second data
+        load.set_filename("testdata2.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
         
-        fitter.set_data(data3,1)
-        chisqr2, out2, cov2, result= fitter.fit(None,None)
-        self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
-        print math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0])
+        #Load the third data
+        load.set_filename("testdata_line.txt")
+        load.set_values()
+        data3 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data3)
+        
+        #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
+        model1.setParam( 'A', 2.5)
+        model1.setParam( 'B', 4)
+        model1.name="M1"
+        fitter.set_model(Model(model1),"M1",1, ['A','B'])
+        fitter.set_data(Data(sans_data=data1),1)
+        model2.name="M2"
+        model2.setParam( 'A', 2)
+        model2.setParam( 'B', 'M1.B*2')
+        
+        fitter.set_model(Model(model2),"M2",2, ['A','B'])
+        fitter.set_data(Data(sans_data=data2),2)
+        
+        result = fitter.fit()
+        chisqr1 = result.fitness
+        out1 = result.pvec
+        cov1 = result.cov
+        self.assert_(math.fabs(out1[1]-2.5)/math.sqrt(cov1[1][1]) < 2)
+        print math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0])
         #self.assert_(math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0]) < 2)
-        self.assert_(math.fabs(out2[3]-2.5)/math.sqrt(cov2[3][3]) < 2)
-        self.assert_(math.fabs(out2[2]-4.0)/math.sqrt(cov2[2][2]) < 2)
-        print chisqr2/len(data1.x)
-        #self.assert_(chisqr1/len(data1.x) < 2)
-        print chisqr2/len(data2.x)
-        #self.assert_(chisqr2/len(data2.x) < 2)
-        
-        fitter.remove_Fit_Problem(2)
-        
-        chisqr3, out3, cov3= fitter.fit()
-        #print "park",chisqr3, out3, cov3
-        self.assert_(math.fabs(out1[1]-2.5)/math.sqrt(cov1[1][1]) < 2)
-        print math.fabs(out1[0]-4.0)
-        #self.assert_(math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0]) < 2)
+        self.assert_(math.fabs(out1[3]-2.5)/math.sqrt(cov1[3][3]) < 2)
+        self.assert_(math.fabs(out1[2]-4.0)/math.sqrt(cov1[2][2]) < 2)
         print chisqr1/len(data1.x)
         #self.assert_(chisqr1/len(data1.x) < 2)
-        #self.assert_(chisqr1/len(data2.x) < 2)
-        #failing at 7 place
-        self.assertAlmostEquals(out3[1],out1[1])
-        self.assertAlmostEquals(out3[0],out1[0])
-        self.assertAlmostEquals(cov3[1][1],cov1[1][1])
-        self.assertAlmostEquals(cov3[0][0],cov1[0][0])
+        print chisqr1/len(data2.x)
+        #self.assert_(chisqr2/len(data2.x) < 2)
+    
         
-        self.assertAlmostEquals(out2[1],out1[1])
-        self.assertAlmostEquals(out2[0],out1[0])
-        self.assertAlmostEquals(cov2[1][1],cov1[1][1])
-        self.assertAlmostEquals(cov2[0][0],cov1[0][0])
+    def test2models2dataNoconstraint(self):
+        """ test fitting for two data  and 2 models no cosntrainst"""
+        from sans.fit.Loader import Load
+        load= Load()
+        #Load the first data
+        load.set_filename("testdata1.txt")
+        load.set_values()
+        data1 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data1)
         
-        self.assertAlmostEquals(out2[1],out3[1])
-        self.assertAlmostEquals(out2[0],out3[0])
-        self.assertAlmostEquals(cov2[1][1],cov3[1][1])
-        self.assertAlmostEquals(cov2[0][0],cov3[0][0])
-        print chisqr1,chisqr2,chisqr3
-        #self.assertAlmostEquals(chisqr1,chisqr2)
-        self.assert_(chisqr1)
+        #Load the second data
+        load.set_filename("testdata2.txt")
+        load.set_values()
+        data2 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data2)
+        
+        #Load the third data
+        load.set_filename("testdata_line.txt")
+        load.set_values()
+        data3 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data3)
+        
+        #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
+        model1.setParam( 'A', 2.5)
+        model1.setParam( 'B', 4)
+        model1.name="M1"
+        fitter.set_model(Model(model1),"M1",1, ['A','B'])
+        fitter.set_data(Data(sans_data=data1),1)
+        model2.name="M2"
+        model2.setParam( 'A', 1)
+        model2.setParam( 'B', 2)
+        
+        fitter.set_model(Model(model2),"M2",2, ['A','B'])
+        fitter.set_data(Data(sans_data=data2),2)
+    
+        result = fitter.fit()
+        chisqr1 = result.fitness
+        out1 = result.pvec
+        cov1 = result.cov
+        self.assert_(math.fabs(out1[1]-2.5)/math.sqrt(cov1[1][1]) < 2)
+        print math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0])
+        #self.assert_(math.fabs(out1[0]-4.0)/math.sqrt(cov1[0][0]) < 2)
+        self.assert_(math.fabs(out1[3]-2.5)/math.sqrt(cov1[3][3]) < 2)
+        self.assert_(math.fabs(out1[2]-4.0)/math.sqrt(cov1[2][2]) < 2)
+        print chisqr1/len(data1.x)
+        #self.assert_(chisqr1/len(data1.x) < 2)
+        print chisqr1/len(data2.x)
+        #self.assert_(chisqr2/len(data2.x) < 2)
+    
+        
+    
