Coverage for tests/test_zoomMap.py: 35%
23 statements
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-15 09:29 +0000
« prev ^ index » next coverage.py v6.4.4, created at 2022-09-15 09:29 +0000
1import unittest
3import numpy as np
4from numpy.testing import assert_allclose
6import astshim as ast
7from astshim.test import MappingTestCase
10class TestZoomMap(MappingTestCase):
12 def test_basics(self):
13 """Test basics of ZoomMap including applyForward
14 """
15 for nin in (1, 2, 3):
16 for zoom in (1.0, -1.1, 359.3):
17 zoommap = ast.ZoomMap(nin, zoom)
18 self.assertEqual(zoommap.className, "ZoomMap")
19 self.assertEqual(zoommap.nIn, nin)
20 self.assertEqual(zoommap.nOut, nin)
21 self.assertTrue(zoommap.isLinear)
23 self.checkBasicSimplify(zoommap)
24 self.checkCopy(zoommap)
26 indata = np.array([
27 [1.0, 2.0, -6.0, 30.0, 1.0],
28 [3.0, 99.0, -5.0, 21.0, 0.0],
29 [-5.0, 3.0, -7.0, 37.0, 0.0],
30 [7.0, -23.0, -3.0, 45.0, 0.0],
31 ], dtype=float)[0:nin]
32 self.checkRoundTrip(zoommap, indata)
33 self.checkMappingPersistence(zoommap, indata)
35 topos = zoommap.applyForward(indata)
36 assert_allclose(indata * zoom, topos)
39if __name__ == "__main__": 39 ↛ 40line 39 didn't jump to line 40, because the condition on line 39 was never true
40 unittest.main()