Coverage for tests/test_quadApprox.py: 58%
15 statements
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-11 00:57 -0700
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-11 00:57 -0700
1import unittest
3import numpy as np
4from numpy.testing import assert_allclose
6import astshim as ast
7from astshim.test import MappingTestCase
10class TestQuadApprox(MappingTestCase):
12 def test_QuadApprox(self):
13 # simple parabola
14 coeff_f = np.array([
15 [0.5, 1, 2, 0],
16 [0.5, 1, 0, 2],
17 ], dtype=float)
18 polymap = ast.PolyMap(coeff_f, 1)
19 qa = ast.QuadApprox(polymap, [-1, -1], [1, 1], 3, 3)
20 self.assertAlmostEqual(qa.rms, 0)
21 self.assertEqual(len(qa.fit), 6)
22 assert_allclose(qa.fit, [0, 0, 0, 0, 0.5, 0.5])
25if __name__ == "__main__": 25 ↛ 26line 25 didn't jump to line 26, because the condition on line 25 was never true
26 unittest.main()