Index: test/sasdataloader/test/utest_smearing.py
===================================================================
--- test/sasdataloader/test/utest_smearing.py	(revision ef908db37c9eb600c4448e9e4633b500a40c6361)
+++ 	(revision )
@@ -1,96 +1,0 @@
-"""
-    Unit tests for data manipulations
-"""
-
-
-import unittest
-import numpy, math
-from sas.sascalc.dataloader.loader import  Loader
-from sas.sascalc.dataloader.data_info import Data1D, Data2D
-#from DataLoader.qsmearing import SlitSmearer, QSmearer, smear_selection
-from sas.sascalc.data_util.qsmearing import SlitSmearer, QSmearer, smear_selection
-import os.path
-from time import time
-class smear_tests(unittest.TestCase):
-    
-    def setUp(self):
-        data = Loader().load("cansas1d_slit.xml")
-        self.data = data[0]
-        
-        x = 0.001*numpy.arange(1,11)
-        y = 12.0-numpy.arange(1,11)
-        dxl = 0.00*numpy.ones(10)
-        dxw = 0.00*numpy.ones(10)
-        dx = 0.00*numpy.ones(10)
-        
-        self.data.dx = dx
-        self.data.x = x
-        self.data.y = y
-        self.data.dxl = dxl
-        self.data.dxw = dxw
-        
-    def test_slit(self):
-        """
-            Test identity smearing
-        """
-        # Create smearer for our data
-        s = SlitSmearer(self.data)
-        
-        input = 12.0-numpy.arange(1,11)
-        output = s(input)
-        for i in range(len(input)):
-            self.assertEquals(input[i], output[i])
-
-    def test_slit2(self):
-        """
-            Test basic smearing
-        """
-        dxl = 0.005*numpy.ones(10)
-        dxw = 0.0*numpy.ones(10)
-        self.data.dxl = dxl
-        self.data.dxw = dxw
-        # Create smearer for our data
-        s = SlitSmearer(self.data)
-        
-        input = 12.0-numpy.arange(1,11)
-        output = s(input)
-        # The following commented line was the correct output for even bins [see smearer.cpp for details] 
-        #answer = [ 9.666,  9.056,  8.329,  7.494,  6.642,  5.721,  4.774,  3.824,  2.871, 2.   ]
-        answer = [ 9.0618,  8.6401,  8.1186,  7.1391,  6.1528,  5.5555,     4.5584,  3.5606,  2.5623, 2.    ]
-        for i in range(len(input)):
-            self.assertAlmostEqual(answer[i], output[i], 3)
-        
-    def test_q(self):
-        """
-            Test identity resolution smearing
-        """
-        # Create smearer for our data
-        s = QSmearer(self.data)
-        
-        input = 12.0-numpy.arange(1,11)
-        output = s(input)
-        for i in range(len(input)):
-            self.assertAlmostEquals(input[i], output[i], 5)
-
-    def test_q2(self):
-        """
-            Test basic smearing
-        """
-        dx = 0.001*numpy.ones(10)
-        self.data.dx = dx
-
-        # Create smearer for our data
-        s = QSmearer(self.data)
-        
-        input = 12.0-numpy.arange(1,11)
-        output = s(input)
-        
-        answer = [ 10.44785079,   9.84991299,   8.98101708,   
-                  7.99906585,   6.99998311,   6.00001689,
-                  5.00093415,   4.01898292,   3.15008701,   2.55214921]
-        for i in range(len(input)):
-            self.assertAlmostEqual(answer[i], output[i], 2)
-        
-if __name__ == '__main__':
-    unittest.main()
-   
Index: test/sasfit/test/testdata_cst.txt
===================================================================
--- test/sasfit/test/testdata_cst.txt	(revision efa5e4440f169b2894993f4f1db9691ecdd9bc2e)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#y=A
-#A=2.5
-0  2.5852  0.375
-0.204082  2.19143  0.375
-0.408163  2.57106  0.375
-0.612245  2.51277  0.375
-0.816327  2.26897  0.375
-1.02041  2.20776  0.375
-1.22449  2.45739  0.375
-1.42857  2.15075  0.375
-1.63265  1.86874  0.375
-1.83673  2.33998  0.375
-2.04082  1.62786  0.375
-2.2449  2.72658  0.375
-2.44898  2.48138  0.375
-2.65306  2.81075  0.375
-2.85714  2.25486  0.375
-3.06122  2.17361  0.375
-3.26531  2.1977  0.375
-3.46939  3.16184  0.375
-3.67347  3.00213  0.375
-3.87755  2.1984  0.375
-4.08163  2.76865  0.375
-4.28571  2.35003  0.375
-4.4898  2.98548  0.375
-4.69388  3.15354  0.375
-4.89796  2.87848  0.375
-5.10204  2.00554  0.375
-5.30612  2.384  0.375
-5.5102  2.56871  0.375
-5.71429  2.57468  0.375
-5.91837  2.02424  0.375
-6.12245  2.81453  0.375
-6.32653  1.79367  0.375
-6.53061  2.23765  0.375
-6.73469  2.36467  0.375
-6.93878  2.89383  0.375
-7.14286  2.43143  0.375
-7.34694  2.66729  0.375
-7.55102  2.85271  0.375
-7.7551  2.23553  0.375
-7.95918  2.37953  0.375
-8.16327  2.55255  0.375
-8.36735  1.83512  0.375
-8.57143  2.82562  0.375
-8.77551  2.36114  0.375
-8.97959  2.58935  0.375
-9.18367  2.19231  0.375
-9.38776  2.92396  0.375
-9.59184  2.48175  0.375
-9.79592  1.90806  0.375
-10  3.02146  0.375
Index: test/sasfit/test/testdata_line.txt
===================================================================
--- test/sasfit/test/testdata_line.txt	(revision efa5e4440f169b2894993f4f1db9691ecdd9bc2e)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A+x*B
-#B=2.5
-#A=4
-0  2.83954  0.6
-0.204082  3.44938  0.676531
-0.408163  5.82026  0.753061
-0.612245  5.27591  0.829592
-0.816327  5.2781  0.906122
-1.02041  5.22531  0.982653
-1.22449  7.47487  1.05918
-1.42857  7.85852  1.13571
-1.63265  10.2278  1.21224
-1.83673  8.33195  1.28878
-2.04082  9.22407  1.36531
-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
-3.87755  10.9443  2.05408
-4.08163  11.4356  2.13061
-4.28571  19.3213  2.20714
-4.4898  14.3191  2.28367
-4.69388  14.6961  2.3602
-4.89796  19.27  2.43673
-5.10204  12.1831  2.51327
-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.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: test/sasfit/test/testdata_line1.txt
===================================================================
--- test/sasfit/test/testdata_line1.txt	(revision efa5e4440f169b2894993f4f1db9691ecdd9bc2e)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#y=A+x*B
-#B=2.5
-#A=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
-
Index: test/sasfit/test/testdata_line3.txt
===================================================================
--- test/sasfit/test/testdata_line3.txt	(revision efa5e4440f169b2894993f4f1db9691ecdd9bc2e)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#y=A*x+B
-#A=2.5
-#B=4
-0  2.83954  0.6
-1  3.44938  0.676531
-0.408163  5.82026  0.753061
-0.612245  5.27591  0.829592
-45  5.2781  0.906122
-1.02041  5.22531  0.982653
-1.22449  7.47487  1.05918
-1.42857  7.85852  1.13571
-1.63265  10.2278  1.21224
-1.83673  8.33195  1.28878
-3  9.22407  1.36531
-2.2449  7.95013  1.44184
-2.44898  10.0289  1.51837
-0 11.0736  1.5949
-2.85714  12.2957  1.67143
-3.06122  12.3108  1.74796
-3.26531  12.6916  1.82449
-4  12.5859  1.90102
-3.67347  14.5972  1.97755
-3.87755  10.9443  2.05408
-4.08163  11.4356  2.13061
-4.28571  19.3213  2.20714
-4.4898  14.3191  2.28367
-4.69388  14.6961  2.3602
-4.89796  19.27  2.43673
--1  12.1831  2.51327
-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
-4  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
-0.2  24.2611  3.89082
-8.97959  29.8796  3.96735
-9.18367  24.6149  4.04388
-0.1  35.7664  4.12041
-0.3  32.145  4.19694
-9.79592  24.8085  4.27347
-10  31.3767  4.35
Index: test/sasfit/test/utest_fit_line.py
===================================================================
--- test/sasfit/test/utest_fit_line.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ 	(revision )
@@ -1,220 +1,0 @@
-"""
-    Unit tests for fitting module 
-    @author Gervaise Alina
-"""
-import unittest
-import math
-
-from sas.sascalc.fit.AbstractFitEngine import Model, FitHandler
-from sas.sascalc.dataloader.loader import Loader
-from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit
-from sas.models.LineModel import LineModel
-from sas.models.Constant import Constant
-
-from bumps import fitters
-try:
-    from bumps.options import FIT_CONFIG
-    def set_fitter(alg, opts):
-        FIT_CONFIG.selected_id = alg
-        FIT_CONFIG.values[alg].update(opts, monitors=[])
-except:
-    # CRUFT: Bumps changed its handling of fit options around 0.7.5.6
-    def set_fitter(alg, opts):
-        #print "fitting",alg,opts
-        #print "options",fitters.FIT_OPTIONS[alg].__dict__
-        fitters.FIT_DEFAULT = alg
-        fitters.FIT_OPTIONS[alg].options.update(opts, monitors=[])
-
-
-class testFitModule(unittest.TestCase):
-    """ test fitting """
-
-    def test_bad_pars(self):
-        fitter = Fit()
-
-        data = Loader().load("testdata_line.txt")
-        data.name = data.filename
-        fitter.set_data(data,1)
-
-        model1  = LineModel()
-        model1.name = "M1"
-        model = Model(model1, data)
-        pars1= ['param1','param2']
-        try:
-            fitter.set_model(model,1,pars1)
-        except ValueError,exc:
-            #print "ValueError was correctly raised: "+str(msg)
-            assert str(exc).startswith('parameter param1')
-        else:
-            raise AssertionError("No error raised for fitting with wrong parameters name to fit")
-
-    def fit_single(self, isdream=False):
-        fitter = Fit()
-
-        data = Loader().load("testdata_line.txt")
-        data.name = data.filename
-        fitter.set_data(data,1)
-
-        # Receives the type of model for the fitting
-        model1  = LineModel()
-        model1.name = "M1"
-        model = Model(model1,data)
-
-        pars1= ['A','B']
-        fitter.set_model(model,1,pars1)
-        fitter.select_problem_for_fit(id=1,value=1)
-        result1, = fitter.fit(handler=FitHandler())
-
-        # The target values were generated from the following statements
-        p,s,fx = result1.pvec, result1.stderr, result1.fitness
-        #print "p0,p1,s0,s1,fx = %g, %g, %g, %g, %g"%(p[0],p[1],s[0],s[1],fx)
-        p0,p1,s0,s1,fx_ = 3.68353, 2.61004, 0.336186, 0.105244, 1.20189
-
-        if isdream:
-            # Dream is not a minimizer: just check that the fit is within
-            # uncertainty
-            self.assertTrue( abs(p[0]-p0) <= s0 )
-            self.assertTrue( abs(p[1]-p1) <= s1 )
-        else:
-            self.assertTrue( abs(p[0]-p0) <= 1e-5 )
-            self.assertTrue( abs(p[1]-p1) <= 1e-5 )
-            self.assertTrue( abs(fx-fx_) <= 1e-5 )
-
-    def fit_bumps(self, alg, **opts):
-        set_fitter(alg, opts)
-        self.fit_single(isdream=(alg=='dream'))
-
-    def test_bumps_de(self):
-        self.fit_bumps('de')
-
-    def test_bumps_dream(self):
-        self.fit_bumps('dream', burn=500, steps=100)
-
-    def test_bumps_amoeba(self):
-        self.fit_bumps('amoeba')
-
-    def test_bumps_newton(self):
-        self.fit_bumps('newton')
-
-    def test_bumps_lm(self):
-        self.fit_bumps('lm')
-
-    def test2(self):
-        """ fit 2 data and 2 model with no constrainst"""
-        #load data
-        l = Loader()
-        data1=l.load("testdata_line.txt")
-        data1.name = data1.filename
-      
-        data2=l.load("testdata_line1.txt")
-        data2.name = data2.filename
-     
-        #Importing the Fit module
-        fitter = Fit()
-        # Receives the type of model for the fitting
-        model11  = LineModel()
-        model11.name= "M1"
-        model22  = LineModel()
-        model11.name= "M2"
-      
-        model1 = Model(model11,data1)
-        model2 = Model(model22,data2)
-        pars1= ['A','B']
-        fitter.set_data(data1,1)
-        fitter.set_model(model1,1,pars1)
-        fitter.select_problem_for_fit(id=1,value=0)
-        fitter.set_data(data2,2)
-        fitter.set_model(model2,2,pars1)
-        fitter.select_problem_for_fit(id=2,value=0)
-
-        try: result1, = fitter.fit(handler=FitHandler())
-        except RuntimeError,msg:
-            assert str(msg)=="Nothing to fit"
-        else: raise AssertionError,"No error raised for fitting with no model"
-        fitter.select_problem_for_fit(id=1,value=1)
-        fitter.select_problem_for_fit(id=2,value=1)
-        R1,R2 = fitter.fit(handler=FitHandler())
-        
-        self.assertTrue( math.fabs(R1.pvec[0]-4)/3 <= R1.stderr[0] )
-        self.assertTrue( math.fabs(R1.pvec[1]-2.5)/3 <= R1.stderr[1] )
-        self.assertTrue( R1.fitness/(len(data1.x)+len(data2.x)) < 2)
-        
-        
-    def test_constraints(self):
-        """ fit 2 data and 2 model with 1 constrainst"""
-        #load data
-        l = Loader()
-        data1= l.load("testdata_line.txt")
-        data1.name = data1.filename
-        data2= l.load("testdata_cst.txt")
-        data2.name = data2.filename
-       
-        # Receives the type of model for the fitting
-        model11  = LineModel()
-        model11.name= "line"
-        model11.setParam("A", 1.0)
-        model11.setParam("B",1.0)
-        
-        model22  = Constant()
-        model22.name= "cst"
-        model22.setParam("value", 1.0)
-        
-        model1 = Model(model11,data1)
-        model2 = Model(model22,data2)
-        model1.set(A=4)
-        model1.set(B=3)
-        # Constraint the constant value to be equal to parameter B (the real value is 2.5)
-        #model2.set(value='line.B')
-        pars1= ['A','B']
-        pars2= ['value']
-        
-        #Importing the Fit module
-        fitter = Fit()
-        fitter.set_data(data1,1)
-        fitter.set_model(model1,1,pars1)
-        fitter.set_data(data2,2,smearer=None)
-        fitter.set_model(model2,2,pars2,constraints=[("value","line.B")])
-        fitter.select_problem_for_fit(id=1,value=1)
-        fitter.select_problem_for_fit(id=2,value=1)
-        
-        R1,R2 = fitter.fit(handler=FitHandler())
-        self.assertTrue( math.fabs(R1.pvec[0]-4.0)/3. <= R1.stderr[0])
-        self.assertTrue( math.fabs(R1.pvec[1]-2.5)/3. <= R1.stderr[1])
-        self.assertTrue( R1.fitness/(len(data1.x)+len(data2.x)) < 2)
-        
-        
-    def test4(self):
-        """ fit 2 data concatenates with limited range of x and  one model """
-            #load data
-        l = Loader()
-        data1 = l.load("testdata_line.txt")
-        data1.name = data1.filename
-        data2 = l.load("testdata_line1.txt")
-        data2.name = data2.filename
-
-        # Receives the type of model for the fitting
-        model1  = LineModel()
-        model1.name= "M1"
-        model1.setParam("A", 1.0)
-        model1.setParam("B",1.0)
-        model = Model(model1,data1)
-      
-        pars1= ['A','B']
-        #Importing the Fit module
-
-        fitter = Fit()
-        fitter.set_data(data1,1,qmin=0, qmax=7)
-        fitter.set_model(model,1,pars1)
-        fitter.set_data(data2,1,qmin=1,qmax=10)
-        fitter.select_problem_for_fit(id=1,value=1)
-        result2, = fitter.fit(handler=FitHandler())
-        
-        self.assert_(result2)
-        self.assertTrue( math.fabs(result2.pvec[0]-4)/3 <= result2.stderr[0] )
-        self.assertTrue( math.fabs(result2.pvec[1]-2.5)/3 <= result2.stderr[1] )
-        self.assertTrue( result2.fitness/len(data1.x) < 2)
-
-
-if __name__ == "__main__":
-    unittest.main()
-    
