Index: park_integration/test/constrainttestpark.py
===================================================================
--- park_integration/test/constrainttestpark.py	(revision 9e857929197322ca949a60c6dc66670d05725dcc)
+++ park_integration/test/constrainttestpark.py	(revision cf3b78180fcc2790f77e3f3ad09c5c4992a6d45f)
@@ -40,5 +40,5 @@
         engine.set_data(data1,1)
         #print "m1 param b", M1.B
-        engine.set_param( model2,"M2", {'A':1,'B':'2*M1.B'})
+        engine.set_param( model2,"M2", {'A':'M1.A','B':'M1.B'})
         engine.set_model(model2,2)
         engine.set_data(data2,2)
@@ -46,3 +46,12 @@
         
         print engine.fit({'A':2,'B':1},None,None)
-      
+        if True:
+            import pylab
+            x1 = engine.problem[0].data.x
+            x2 = engine.problem[1].data.x
+            y1 = engine.problem[0].data.y
+            y2 = engine.problem[1].data.y
+            fx1 = engine.problem[0].data.fx
+            fx2 = engine.problem[1].data.fx
+            pylab.plot(x1,y1,'xb',x1,fx1,'-b',x2,y2,'xr',x2,fx2,'-r')
+            pylab.show()
Index: park_integration/test/testfitting.py
===================================================================
--- park_integration/test/testfitting.py	(revision 9e857929197322ca949a60c6dc66670d05725dcc)
+++ park_integration/test/testfitting.py	(revision cf3b78180fcc2790f77e3f3ad09c5c4992a6d45f)
@@ -73,4 +73,5 @@
         #Do the fit SCIPY
         engine.set_data(data1,1)
+        engine.set_param( model,"M1", {'A':2,'B':4})
         engine.set_model(model,1)
         
@@ -87,19 +88,19 @@
         #Do the fit
         engine.set_data(data1,1)
+        engine.set_param( model1,"M1", {'A':2,'B':4})
         engine.set_model(model,1)
        
         engine.fit({'A':2,'B':1},None,None)
-        """
-            
-            self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
-            self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2)
-            self.assert_(chisqr2/len(data1.x) < 2)
-            
-            self.assertEqual(out1[1], out2[1])
-            self.assertEquals(out1[0], out2[0])
-            self.assertEquals(cov1[0][0], cov2[0][0])
-            self.assertEquals(cov1[1][1], cov2[1][1])
-            self.assertEquals(chisqr1, chisqr2)
-        """
+        
+        self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
+        self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2)
+        self.assert_(chisqr2/len(data1.x) < 2)
+        
+        self.assertEqual(out1[1], out2[1])
+        self.assertEquals(out1[0], out2[0])
+        self.assertEquals(cov1[0][0], cov2[0][0])
+        self.assertEquals(cov1[1][1], cov2[1][1])
+        self.assertEquals(chisqr1, chisqr2)
+       
     def testfit_2Data_1Model(self):
         """ test fitting for two set of data  and one model"""
@@ -128,5 +129,7 @@
         engine = fitter.returnEngine()
         #Do the fit
-        engine.set_model(model,1)
+        engine.set_param( model,"M1", {'A':2,'B':4})
+        engine.set_model(model,1)
+    
         engine.set_data(data1,1)
         engine.set_data(data2,1)
@@ -150,19 +153,18 @@
         engine.set_data(data2,1)
         engine.fit({'A':2,'B':1},None,None)
-        """
-            chisqr2, out2, cov2= engine.fit({'A':2,'B':1},None,None)
-            
-            
-            self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
-            self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2)
-            self.assert_(chisqr2/len(data1.x) < 2)
-            self.assert_(chisqr2/len(data2.x) < 2)
-            
-            self.assertEqual(out1[0],out2[0])
-            self.assertEqual(out1[1],out2[1])
-            self.assertEqual(chisqr1,chisqr2)
-            self.assertEqual(cov1[0][0],cov2[0][0])
-            self.assertEqual(cov1[1][1],cov2[1][1])
-        """
+        
+        chisqr2, out2, cov2= engine.fit({'A':2,'B':1},None,None)
+        #print "park",chisqr2, out2, cov2
+        self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
+        self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2)
+        self.assert_(chisqr2/len(data1.x) < 2)
+        self.assert_(chisqr2/len(data2.x) < 2)
+        
+        self.assertEqual(out1[0],out2[0])
+        self.assertEqual(out1[1],out2[1])
+        self.assertEqual(chisqr1,chisqr2)
+        self.assertEqual(cov1[0][0],cov2[0][0])
+        self.assertEqual(cov1[1][1],cov2[1][1])
+       
     def test2models2dataonconstraint(self):
         """ test for 2 Models two data one constraint"""
@@ -187,32 +189,40 @@
         from sans.guitools.LineModel import LineModel
         model1  = LineModel()
-        model1.name='M1'
         model2  = LineModel()
-        model2.name='M2'
+       
         #set engine for scipy 
-        fitter.fit_engine('scipy')
-        engine = fitter.returnEngine()
-        #Do the fit
+        """
+            fitter.fit_engine('scipy')
+            engine = fitter.returnEngine()
+            #Do the fit
+            engine.set_param( model1,"M1", {'A':2,'B':4})
+            engine.set_model(model1,1)
+            engine.set_data(data1,1)
+            engine.set_param( model1,"M2", {'A':2.1,'B':3})
+            engine.set_model(model2,2)
+            engine.set_data(data2,2)
+        
+            try: engine.fit({'A':2,'B':1},None,None)
+            except ValueError,msg:
+                assert str(msg)=="cannot fit more than one model",'Message: <%s>'%(msg)
+        """
+        #set engine for park 
+        fitter= Fit()
+        fitter.fit_engine('park')
+        engine = fitter.returnEngine()
+        #Do the fit
+        engine.set_data(data1,1)
+        engine.set_param(model1,"M1",{'A':2,'B':1})
         engine.set_model(model1,1)
-        engine.set_data(data1,1)
+        
+        engine.set_param(model2,"M2",{'A':3,'B':'M1.B'})
         engine.set_model(model2,2)
         engine.set_data(data2,2)
-    
-        try: engine.fit({'A':2,'B':1},None,None)
-        except ValueError,msg:
-            assert str(msg)=="cannot fit more than one model",'Message: <%s>'%(msg)
-        
-        #set engine for park 
-        fitter= Fit()
-        fitter.fit_engine('park')
-        engine = fitter.returnEngine()
-        #Do the fit
-        engine.set_data(data1,1)
-        engine.set_param(model1,{'A':2,'B':1})
-        engine.set_model(model1,1)
-        
-        engine.set_param(model2,{'A':3,'B':'5*M1.B'})
-        engine.set_model(model2,2)
-        engine.set_data(data2,2)
-        engine.fit({'A':2,'B':1},None,None)
-        
+        chisqr2, out2, cov2= engine.fit({'A':2,'B':1},None,None)
+        
+        
+        self.assert_(math.fabs(out2[1]-2.5)/math.sqrt(cov2[1][1]) < 2)
+        self.assert_(math.fabs(out2[0]-4.0)/math.sqrt(cov2[0][0]) < 2)
+        self.assert_(chisqr2/len(data1.x) < 2)
+        self.assert_(chisqr2/len(data2.x) < 2)
+        
Index: park_integration/test/testpark.py
===================================================================
--- park_integration/test/testpark.py	(revision 9e857929197322ca949a60c6dc66670d05725dcc)
+++ park_integration/test/testpark.py	(revision cf3b78180fcc2790f77e3f3ad09c5c4992a6d45f)
@@ -40,9 +40,43 @@
         engine.set_data(data1,1)
         
+        import numpy
+        #print engine.fit({'A':2,'B':1},None,None)
+        #engine.remove_data(2,data2)
+        #engine.remove_model(2)
+        
         engine.set_param( model2,"M2", {'A':2.5,'B':4})
         engine.set_model(model2,2)
         engine.set_data(data2,2)
-    
-        
         print engine.fit({'A':2,'B':1},None,None)
-      
+
+        if True:
+            import pylab
+            x1 = engine.problem[0].data.x
+            x2 = engine.problem[1].data.x
+            y1 = engine.problem[0].data.y
+            y2 = engine.problem[1].data.y
+            fx1 = engine.problem[0].data.fx
+            fx2 = engine.problem[1].data.fx
+            pylab.plot(x1,y1,'xb',x1,fx1,'-b',x2,y2,'xr',x2,fx2,'-r')
+            pylab.show()
+        if False:
+            print "current"
+            print engine.problem.chisq
+            print engine.problem.residuals
+            print "M1.y",engine.problem[0].data.y
+            print "M1.fx",engine.problem[0].data.fx
+            print "M1 delta",numpy.asarray(engine.problem[0].data.y)-engine.problem[0].data.fx
+            print "M2.y",engine.problem[0].data.y
+            print "M2.fx",engine.problem[0].data.fx
+            print "M2 delta",numpy.asarray(engine.problem[1].data.y)-engine.problem[1].data.fx
+            print "target"
+            engine.problem(numpy.array([4,2.5,4,2.5]))
+            print engine.problem.chisq
+            print engine.problem.residuals
+            print "M1.y",engine.problem[0].data.y
+            print "M1.fx",engine.problem[0].data.fx
+            print "M1 delta",numpy.asarray(engine.problem[0].data.y)-engine.problem[0].data.fx
+            print "M2.y",engine.problem[0].data.y
+            print "M2.fx",engine.problem[0].data.fx
+            print "M2 delta",numpy.asarray(engine.problem[1].data.y)-engine.problem[1].data.fx
+            
