Coverage for tests/test_unitMap.py: 41%
20 statements
« prev ^ index » next coverage.py v7.5.3, created at 2024-06-13 02:50 -0700
« prev ^ index » next coverage.py v7.5.3, created at 2024-06-13 02:50 -0700
1import unittest
3import numpy as np
4from numpy.testing import assert_allclose
6import astshim as ast
7from astshim.test import MappingTestCase
10class TestUnitMap(MappingTestCase):
12 def test_UnitMapBasics(self):
13 unitmap = ast.UnitMap(3)
14 self.assertEqual(unitmap.className, "UnitMap")
15 self.assertEqual(unitmap.nIn, 3)
16 self.assertEqual(unitmap.nOut, 3)
18 self.checkBasicSimplify(unitmap)
19 self.checkCopy(unitmap)
21 indata = np.array([
22 [1.1, 2.2, 3.3, 4.4],
23 [-43.5, 1309.31, 0.005, -36.5],
24 [0.0, -2.3, 44.4, 3.14],
25 ])
26 outdata = unitmap.applyForward(indata)
27 assert_allclose(outdata, indata)
28 self.checkRoundTrip(unitmap, indata)
29 self.checkMappingPersistence(unitmap, indata)
32if __name__ == "__main__": 32 ↛ 33line 32 didn't jump to line 33, because the condition on line 32 was never true
33 unittest.main()