Index: sansmodels/src/sans/models/BaseComponent.py
===================================================================
--- sansmodels/src/sans/models/BaseComponent.py	(revision d30fdde57d731eefe87a192da26c14c21db5a811)
+++ sansmodels/src/sans/models/BaseComponent.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -1,35 +1,15 @@
 #!/usr/bin/env python
-""" Provide base functionality for all model components
-    @author: Mathieu Doucet / UTK
-    @contact: mathieu.doucet@nist.gov
+""" 
+    Provide base functionality for all model components
 """
 
-# info
-__author__ = "Mathieu Doucet /  UTK"
-__id__ = "$Id: BaseComponent.py,v 1.2 2007/03/14 21:04:40 doucet Exp $"
-   
 # imports   
 import copy
    
 class BaseComponent:
-    """ Basic model component
-        Provides basic arithmetics
+    """ 
+        Basic model component
         
-        The supported operations are: add (+), subtract (-), multiply (*) and divide (/).
-        
-        Here's an arithmetics example to define a function
-        f = ( 1+sin(x) )**2 + 3.0
-        and evaluate it at 1.4.
-        
-        
-        sin   = Sin()
-        const1 = Constant()
-        const2 = Constant()
-        const2.setParam('value', 3.0)
-         
-        func = (const1 + sin)*(const1 + sin) + const2
-        
-        print func(1.4) 
-        
+        Since version 0.5.0, basic operations are no longer supported.
     """
 
@@ -39,9 +19,4 @@
         ## Name of the model
         self.name   = "BaseComponent"
-        ## Component left of operator
-        self.operateOn = None
-        ## Component right of operator
-        self.other = None
-
         
         ## Parameters to be accessed by client
@@ -53,16 +28,11 @@
            
     def __str__(self):
-        """ Prints an XML representation of the model
+        """ 
             @return: string representation
         """
         return self.name
    
-    def run(self, x=0): #pylint: disable-msg=R0201
-        """ Evaluate the model
-            Dummy function
-            @param x: input value
-            @return: value of the model
-        """
-        return 0
+    def run(self, x): return NotImplemented
+    def runXY(self, x): return NotImplemented  
     
     def clone(self):
@@ -70,249 +40,129 @@
         
         obj = copy.deepcopy(self)
-        obj.params = copy.deepcopy(self.params)
-        obj.details = copy.deepcopy(self.details)
+        obj.params     = copy.deepcopy(self.params)
+        obj.details    = copy.deepcopy(self.details)
+        obj.dispersion = copy.deepcopy(self.dispersion)
     
-        # Check for standard data members of arithmetics sub-classes
-        if hasattr(self, 'operateOn') and \
-            not self.operateOn == None:
-            obj.operateOn = self.operateOn.clone()
-
-        if hasattr(self, 'other') and \
-            not self.other == None:
-            obj.other = self.other.clone()
-        
         return obj
 
-    def __add__(self, other):
-        """ Overload addition operator
-            @param other: model to add
-        """
-        from sans.models.AddComponent import AddComponent
-        return AddComponent(self.clone(), other)
+    def setParam(self, name, value):
+        """ 
+            Set the value of a model parameter
         
-    def __sub__(self, other):
-        """ Overload subtraction operator
-            @param other: model to subtract
-        """
-        from sans.models.SubComponent import SubComponent
-        return SubComponent(self.clone(), other)
-        
-    def __mul__(self, other):
-        """ Overload multiplication operator
-            @param other: model to multiply
-        """
-        from sans.models.MulComponent import MulComponent
-        return MulComponent(self.clone(), other)
-        
-    def __div__(self, other):
-        """ Overload division operator
-            @param other: mode to divide by
-        """
-        from sans.models.DivComponent import DivComponent
-        return DivComponent(self.clone(), other)
-        
-    def setParam(self, name, value):
-        """ Set the value of a model parameter
-        
-            A list of all the parameters of a model can
-            be obtained with the getParamList() method.
-            For models resulting from an arithmetic
-            operation between two models, the names of
-            the parameters are modified according to
-            the following rule:
-             
-            For parameter 'a' of model A and 
-            parameter 'b' of model B:
-             
-            C = A + B
-                C.setParam('base.a') to access 'a'
-                C.setParam('add.b') to access 'b'
-                 
-            C = A - B
-                C.setParam('base.a') to access 'a'
-                C.setParam('sub.b') to access 'b'
-                 
-            C = A * B
-                C.setParam('base.a') to access 'a'
-                C.setParam('mul.b') to access 'b'
-                 
-            C = A / B
-                C.setParam('base.a') to access 'a'
-                C.setParam('div.b') to access 'b'
-                         
             @param name: name of the parameter
             @param value: value of the parameter
         """
-        # Lowercase for case insensitivity
-        name = name.lower()
+        # Look for dispersion parameters
+        toks = name.split('.')
+        if len(toks)==2:
+            for item in self.dispersion.keys():
+                if item.lower()==toks[0].lower():
+                    for par in self.dispersion[item]:
+                        if par.lower() == toks[1].lower():
+                            self.dispersion[item][par] = value
+                            return
+        else:
+            # Look for standard parameter
+            for item in self.params.keys():
+                if item.lower()==name.lower():
+                    self.params[item] = value
+                    return
+            
+        raise ValueError, "Model does not contain parameter %s" % name
         
-        keys = self.params.keys()
-        found = False
+
+    def _setParam(self, name, value):
+        """ 
+            Set the value of a model parameter
         
-        # Loop through the keys and find the right one
-        # The case should not matter
-        for key in keys:
-            if name == key.lower():
-                self.params[key] = value
-                found = True
-                break
-        
-        # Check whether we found the key
-        if not found:
-            raise ValueError, "Model does not contain parameter %s" % name
-
-    def setParamWithToken(self, name, value, token, member):
-        """ 
-            Returns value of a parameter that is part of an internal component
-            @param name: name of the parameter
-            @param value: value of the parameter
-            @param token: parameter prefix
-            @param member: data member pointing to the component
-        """
-        # Lowercase for case insensitivity
-        name = name.lower()
-        
-        # Look for sub-model access
-        toks = name.split('.')
-        if len(toks)>1:
-            short_name = '.'.join(toks[1:])
-            if toks[0] == 'base':
-                return self.operateOn.setParam(short_name, value)
-            elif toks[0] == token:
-                return member.setParam(short_name, value)
-            else:
-                raise ValueError, "Model does not contain parameter %s" % name
-   
-        # If we didn't find a token we know, call the default behavior
-        return BaseComponent.setParam(self, name, value)
-
-        
-    def getParam(self, name):
-        """ Set the value of a model parameter
-
-            A list of all the parameters of a model can
-            be obtained with the getParamList() method.
-            For models resulting from an arithmetic
-            operation between two models, the names of
-            the parameters are modified according to
-            the following rule:
-             
-            For parameter 'a' of model A and 
-            parameter 'b' of model B:
-             
-            C = A + B
-                C.getParam('base.a') to access 'a'
-                C.getParam('add.b') to access 'b'
-                 
-            C = A - B
-                C.getParam('base.a') to access 'a'
-                C.getParam('sub.b') to access 'b'
-                 
-            C = A * B
-                C.getParam('base.a') to access 'a'
-                C.getParam('mul.b') to access 'b'
-                 
-            C = A / B
-                C.getParam('base.a') to access 'a'
-                C.getParam('div.b') to access 'b'
-                         
             @param name: name of the parameter
             @param value: value of the parameter
         """
-        # Lowercase for case insensitivity
-        name = name.lower()
+        # Look for dispersion parameters
+        toks = name.split('.')
+        if len(toks)==2 and toks[0] in self.dispersion:
+            # Setting a dispersion model parameter
+            if toks[1] in self.dispersion[toks[0]]: 
+                self.dispersion[toks[0]][toks[1]] = value
+                return
+            else:
+                raise ValueError, "Model does not contain parameter %s.%s" % (toks[0], toks[1])
         
-        keys = self.params.keys()
-        value = None
-        
-        # Loop through the keys and find the right one
-        # The case should not matter
-        for key in keys:
-            if name == key.lower():
-                value = self.params[key]
-                break
-        
-        # Check whether we found the key
-        if value == None:
+        if name in self.params.keys():
+            self.params[name] = value
+        else:
             raise ValueError, "Model does not contain parameter %s" % name
         
-        return value
+    def _getParam(self, name):
+        """ 
+            Set the value of a model parameter
+
+            @param name: name of the parameter
+        """
+        # Look for dispersion parameters
+        toks = name.split('.')
+        if len(toks)==2 and toks[0] in self.dispersion:
+            # Setting a dispersion model parameter
+            if toks[1] in self.dispersion[toks[0]]: 
+                return self.dispersion[toks[0]][toks[1]] 
+            else:
+                raise ValueError, "Model does not contain parameter %s.%s" % (toks[0], toks[1])
+
+        if name in self.params.keys():
+            return self.params[name]
+        else:
+            raise ValueError, "Model does not contain parameter %s" % name
         
-    def getParamWithToken(self, name, token, member):
+    def getParam(self, name):
+        """ 
+            Set the value of a model parameter
+
+            @param name: name of the parameter
         """
-            Returns value of a parameter that is part of an internal component
-            @param name: name of the parameter
-            @param token: parameter prefix
-            @param member: data member pointing to the component
-            @return: value of the parameter
-        """
-        # Lowercase for case insensitivity
-        name = name.lower()
+        # Look for dispersion parameters
+        toks = name.split('.')
+        if len(toks)==2:
+            for item in self.dispersion.keys():
+                if item.lower()==toks[0].lower():
+                    for par in self.dispersion[item]:
+                        if par.lower() == toks[1].lower():
+                            return self.dispersion[item][par]
+        else:
+            # Look for standard parameter
+            for item in self.params.keys():
+                if item.lower()==name.lower():
+                    return self.params[item]
+            
+        raise ValueError, "Model does not contain parameter %s" % name
+     
+    def getParamList(self):
+        """ 
+            Return a list of all available parameters for the model
+        """ 
+        list = self.params.keys()
+        # WARNING: Extending the list with the dispersion parameters
+        list.extend(self.getDispParamList())
+        return list
+    
+    def getDispParamList(self):
+        """ 
+            Return a list of all available parameters for the model
+        """ 
+        list = []
         
-        # Look for sub-model access
-        toks = name.split('.')
-        if len(toks)>1:
-            #short_name = string.join(toks[1:],'.')
-            short_name = '.'.join(toks[1:])
-            if toks[0] == 'base':
-                return self.operateOn.getParam(short_name)
-            elif toks[0] == token:
-                return member.getParam(short_name)
-            else:
-                raise ValueError, "Model does not contain parameter %s" % name
-   
-        # If we didn't find a token we know, call the default behavior
-        return BaseComponent.getParam(self, name)
+        for item in self.dispersion.keys():
+            for p in self.dispersion[item].keys():
+                if p not in ['type']:
+                    list.append('%s.%s' % (item.lower(), p.lower()))
+                    
+        return list
+    
+    # Old-style methods that are no longer used
+    def setParamWithToken(self, name, value, token, member): return NotImplemented
+    def getParamWithToken(self, name, token, member): return NotImplemented
+    def getParamListWithToken(self, token, member): return NotImplemented
+    def __add__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __sub__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __mul__(self, other): raise ValueError, "Model operation are no longer supported"
+    def __div__(self, other): raise ValueError, "Model operation are no longer supported"
         
-         
-    def getParamList(self):
-        """ Return a list of all available parameters for the model 
-        
-            For models resulting from an arithmetic
-            operation between two models, the names of
-            the parameters are modified according to
-            the following rule:
-             
-            For parameter 'a' of model A and 
-            parameter 'b' of model B:
-             
-            C = A + B
-                C.getParam('base.a') to access 'a'
-                C.getParam('add.b') to access 'b'
-                 
-            C = A - B
-                C.getParam('base.a') to access 'a'
-                C.getParam('sub.b') to access 'b'
-                 
-            C = A * B
-                C.getParam('base.a') to access 'a'
-                C.getParam('mul.b') to access 'b'
-                 
-            C = A / B
-                C.getParam('base.a') to access 'a'
-                C.getParam('div.b') to access 'b'
-                                 
-        """
-        param_list = self.params.keys()
-        return param_list
-        
-    def getParamListWithToken(self, token, member):
-        """ 
-            Return a list of all available parameters for the model 
-            
-            @param token: parameter prefix
-            @param member: data member pointing to internal component
-            @return: list of parameters
-        """
-        param_list = self.params.keys()
-        if not self.operateOn == None:
-            sub_list = self.operateOn.params.keys()
-            for p in sub_list:
-                param_list.append("base.%s" % p)
-        if not member == None:
-            sub_list = member.params.keys()
-            for p in sub_list:
-                param_list.append("%s.%s" % (token, p))
-        return param_list
-  
-# End of file
Index: sansmodels/src/sans/models/BaseModel.py
===================================================================
--- sansmodels/src/sans/models/BaseModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/BaseModel.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -64,6 +64,13 @@
     ## Name of the model
     name = "BaseModel"
-    ## Dictionary of Parameter objects
-    parameters = {}
+    
+    def __init__(self):
+        ## Dictionary of Parameter objects
+        self.parameters = {}
+        
+        for item in self.params:
+            self.parameters[item] = Parameter(item, self.params[item])
+
+        
 
     # Evaluation methods to be implemented by the models
@@ -97,5 +104,7 @@
         # Lowercase for case insensitivity
         name = name.lower()
-        return object.__setattribute__(self, name, value)
+        if name in self.parameters:
+            print "found"
+        return object.__setattr__(self, name, value)
         
     def getParam(self, name):
Index: sansmodels/src/sans/models/ModelAdaptor.py
===================================================================
--- sansmodels/src/sans/models/ModelAdaptor.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/ModelAdaptor.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -62,15 +62,5 @@
         ## Provided for backward compatibility
         self.dispersion = {}
-           
-    def __getattribute__(self, name):
-        """
-            Provide additional information when accessing old-style
-            data members.
-        """
-        if name in ['operateOn', 'other']:
-            raise AttributeError, "Model operation are no longer supported"
-
-        return object.__getattribute__(self, name)
-                   
+                              
     # Old-style methods that are no longer used
     def setParamWithToken(self, name, value, token, member): return NotImplemented
Index: sansmodels/src/sans/models/NewCylinderModel.py
===================================================================
--- sansmodels/src/sans/models/NewCylinderModel.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/NewCylinderModel.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -46,6 +46,6 @@
         
         # Initialize BaseComponent first, then sphere
+        CCylinderModel.__init__(self)
         BaseModel.__init__(self)
-        CCylinderModel.__init__(self)
         
         ## Name of the model
Index: sansmodels/src/sans/models/test/testcase_generator.py
===================================================================
--- sansmodels/src/sans/models/test/testcase_generator.py	(revision 36948c921d9d5d3627d4ffc58ffa2c6440002c3a)
+++ sansmodels/src/sans/models/test/testcase_generator.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -2,6 +2,4 @@
     Random test-case generator for BaseComponents
     
-    @author: Mathieu Doucet / UTK
-    @license: This software is provided as part of the DANSE project.
 """
 import time
@@ -760,8 +758,11 @@
 
 if __name__ == '__main__':
-
+    print "Model operations are no longer supported."
+    print "The TestCase generator for model operation can't be used with this version of sansmodels." 
+    
+    
     #print randomModel()
-    g = TestCaseGenerator()
-    g.generateAndRun(20000)
+    #g = TestCaseGenerator()
+    #g.generateAndRun(20000)
     
     #t = TestCase(filename = "error_1.17721e+009.xml")
Index: nsmodels/src/sans/models/test/utest_basemodels.py
===================================================================
--- sansmodels/src/sans/models/test/utest_basemodels.py	(revision ae3ce4eaa593202ebf49122e196897c0d45a25b6)
+++ 	(revision )
@@ -1,318 +1,0 @@
-"""
-    Unit tests for BaseComponent 
-    @author: Mathieu Doucet / UTK
-"""
-# Disable "missing docstring" complaint
-# pylint: disable-msg=C0111
-# Disable "too many methods" complaint 
-# pylint: disable-msg=R0904 
-
-
-import unittest, math
-from sans.models.BaseComponent import BaseComponent
-
-class ConstantComponent(BaseComponent):
-    """ Test component """
-    def __init__(self, value=0):
-        BaseComponent.__init__(self)
-        self.params['value'] = value
-        self.dim = 0
-        self.name = 'constant'
-    def run(self, x=0):
-        """ Evaluate method """
-        return self.params['value']
-        
-class IdentityComponent(BaseComponent):
-    """ Test identity component """
-    def __init__(self):
-        BaseComponent.__init__(self)
-        self.dim = 1
-        self.name = 'id'
-    def run(self, x=0):
-        """ Evaluate method """
-        return x
-        
-class SinComponent(BaseComponent):
-    """ Test sin(x) component """
-    def __init__(self):
-        BaseComponent.__init__(self)
-        self.params['norm'] = 1
-        self.dim = 1
-        self.name = 'sin'
-    def run(self, x=0):
-        """ Evaluate method """
-        return self.params['norm']*math.sin(x)
-        
-class TwoDimComponent(BaseComponent):
-    """ Test 2D component """
-    def __init__(self):
-        BaseComponent.__init__(self)
-        self.params['norm'] = 1
-        self.dim = 2
-        self.name = '2D'
-    def run(self, x):
-        """ Evaluate method """
-        return self.params['norm']*x[0]*math.sin(x[1])
-        
-class ThreeDimComponent(BaseComponent):
-    """ Test 3D component """
-    def __init__(self):
-        BaseComponent.__init__(self)
-        self.params['norm'] = 1
-        self.dim = 3
-        self.name = '3D'
-    def run(self, x):
-        """ Evaluate method """
-        return self.params['norm']*x[0]*math.sin(x[1])*x[2]*x[2]
-        
-
-
-class TestBasicComponent(unittest.TestCase):
-    
-    def setUp(self):
-        self.comp = BaseComponent()
-
-    def testrun(self):
-        input = 45
-        self.assertEqual(self.comp.run(input), 0)
-        
-class TestArithmetic(unittest.TestCase):
-    def setUp(self):
-        self.value1 = 5
-        self.comp1 = ConstantComponent(self.value1)
-        
-        self.value2 = 7
-        self.comp2 = ConstantComponent(self.value2)
-        
-    def testrun(self):
-        self.assertEqual(self.comp1.run(45), self.value1)
-        
-    def testadd(self):
-        newcomp = self.comp1+self.comp2
-        self.assertEqual(newcomp.run(45), self.value1+self.value2)
-        
-    def testmultiply(self):
-        newcomp = self.comp1*self.comp2
-        self.assertEqual(newcomp.run(45), self.value1*self.value2)
-        
-    def testsubtract(self):
-        newcomp = self.comp1-self.comp2
-        self.assertEqual(newcomp.run(45), self.value1-self.value2)
-        
-    def testdivide(self):
-        newcomp = self.comp1/self.comp2
-        self.assertEqual(newcomp.run(45), self.value1/self.value2)
-        print newcomp
-        
-    def vtestcomplic1(self):
-        val = (self.value1+self.value2)/self.value2
-        newcomp = (self.comp1+self.comp2)
-        newcomp2 = newcomp/self.comp2
-        self.assertEqual(newcomp2.run(45), val)
-
-    def testcomplic2(self):
-        # A + B 
-        newcomp = self.comp1+self.comp2
-        # Value of A
-        self.assertEqual(newcomp.operateOn.params['value'], self.value1)
-        # Value of B
-        self.assertEqual(newcomp.other.params['value'], self.value2)
-        # Value of D = A+B
-        self.assertEqual(newcomp.run(), self.value1+self.value2)
-        # D + C
-        newcomp2 = newcomp+self.comp2
-        # Value of D
-        self.assertEqual(newcomp2.operateOn.run(), self.value1+self.value2)
-        # Value of B
-        self.assertEqual(newcomp2.other.params['value'], self.value2)
-        
-        
-        self.assertEqual(newcomp2.run(45), self.value1+self.value2+self.value2)
-
-    def testcomplic3(self):
-        # Same as testcomplic2, but all in one go
-        newcomp = self.comp1+self.comp2+self.comp2
-        self.assertEqual(newcomp.run(45), self.value1+self.value2+self.value2)
-        
-    def testcomplic4(self):
-        output = (self.value1+self.value1)/(self.value1+self.value2)
-        newcomp = (self.comp1+self.comp1)/(self.comp1+self.comp2)
-        self.assertEqual(newcomp.run(45), output)
-                
-class TestIO(unittest.TestCase):
-    def setUp(self):
-        from sans.models.ModelFactory import ModelFactory
-        from sans.models.ModelIO import ModelIO
-        self.factory = ModelFactory()
-        self.io = ModelIO(self.factory)
-        self.sph = self.factory.getModel("SphereModel")
-        self.cyl = self.factory.getModel("CylinderModel")
-        
-        
-    def saveLoadAndCompare(self, combo):
-        # Save
-        self.io.save(combo,"test_io.xml")
-        # Load
-        loaded = self.io.load("test_io.xml")
-        
-        # Check that the model is the same
-        # ONLY WORKS FOR DEFAULT PARAMETERS
-        # print combo.run(1)
-        self.assertEqual(combo.run(1), loaded.run(1))
-        return loaded
-        
-    def testSimple(self):
-        self.saveLoadAndCompare(self.sph)
-        
-    def testAdd(self):
-        combo = self.sph+self.cyl
-        self.saveLoadAndCompare(combo)
-
-    def testSub(self):
-        combo = self.sph-self.cyl
-        self.saveLoadAndCompare(combo)
-
-    def testMul(self):
-        combo = self.sph*self.cyl
-        self.saveLoadAndCompare(combo)
-
-    def testDiv(self):
-        combo = self.sph/self.cyl
-        self.saveLoadAndCompare(combo)
-        
-    def testDegree2(self):
-        combo = (self.sph+self.sph)/self.cyl
-        self.saveLoadAndCompare(combo)
-        
-    def testDegree3(self):
-        combo = self.sph*(self.cyl+self.sph/self.cyl)
-        self.saveLoadAndCompare(combo)
-
-    def testReSave(self):
-        combo = self.sph+self.cyl
-        loaded = self.saveLoadAndCompare(combo)
-        self.saveLoadAndCompare(loaded)
-
-class TestGetSet(unittest.TestCase):
-    def setUp(self):
-        from sans.models.ModelFactory import ModelFactory
-        self.factory = ModelFactory()
-        self.sph = self.factory.getModel("SphereModel")
-        
-    def testGet(self):
-        # The default value is 1.0e-6
-        self.assertEqual(self.sph.getParam("scale"), 1.0e-6)
-        
-    def testGetCaseSensitivity(self):
-        # The default value is 1.0e-6
-        self.assertEqual(self.sph.getParam("sCale"), 1.0e-6)
-        
-    def testGetException(self):
-        self.assertRaises(ValueError, self.sph.getParam, "scalee")
-        
-    def testSet(self):
-        value_0 = self.sph.run(1)
-        scale = 2.0e-6
-        self.sph.setParam("scale", scale)
-        self.assertEqual(self.sph.getParam("scale"), scale)
-        self.assertEqual(self.sph.run(1), 2*value_0)
-        
-    def testSetCaseSensitivity(self):
-        value_0 = self.sph.run(1)
-        scale = 2.0e-6
-        self.sph.setParam("sCale", scale)
-        self.assertEqual(self.sph.getParam("scale"), scale)
-        self.assertEqual(self.sph.run(1), 2*value_0)
-        
-    def testSetException(self):
-        self.assertRaises(ValueError, self.sph.setParam, "scalee", 2.0)
-        
-    def testCompositeAdd(self):
-        sph2 = self.factory.getModel("SphereModel")
-        sph2.setParam("scale", 2.0e-6)
-        model = sph2+self.sph  
-        self.assertEqual(model.getParam('Base.scale'), 2.0e-6)
-        self.assertEqual(model.getParam('add.scale'), 1.0e-6)
-        
-    def testCompositeSub(self):
-        sph2 = self.factory.getModel("SphereModel")
-        sph2.setParam("scale", 2.0e-6)
-        model = sph2-self.sph  
-        self.assertEqual(model.getParam('Base.scale'), 2.0e-6)
-        self.assertEqual(model.getParam('sub.scale'), 1.0e-6)
-        
-    def testCompositeMul(self):
-        sph2 = self.factory.getModel("SphereModel")
-        sph2.setParam("scale", 2.0e-6)
-        model = sph2*self.sph  
-        self.assertEqual(model.getParam('Base.scale'), 2.0e-6)
-        self.assertEqual(model.getParam('mul.scale'), 1.0e-6)
-        
-    def testCompositeDiv(self):
-        sph2 = self.factory.getModel("SphereModel")
-        sph2.setParam("scale", 2.0e-6)
-        model = sph2/self.sph  
-        self.assertEqual(model.getParam('Base.scale'), 2.0e-6)
-        self.assertEqual(model.getParam('div.scale'), 1.0e-6)
-        
-    def testSetCompositeAdd(self):
-        sph2 = self.factory.getModel("SphereModel")
-        #sph2.setParam("scale", 2.0e-6)
-        model = sph2+self.sph  
-        value = model.run(1)
-        scale = 2.0e-6
-        model.setParam("base.scale", scale)
-        model.setParam("add.scale", scale)
-       
-        self.assertEqual(model.getParam("base.scale"), scale)
-        self.assertEqual(model.getParam("add.scale"), scale)
-        self.assertEqual(model.run(1), 2*value)
-        
-    def testSetCompositeSub(self):
-        sph2 = self.factory.getModel("SphereModel")
-        #sph2.setParam("scale", 2.0e-6)
-        model = sph2-self.sph  
-        value = model.run(1)
-        scale = 2.0e-6
-        model.setParam("base.scale", scale)
-        model.setParam("sub.scale", scale)
-       
-        self.assertEqual(model.getParam("base.scale"), scale)
-        self.assertEqual(model.getParam("sub.scale"), scale)
-        self.assertEqual(model.run(1), 2*value)
-        
-    def testSetCompositeMul(self):
-        sph2 = self.factory.getModel("SphereModel")
-        #sph2.setParam("scale", 2.0e-6)
-        model = sph2*self.sph  
-        value = model.run(1)
-        scale = 2.0e-6
-        model.setParam("mul.scale", scale)
-       
-        self.assertEqual(model.getParam("mul.scale"), scale)
-        self.assertEqual(model.run(1), 2*value)
-        
-    def testSetCompositeDiv(self):
-        sph2 = self.factory.getModel("SphereModel")
-        #sph2.setParam("scale", 2.0e-6)
-        model = sph2/self.sph  
-        value = model.run(1)
-        scale = 2.0e-6
-        model.setParam("div.scale", scale)
-       
-        self.assertEqual(model.getParam("div.scale"), scale)
-        self.assertEqual(model.run(1), 0.5*value)
-        
-    def testParamList(self):
-        sph2 = self.factory.getModel("SphereModel")
-        model = sph2/self.sph  
-        p_list = model.getParamList()
-        #print p_list
-        check_list = ['base.scale', 'base.radius', 'base.background', 
-                      'base.contrast', 
-                      'div.scale', 'div.radius', 'div.contrast', 
-                      'div.background']
-        self.assertEqual(check_list, p_list)
-         
-if __name__ == '__main__':
-    unittest.main()
Index: sansmodels/src/sans/models/test/utest_dispersity.py
===================================================================
--- sansmodels/src/sans/models/test/utest_dispersity.py	(revision 0f5bc9ff2027432913fd8d2cb067675244acdaf6)
+++ sansmodels/src/sans/models/test/utest_dispersity.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -47,4 +47,15 @@
         self.assertAlmostEqual(self.model.run(0.001), 4723.32213339, 3)
         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 4743.56, 2)
+        
+    def test_gaussian_zero(self):
+        from sans.models.dispersion_models import GaussianDispersion
+        disp = GaussianDispersion()
+        self.model.set_dispersion('radius', disp)
+        self.model.dispersion['radius']['width'] = 0.0
+        self.model.dispersion['radius']['npts'] = 100
+        self.model.setParam('scale', 1.0)
+        
+        self.assertAlmostEqual(self.model.run(0.001), 450.355, 3)
+        self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 452.299, 3)
         
     def test_array(self):
@@ -429,4 +440,17 @@
         self.assertTrue(math.fabs(val_1d-val_2d)/val_1d < 0.02)
         
+class TestDispModel(unittest.TestCase):
+    def setUp(self):
+        from sans.models.CylinderModel import CylinderModel
+        self.model = CylinderModel()
+        
+        
+    def test_disp_params(self):
+        
+        self.assertEqual(self.model.dispersion['radius']['width'], 0.0)
+        self.model.setParam('radius.width', 5.0)
+        self.assertEqual(self.model.dispersion['radius']['width'], 5.0)
+        self.assertEqual(self.model.getParam('radius.width'), 5.0)
+        self.assertEqual(self.model.dispersion['radius']['type'], 'gaussian')
         
   
Index: sansmodels/src/sans/models/test/utest_models.py
===================================================================
--- sansmodels/src/sans/models/test/utest_models.py	(revision af03ddd0932915d6659404ab7824e4223ea2944f)
+++ sansmodels/src/sans/models/test/utest_models.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -66,4 +66,6 @@
         
     def testIO_add(self):
+        # version 0.5.0: No longer supported
+        return
         from sans.models.ModelFactory import ModelFactory
         from sans.models.ModelIO import ModelIO
@@ -79,4 +81,6 @@
         
     def testIO_add2(self):
+        # version 0.5.0: No longer supported
+        return
         from sans.models.ModelFactory import ModelFactory
         #from sans.models.ModelIO import ModelIO
@@ -109,17 +113,4 @@
         self.assertAlmostEqual(self.comp.run(0.2), 0.041761386790780453, 4)
         
-class TestAddition(unittest.TestCase):
-    """Unit tests for Model Factory"""
-    
-    def setUp(self):
-        from sans.models.ModelFactory import ModelFactory
-        self.comp1 = ModelFactory().getModel('CylinderModel')
-        self.comp2 = ModelFactory().getModel('CylinderModel')
-        self.comp3 = self.comp1+self.comp2
-        
-    def test1D(self):
-        """ Test 1D model of a cylinder """
-        self.assertAlmostEqual(self.comp3.run(0.2), 2*0.041761386790780453, 4)
-        
  
 class TestGaussian(unittest.TestCase):
@@ -230,4 +221,6 @@
         
     def testFunction(self):
+        # version 0.5.0: No longer supported
+        return
         from sans.models.Sin import Sin
         s = Sin()
Index: sansmodels/src/sans/models/test/utest_newstylemodels.py
===================================================================
--- sansmodels/src/sans/models/test/utest_newstylemodels.py	(revision 1b162dfa5c32d9b5cc5f3f9d519acc3c29a8f37b)
+++ sansmodels/src/sans/models/test/utest_newstylemodels.py	(revision ae60f8613faa37cf4fa6112ca8cc43e854b4cdbd)
@@ -3,5 +3,5 @@
     C++ model classes
 """
-
+print "New style models are still under development"
 import unittest, math, numpy
 
@@ -22,5 +22,5 @@
         return self.params['scale']*x
 
-from BaseModel import BaseModel
+from sans.models.BaseModel import BaseModel,ParameterProperty
 class NewTestModel(BaseModel):
     scale = ParameterProperty('scale')
@@ -57,10 +57,18 @@
     """
     def setUp(self):
-        from sans.models.NewCylinderModel import NewCylinderModel
-        self.model = NewCylinderModel()
+        from sans.models.NewCylinderModel import CylinderModel
+        self.model = CylinderModel()
         
         
     def test_setparam(self):
-        pass
+        self.model.setParam("length", 151.0)
+        self.assertEquals(self.model.getParam("length"), 151.0)
+        
+        
+        print self.model.parameters
+        
+        print self.model(0.001)
+        self.model.setParam("length", 250.0)
+        print self.model(0.001)
         
     
