import unittest
import numpy
import dadi

class ProjectionTestCase(unittest.TestCase):
    def test_project_up(self):
        """
        Saving spectrum to file.
        """
        fixed_params = [0.1,None,None]
        params_up = dadi.Inference._project_params_up([0.2,0.3], fixed_params)
        self.assertTrue(numpy.allclose(params_up, [0.1,0.2,0.3]))

        fixed_params = [0.1,0.2,None]
        params_up = dadi.Inference._project_params_up([0.3], fixed_params)
        self.assertTrue(numpy.allclose(params_up, [0.1,0.2,0.3]))

        fixed_params = [0.1,0.2,None]
        params_up = dadi.Inference._project_params_up(0.3, fixed_params)
        self.assertTrue(numpy.allclose(params_up, [0.1,0.2,0.3]))

suite = unittest.TestLoader().loadTestsFromTestCase(ProjectionTestCase)
unittest.main()

Add test for projecting parameters upward.
Add test for projecting parameters upward.



git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@489 979d6bd5-6d4d-0410-bece-f567c23bd345
