Coverage for tests/test_integrals.py: 61%

20 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2022-08-18 19:56 +0000

1# 

2# LSST Data Management System 

3# 

4# Copyright 2008-2016 AURA/LSST. 

5# 

6# This product includes software developed by the 

7# LSST Project (http://www.lsst.org/). 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the LSST License Statement and 

20# the GNU General Public License along with this program. If not, 

21# see <https://www.lsstcorp.org/LegalNotices/>. 

22# 

23import unittest 

24import os 

25import numpy 

26 

27import lsst.utils.tests 

28import lsst.meas.modelfit 

29 

30 

31class IntegralsTestCase(lsst.utils.tests.TestCase): 

32 

33 def setUp(self): 

34 numpy.random.seed(500) 

35 

36 def testBVN(self): 

37 data = numpy.loadtxt(os.path.join(os.path.dirname(os.path.realpath(__file__)), 

38 "reference", "bvn.txt"), delimiter=',') 

39 for h, k, r, p1 in data: 

40 p2 = lsst.meas.modelfit.detail.bvnu(h, k, r) 

41 self.assertFloatsAlmostEqual(p1, p2, rtol=1E-14) 

42 

43 

44class TestMemory(lsst.utils.tests.MemoryTestCase): 

45 pass 

46 

47 

48def setup_module(module): 

49 lsst.utils.tests.init() 

50 

51 

52if __name__ == "__main__": 52 ↛ 53line 52 didn't jump to line 53, because the condition on line 52 was never true

53 lsst.utils.tests.init() 

54 unittest.main()