Index: park_integration/test/cyl_400_20.txt
===================================================================
--- park_integration/test/cyl_400_20.txt	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
+++ park_integration/test/cyl_400_20.txt	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -0,0 +1,22 @@
+<X>   <Y>
+0  -1.#IND
+0.025  125.852
+0.05  53.6662
+0.075  26.0733
+0.1  11.8935
+0.125  4.61714
+0.15  1.29983
+0.175  0.171347
+0.2  0.0417614
+0.225  0.172719
+0.25  0.247876
+0.275  0.20301
+0.3  0.104599
+0.325  0.0285595
+0.35  0.00213344
+0.375  0.0137511
+0.4  0.0312374
+0.425  0.0350328
+0.45  0.0243172
+0.475  0.00923067
+0.5  0.00121297
Index: park_integration/test/cyl_400_40.txt
===================================================================
--- park_integration/test/cyl_400_40.txt	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
+++ park_integration/test/cyl_400_40.txt	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -0,0 +1,56 @@
+<X>   <Y>
+0  -1.#IND
+0.00925926  1246.59
+0.0185185  612.143
+0.0277778  361.142
+0.037037  211.601
+0.0462963  122.127
+0.0555556  65.2385
+0.0648148  30.8914
+0.0740741  12.4737
+0.0833333  3.51371
+0.0925926  0.721835
+0.101852  0.583607
+0.111111  1.31084
+0.12037  1.9432
+0.12963  1.94286
+0.138889  1.58912
+0.148148  0.987076
+0.157407  0.456678
+0.166667  0.147595
+0.175926  0.027441
+0.185185  0.0999575
+0.194444  0.198717
+0.203704  0.277667
+0.212963  0.288172
+0.222222  0.220056
+0.231481  0.139378
+0.240741  0.0541106
+0.25  0.0140158
+0.259259  0.0132187
+0.268519  0.0336301
+0.277778  0.0672911
+0.287037  0.0788983
+0.296296  0.0764438
+0.305556  0.0555445
+0.314815  0.0280548
+0.324074  0.0111798
+0.333333  0.00156156
+0.342593  0.00830883
+0.351852  0.0186266
+0.361111  0.0275426
+0.37037  0.03192
+0.37963  0.0255329
+0.388889  0.0175216
+0.398148  0.0073075
+0.407407  0.0016631
+0.416667  0.00224153
+0.425926  0.0051335
+0.435185  0.0112914
+0.444444  0.0138209
+0.453704  0.0137453
+0.462963  0.0106682
+0.472222  0.00532472
+0.481481  0.00230646
+0.490741  0.000335344
+0.5  0.00177224
Index: park_integration/test/small_test.py
===================================================================
--- park_integration/test/small_test.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
+++ park_integration/test/small_test.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -0,0 +1,45 @@
+"""
+    Unit tests for fitting module 
+"""
+import unittest
+from sans.guitools.plottables import Theory1D
+from sans.guitools.plottables import Data1D
+from sans.fit.AbstractFitEngine import Data, Model
+import math
+from sans.fit.Fitting import Fit
+from DataLoader.loader import Loader
+
+class testFitModule(unittest.TestCase):
+    """ test fitting """
+    def test_park(self):
+        """ Simple cylinder model fit (park)  """
+        
+        out=Loader().load("cyl_400_20.txt")
+        data1 = Data1D(x=out.x, y=out.y, dx=out.dx, dy=out.y)
+        
+        fitter = Fit('park')
+        # Receives the type of model for the fitting
+        from sans.models.CylinderModel import CylinderModel
+        model1  = CylinderModel()
+        model1.setParam('contrast', 1)
+        data = Data(sans_data=data1)
+        model = Model(model1)
+        
+        pars1 =['length','radius','scale']
+        fitter.set_data(data,1)
+        model.set( scale=1e-10 )
+        fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
+        result1 = fitter.fit()
+        
+        self.assert_(result1)
+        self.assertTrue(len(result1.pvec)>0 or len(result1.pvec)==0 )
+        self.assertTrue(len(result1.stderr)> 0 or len(result1.stderr)==0)
+        
+        #print result1.pvec[0]-400.0, result1.pvec[0]
+        #print math.fabs(result1.pvec[0]-400.0)/3.0
+        self.assertTrue( math.fabs(result1.pvec[0]-400.0)/3.0 < result1.stderr[0] )
+        self.assertTrue( math.fabs(result1.pvec[1]-20.0)/3.0  < result1.stderr[1] )
+        self.assertTrue( math.fabs(result1.pvec[2]-9.0e-12)/3.0   < result1.stderr[2] )
+        self.assertTrue( result1.fitness < 1.0 )
+        
Index: park_integration/test/test_engine_methods.py
===================================================================
--- park_integration/test/test_engine_methods.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
+++ park_integration/test/test_engine_methods.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -0,0 +1,98 @@
+"""
+    test Data, Model , fucntor classes of AbstractFittingModule
+"""
+import unittest
+from sans.guitools.plottables import Theory1D
+from sans.guitools.plottables import Data1D
+from sans.fit.AbstractFitEngine import Data, Model
+from sans.fit.AbstractFitEngine import sansAssembly
+import math
+class testFitModule(unittest.TestCase):
+    """ test fitting """
+    
+    def test_Data(self):
+        """ test Data"""
+        #load data
+        from sans.fit.Loader import Load
+        load= Load()
+        load.set_filename("cyl_testdata.txt")
+        load.set_values()
+        data11 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data11)
+        
+        #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()
+        data1=Data(sans_data=data11)
+        model =Model(model1)
+        #Do the fit SCIPY0.007778 1.78E+14 13335629 
+        v=[0.007778,0.023333,0.031111,0.038889,0.046667,0.054444]
+        for i in range(len(v)):
+            self.assertEquals(data1.x[i],v[i])
+        #fitter.set_data_assembly(data1,1)
+        #fitter.set_model_assembly(model,"M1",1,['A','B'])
+    def test_Model(self):
+        """ test Model"""
+        #load data
+        from sans.fit.Loader import Load
+        load= Load()
+        load.set_filename("cyl_testdata.txt")
+        load.set_values()
+        data11 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data11)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('scipy')
+        
+        # Receives the type of model for the fitting
+        from sans.models.CylinderModel import CylinderModel
+        model1  = CylinderModel()
+        data1=Data(sans_data=data11)
+        model =Model(model1)
+        for item in data1.x:
+            self.assertEquals(model.eval(item),model.model.run(item))
+        p=[0.0, 3.0000000000000001e-006, 1.0, 1.0, 400.0, 20.0, 1.0]  
+        model.setParams(p)
+        res=[]
+        for i in range(len(data1.x)):
+            res.append((data1.y[i]-model.eval(data1.x[i]))/data1.dy[i])
+            self.assertEquals(model.eval(data1.x[i]),model.model.run(data1.x[i]))  
+        print res
+    def test_funtor(self):
+        """ test functor"""
+        #load data
+        from sans.fit.Loader import Load
+        load= Load()
+        load.set_filename("cyl_testdata.txt")
+        load.set_values()
+        data11 = Data1D(x=[], y=[],dx=None, dy=None)
+        load.load_data(data11)
+        
+        #Importing the Fit module
+        from sans.fit.Fitting import Fit
+        fitter= Fit('scipy')
+        
+        # Receives the type of model for the fitting
+        from sans.models.CylinderModel import CylinderModel
+        model1  = CylinderModel()
+        data1=Data(sans_data=data11)
+        model =Model(model1)
+        functor= sansAssembly(model,data1)
+        for item in data1.x:
+            self.assertEquals(model.eval(item),model.model.run(item))
+        p=[0.0, 3.0000000000000001e-006, 1.0, 1.0, 400.0, 20.0, 1.0]  
+        model.setParams(p)
+        res=[]
+        for i in range(len(data1.x)):
+            res.append((data1.y[i]-model.eval(data1.x[i]))/data1.dy[i])
+            self.assertEquals(model.eval(data1.x[i]),model.model.run(data1.x[i]))  
+        f=functor(p)
+
+        for i in range(len(res)):
+            self.assertEquals(res[i],f[i])    
+       
Index: park_integration/test/test_fit_cylinder.py
===================================================================
--- park_integration/test/test_fit_cylinder.py	(revision 822f97ebcdb3968667b7f794e941a3a23a351234)
+++ park_integration/test/test_fit_cylinder.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -29,6 +29,7 @@
         pars1 =['length','radius','scale']
         fitter.set_data(data,1)
-        model.model.setParam('scale',1e-10)
+        model.set(scale=1e-10)
         fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
         result1 = fitter.fit()
         
@@ -52,5 +53,5 @@
         from sans.models.CylinderModel import CylinderModel
         model1  = CylinderModel()
-        model1.setParam('contrast', 1)
+        
         data = Data(sans_data=data1)
         model = Model(model1)
@@ -58,6 +59,8 @@
         pars1 =['length','radius','scale']
         fitter.set_data(data,1)
-        model.model.setParam('scale',1e-10)
+        model.set(contrast= 1)
+        model.set(scale=1e-10)
         fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
         result1 = fitter.fit()
         
@@ -87,8 +90,9 @@
         cyl1  = CylinderModel()
         cyl1.name = "C1"
-        cyl1.setParam('contrast', 1)
-        cyl1.setParam('scale', 1e-10)
+        
         data1 = Data(sans_data=data1)
         model1 = Model(cyl1)
+        model1.set(contrast=1)
+        model1.set(scale= 1e-10)
         fitter.set_data(data1,1)
         fitter.set_model(model1, 1, ['length','radius','scale'])
@@ -96,6 +100,5 @@
         cyl2  = CylinderModel()
         cyl2.name = "C2"
-        cyl2.setParam('contrast', 1)
-        cyl2.setParam('scale', 1e-10)
+        
         data2 = Data(sans_data=data2)
         # This is wrong. We should not store string as 
@@ -108,8 +111,10 @@
         model2 = Model(cyl2)
         model2.set(length='C1.length')
-        
+        model2.set(contrast=1)
+        model2.set(scale= 1e-10)
         fitter.set_data(data2,2)
         fitter.set_model(model2, 2, ['radius','scale'])
-        
+        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(Uid=2,value=1)
         result1 = fitter.fit()
         
Index: park_integration/test/test_fit_line.py
===================================================================
--- park_integration/test/test_fit_line.py	(revision 6aa47dffdc3055f3ec2a2ba121c6d16492f7e546)
+++ park_integration/test/test_fit_line.py	(revision 8bbab51dadf0f5733ee5e322ab34e8d8f3f9708b)
@@ -10,5 +10,5 @@
     """ test fitting """
     def test1(self):
-        """ Fit 1 data (testdata_line.txt)and 1 model(lineModel)  """
+        """ Fit 1 data (testdata_line.txt)and 1 model(lineModel) """
         #load data
         from DataLoader.loader import Loader
@@ -34,4 +34,5 @@
         pars1= ['A','B']
         fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
         result1 = fitter.fit()
         self.assert_(result1)
@@ -48,4 +49,5 @@
         fitter.set_data(data,1)
         fitter.set_model(model,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
         result2 = fitter.fit()
         
@@ -91,6 +93,15 @@
         fitter.set_data(data1,1)
         fitter.set_model(model1,1,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=0)
         fitter.set_data(data2,2)
         fitter.set_model(model2,2,pars1)
+        fitter.select_problem_for_fit(Uid=2,value=0)
+        
+        try: result1 = fitter.fit()
+        except RuntimeError,msg:
+           assert str(msg)=="No Assembly scheduled for Scipy fitting."
+        else: raise AssertError,"No error raised for scipy fitting with no model"
+        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(Uid=2,value=1)
         try: result1 = fitter.fit()
         except RuntimeError,msg:
@@ -104,4 +115,6 @@
         fitter.set_data(data2,2)
         fitter.set_model(model2,2,pars1)
+        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(Uid=2,value=1)
         result2 = fitter.fit()
         
@@ -132,10 +145,9 @@
         model11  = LineModel()
         model11.name= "line"
-        model11.setParam('A',4)
-        model11.setParam('B',3)
+       
         model22  = Constant()
         model22.name= "cst"
         # Constrain the constant value to be equal to parameter B (the real value is 2.5)
-        model22.setParam('value','line.B')
+        
         
         data1 = Data(sans_data=data11 )
@@ -143,4 +155,7 @@
         model1 = Model(model11)
         model2 = Model(model22)
+        model1.set(A=4)
+        model1.set(B=3)
+        model2.set(value='line.B')
         #fit with scipy test
         pars1= ['A','B']
@@ -151,4 +166,6 @@
         fitter.set_data(data2,2)
         fitter.set_model(model2,2,pars2)
+        fitter.select_problem_for_fit(Uid=1,value=1)
+        fitter.select_problem_for_fit(Uid=2,value=1)
         
         result2 = fitter.fit()
@@ -186,4 +203,5 @@
         fitter.set_model(model,1,pars1)
         fitter.set_data(data2,1,qmin=1,qmax=10)
+        fitter.select_problem_for_fit(Uid=1,value=1)
         
         result1 = fitter.fit()
@@ -203,5 +221,5 @@
         fitter.set_model(model,1,pars1)
         fitter.set_data(data2,1,qmin=1,qmax=10)
-       
+        fitter.select_problem_for_fit(Uid=1,value=1)
         result2 = fitter.fit()
         
Index: park_integration/test/testnewscipys.py
===================================================================
--- park_integration/test/testnewscipys.py	(revision d831626c10346da20b9b7a000586aa31c32ca89e)
+++ 	(revision )
@@ -1,98 +1,0 @@
-"""
-    test Data, Model , fucntor classes of AbstractFittingModule
-"""
-import unittest
-from sans.guitools.plottables import Theory1D
-from sans.guitools.plottables import Data1D
-from sans.fit.AbstractFitEngine import Data, Model
-from sans.fit.AbstractFitEngine import sansAssembly
-import math
-class testFitModule(unittest.TestCase):
-    """ test fitting """
-    
-    def test_Data(self):
-        """ test Data"""
-        #load data
-        from sans.fit.Loader import Load
-        load= Load()
-        load.set_filename("cyl_testdata.txt")
-        load.set_values()
-        data11 = Data1D(x=[], y=[],dx=None, dy=None)
-        load.load_data(data11)
-        
-        #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()
-        data1=Data(sans_data=data11)
-        model =Model(model1)
-        #Do the fit SCIPY0.007778 1.78E+14 13335629 
-        v=[0.007778,0.023333,0.031111,0.038889,0.046667,0.054444]
-        for i in range(len(v)):
-            self.assertEquals(data1.x[i],v[i])
-        #fitter.set_data_assembly(data1,1)
-        #fitter.set_model_assembly(model,"M1",1,['A','B'])
-    def test_Model(self):
-        """ test Model"""
-        #load data
-        from sans.fit.Loader import Load
-        load= Load()
-        load.set_filename("cyl_testdata.txt")
-        load.set_values()
-        data11 = Data1D(x=[], y=[],dx=None, dy=None)
-        load.load_data(data11)
-        
-        #Importing the Fit module
-        from sans.fit.Fitting import Fit
-        fitter= Fit('scipy')
-        
-        # Receives the type of model for the fitting
-        from sans.models.CylinderModel import CylinderModel
-        model1  = CylinderModel()
-        data1=Data(sans_data=data11)
-        model =Model(model1)
-        for item in data1.x:
-            self.assertEquals(model.eval(item),model.model.run(item))
-        p=[0.0, 3.0000000000000001e-006, 1.0, 1.0, 400.0, 20.0, 1.0]  
-        model.setParams(p)
-        res=[]
-        for i in range(len(data1.x)):
-            res.append((data1.y[i]-model.eval(data1.x[i]))/data1.dy[i])
-            self.assertEquals(model.eval(data1.x[i]),model.model.run(data1.x[i]))  
-        print res
-    def test_funtor(self):
-        """ test functor"""
-        #load data
-        from sans.fit.Loader import Load
-        load= Load()
-        load.set_filename("cyl_testdata.txt")
-        load.set_values()
-        data11 = Data1D(x=[], y=[],dx=None, dy=None)
-        load.load_data(data11)
-        
-        #Importing the Fit module
-        from sans.fit.Fitting import Fit
-        fitter= Fit('scipy')
-        
-        # Receives the type of model for the fitting
-        from sans.models.CylinderModel import CylinderModel
-        model1  = CylinderModel()
-        data1=Data(sans_data=data11)
-        model =Model(model1)
-        functor= sansAssembly(model,data1)
-        for item in data1.x:
-            self.assertEquals(model.eval(item),model.model.run(item))
-        p=[0.0, 3.0000000000000001e-006, 1.0, 1.0, 400.0, 20.0, 1.0]  
-        model.setParams(p)
-        res=[]
-        for i in range(len(data1.x)):
-            res.append((data1.y[i]-model.eval(data1.x[i]))/data1.dy[i])
-            self.assertEquals(model.eval(data1.x[i]),model.model.run(data1.x[i]))  
-        f=functor(p)
-
-        for i in range(len(res)):
-            self.assertEquals(res[i],f[i])    
-       
