Index: sansmodels/src/sans/models/test/utest_nonshape.py
===================================================================
--- sansmodels/src/sans/models/test/utest_nonshape.py	(revision f629e346291dbccc6f799045adc85db8e542bdf8)
+++ sansmodels/src/sans/models/test/utest_nonshape.py	(revision 6b8399ba6f840075c71fccde6915bea025074451)
@@ -36,4 +36,5 @@
         self.assertEqual(self.model.run(0.0), 2.0)
         self.assertEqual(self.model.run(2.0), 2.0*math.exp(-(1.0*2.0)**2/3.0))
+        self.assertEqual(self.model.runXY(2.0), 2.0*math.exp(-(1.0*2.0)**2/3.0))
         
     def test2D(self):
@@ -79,4 +80,5 @@
         value = self._func(2.0, 3.0)
         self.assertEqual(self.model.run(3.0), value)
+        self.assertEqual(self.model.runXY(3.0), value)
         
     def test2D(self):
@@ -118,4 +120,5 @@
         value = self._func(50.0, 1.0, 0.001, 2.0)
         self.assertEqual(self.model.run(2.0), value)
+        self.assertEqual(self.model.runXY(2.0), value)
         
         # User enter zero as a value of x
@@ -162,4 +165,5 @@
         self.assertEqual(self.model.run(0.0), 101.0)
         self.assertEqual(self.model.run(2.0), self._func(100.0, 50.0, 1.0, 2.0))
+        self.assertEqual(self.model.runXY(2.0), self._func(100.0, 50.0, 1.0, 2.0))
         
     def test2D(self):
@@ -201,32 +205,29 @@
         from sans.models.DABModel import DABModel
         self.model= DABModel()
-        
-    def test1D(self):
-        self.model.setParam('scale', 10.0)
-        self.model.setParam('Length', 40.0)
-        self.model.setParam('background', 0.0)
-        
-        self.assertEqual(self.model.run(0.0), 10.0)
-        self.assertEqual(self.model.run(2.0), self._func(10.0, 40.0, 0.0, 2.0))
-        
-    def test2D(self):
-        self.model.setParam('scale', 10.0)
-        self.model.setParam('Length', 40.0)
-        self.model.setParam('background', 0.0)
-        
-        value = self._func(10.0, 40.0, 0.0, 1.0)*self._func(10.0, 40.0, 0.0, 2.0)    
-        self.assertEqual(self.model.runXY([1.0,2.0]), value)
-        
-    def test2Dphi(self):
-        self.model.setParam('scale', 10.0)
-        self.model.setParam('Length', 40.0)
-        self.model.setParam('background', 0.0)
-        
-        x = 1.0
-        y = 2.0
-        r = math.sqrt(x**2 + y**2)
-        phi = math.atan2(y, x)
-        
-        value = self._func(10.0, 40.0, 0.0, x)*self._func(10.0, 40.0, 0.0, y)
+        self.scale = 10.0
+        self.length = 40.0
+        self.back = 1.0
+        
+        self.model.setParam('scale', self.scale)
+        self.model.setParam('Length', self.length)
+        self.model.setParam('background', self.back)
+        
+    def test1D(self):
+        
+        self.assertEqual(self.model.run(0.0), self.scale+self.back)
+        self.assertEqual(self.model.run(2.0), self._func(self.scale, self.length, self.back, 2.0))
+        self.assertEqual(self.model.runXY(2.0), self._func(self.scale, self.length, self.back, 2.0))
+        
+    def test2D(self):
+        value = self._func(self.scale, self.length, self.back, 1.0)*self._func(self.scale, self.length, self.back, 2.0)    
+        self.assertEqual(self.model.runXY([1.0,2.0]), value)
+        
+    def test2Dphi(self):
+        x = 1.0
+        y = 2.0
+        r = math.sqrt(x**2 + y**2)
+        phi = math.atan2(y, x)
+        
+        value = self._func(self.scale, self.length, self.back, x)*self._func(self.scale, self.length, self.back, y)
         self.assertAlmostEquals(self.model.run([r, phi]), value,1)
         
@@ -257,4 +258,5 @@
         #self.assertEqual(self.model.run(0.0), 1.0)
         self.assertEqual(self.model.run(2.0), self._func(math.exp(-6), 4.0, 1.0, 2.0))
+        self.assertEqual(self.model.runXY(2.0), self._func(math.exp(-6), 4.0, 1.0, 2.0))
     
     def testlimit(self):
@@ -323,4 +325,5 @@
         self.assertEqual(self.model.run(0.0), 10.1)
         self.assertEqual(self.model.run(2.0), self._func(0.1,-30.0,5000.0,0.1,2.0))
+        self.assertEqual(self.model.runXY(2.0), self._func(0.1,-30.0,5000.0,0.1,2.0))
         
     def test2D(self):
@@ -409,4 +412,5 @@
    
         self.assertEqual(self.model.run(q), self._func(q))
+        self.assertEqual(self.model.runXY(q), self._func(q))
          
     def test2D(self):
@@ -438,23 +442,28 @@
         from sans.models.FractalModel import FractalModel
         self.model= FractalModel()
-        
-    def test1D(self):
-        r0 = 5.0
-        sldp = 2.0e-6
-        sldm = 6.35e-6
-        phi = 0.05
-        Df = 2
-        corr = 100.0
-        bck = 1.0
-        
-        x = 0.001
-        
-        self.model.setParam('scale', phi) 
-        self.model.setParam('Radius', r0) 
-        self.model.setParam('fractal_dim',Df)
-        self.model.setParam('corr_length', corr)
-        self.model.setParam('block_sld', sldp) 
-        self.model.setParam('solvent_sld', sldm) 
-        self.model.setParam('background', bck)
+        self.r0 = 5.0
+        self.sldp = 2.0e-6
+        self.sldm = 6.35e-6
+        self.phi = 0.05
+        self.Df = 2
+        self.corr = 100.0
+        self.bck = 1.0
+        
+        self.model.setParam('scale', self.phi) 
+        self.model.setParam('Radius', self.r0) 
+        self.model.setParam('fractal_dim',self.Df)
+        self.model.setParam('corr_length', self.corr)
+        self.model.setParam('block_sld', self.sldp) 
+        self.model.setParam('solvent_sld', self.sldm) 
+        self.model.setParam('background', self.bck)
+        
+    def _func(self, x):
+        r0 = self.r0
+        sldp = self.sldp
+        sldm = self.sldm
+        phi = self.phi
+        Df = self.Df
+        corr = self.corr
+        bck = self.bck
         
         pq = 1.0e8*phi*4.0/3.0*math.pi*r0*r0*r0*(sldp-sldm)*(sldp-sldm)*math.pow((3*(math.sin(x*r0) - x*r0*math.cos(x*r0))/math.pow((x*r0),3)),2);
@@ -463,10 +472,27 @@
         sq /= math.pow((x*r0),Df) * math.pow((1.0 + 1.0/(x*corr)/(x*corr)),((Df-1.0)/2.0));
         sq += 1.0;
-       
-        self.assertAlmostEqual(self.model._scatterRanDom(x),pq, 8 )
-        
+        
+        self.assertAlmostEqual(self.model._scatterRanDom(x), pq, 8 )
         self.assertEqual(self.model._Block(x),sq )
         
-        self.assertEqual(self.model.run(x), pq*sq+bck)
+        return sq*pq+bck
+    
+    def test1D(self):        
+        x = 0.001
+        
+        iq = self._func(x)
+        self.assertEqual(self.model.run(x), iq)
+        self.assertEqual(self.model.runXY(x), iq)
+    
+    def test2D(self):
+        x = 1.0
+        y = 2.0
+        r = math.sqrt(x**2 + y**2)
+        phi = math.atan2(y, x)
+        iq_x = self._func(x)
+        iq_y = self._func(y)
+        
+        self.assertEqual(self.model.run([r, phi]), iq_x*iq_y)
+        self.assertEqual(self.model.runXY([x,y]), iq_x*iq_y)
         
 if __name__ == '__main__':
