Package test_suite :: Package unit_tests :: Package _target_functions :: Module test_chi2 :: Class Test_chi2
[hide private]
[frames] | no frames]

Class Test_chi2

source code


Unit tests for the target_functions.chi2 relax module.

Nested Classes [hide private]

Inherited from unittest.case.TestCase: failureException

Instance Methods [hide private]
 
setUp(self)
Create a number of objects for the calculation and testing of the chi-squared equations.
source code
 
tearDown(self)
Delete all the data structures.
source code
 
test_chi2(self)
Unit test for the value returned by the chi2 function.
source code
 
test_dchi2(self)
Unit test for the chi-squared gradient created by the dchi2 function.
source code
 
test_dchi2_element(self)
Unit test for the chi-squared gradient created by the dchi2_element function.
source code
 
test_d2chi2(self)
Unit test for the chi-squared Hessian created by the d2chi2 function.
source code
 
test_d2chi2_element(self)
Unit test for the chi-squared Hessian created by the d2chi2_element function.
source code

Inherited from unittest.case.TestCase: __call__, __eq__, __hash__, __init__, __ne__, __repr__, __str__, addCleanup, addTypeEqualityFunc, assertAlmostEqual, assertAlmostEquals, assertDictContainsSubset, assertDictEqual, assertEqual, assertEquals, assertFalse, assertGreater, assertGreaterEqual, assertIn, assertIs, assertIsInstance, assertIsNone, assertIsNot, assertIsNotNone, assertItemsEqual, assertLess, assertLessEqual, assertListEqual, assertMultiLineEqual, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertNotIn, assertNotIsInstance, assertNotRegexpMatches, assertRaises, assertRaisesRegexp, assertRegexpMatches, assertSequenceEqual, assertSetEqual, assertTrue, assertTupleEqual, assert_, countTestCases, debug, defaultTestResult, doCleanups, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription, skipTest

Inherited from unittest.case.TestCase (private): _addSkip, _baseAssertEqual, _deprecate, _formatMessage, _getAssertEqualityFunc, _truncateMessage

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from unittest.case.TestCase: setUpClass, tearDownClass

Class Variables [hide private]

Inherited from unittest.case.TestCase: longMessage, maxDiff

Inherited from unittest.case.TestCase (private): _classSetupFailed, _diffThreshold

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setUp(self)

source code 

Create a number of objects for the calculation and testing of the chi-squared equations.

Overrides: unittest.case.TestCase.setUp

tearDown(self)

source code 

Delete all the data structures.

Overrides: unittest.case.TestCase.tearDown

test_chi2(self)

source code 

Unit test for the value returned by the chi2 function.

The chi-squared value is 2.5 for the following data:

   data =      | 1.0  1.5  2.0  2.5  3.0 |,

   back_calc = | 0.9  1.45 2.0  2.55 3.1 |,

   errors =    | 0.1  0.1  0.1  0.1  0.1 |.

test_dchi2(self)

source code 

Unit test for the chi-squared gradient created by the dchi2 function.

The chi-squared gradient is [0, 10] for the following data:

   data =              |  1.0  1.5  2.0  2.5  3.0 |,

   back_calc =         |  0.9  1.45 2.0  2.55 3.1 |,

   back_calc_grad =    |  0.1  0.2  0.3  0.2  0.1 |
                       | -0.2 -0.1  0.0  0.1  0.2 |,

   errors =            |  0.1  0.1  0.1  0.1  0.1 |.

test_dchi2_element(self)

source code 

Unit test for the chi-squared gradient created by the dchi2_element function.

The chi-squared gradient is [0, 10] for the following data:

   data =              |  1.0  1.5  2.0  2.5  3.0 |,

   back_calc =         |  0.9  1.45 2.0  2.55 3.1 |,

   back_calc_grad =    |  0.1  0.2  0.3  0.2  0.1 |
                       | -0.2 -0.1  0.0  0.1  0.2 |,

   errors =            |  0.1  0.1  0.1  0.1  0.1 |.

test_d2chi2(self)

source code 

Unit test for the chi-squared Hessian created by the d2chi2 function.

For the data:

   data =              | 1.0    1.5    2.0    2.5    3.0   |,

   back_calc =         | 0.9    1.45   2.0    2.55   3.1   |,

   back_calc_grad =    | 0.1    0.2    0.3    0.2    0.1   |
                       |-0.2   -0.1    0.0    0.1    0.2   |,

   back_calc_hess[0] = | 0.01   0.005  0.0    0.005  0.01  |
                       | 0.05   0.01   0.0    0.01   0.05  |,

   back_calc_hess[1] = | 0.001  0.0005 0.0    0.0005 0.001 |
                       | 0.005  0.001  0.0    0.001  0.005 |,

   errors =            | 0.1    0.1    0.1    0.1    0.1   |,

the chi-squared hessian is:

   Hessian = | 38.0   0.0 |
             |  0.0  20.0 |.

test_d2chi2_element(self)

source code 

Unit test for the chi-squared Hessian created by the d2chi2_element function.

For the data:

   data =              | 1.0    1.5    2.0    2.5    3.0   |,

   back_calc =         | 0.9    1.45   2.0    2.55   3.1   |,

   back_calc_grad =    | 0.1    0.2    0.3    0.2    0.1   |
                       |-0.2   -0.1    0.0    0.1    0.2   |,

   back_calc_hess[0] = | 0.01   0.005  0.0    0.005  0.01  |
                       | 0.05   0.01   0.0    0.01   0.05  |,

   back_calc_hess[1] = | 0.001  0.0005 0.0    0.0005 0.001 |
                       | 0.005  0.001  0.0    0.001  0.005 |,

   errors =            | 0.1    0.1    0.1    0.1    0.1   |,

the chi-squared hessian is:

   Hessian = | 38.0   0.0 |
             |  0.0  20.0 |.