File: testTSG.py

package info (click to toggle)
tasmanian 8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,852 kB
  • sloc: cpp: 34,523; python: 7,039; f90: 5,080; makefile: 224; sh: 64; ansic: 8
file content (88 lines) | stat: -rwxr-xr-x 2,420 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python3

# The hash-bang is used only but the GNU Make build system
# The CMake build system ignores the hash-bang and uses the executable from find_package().

import unittest
import TasmanianSG
import math
import sys, os
import numpy as np
from random import uniform
from ctypes import cdll

import testCommon
import testBasicIO
import testAcceleration
import testExceptions
import testMakeUpdate
import testRefinement
import testUnstructuredData
import testMisc
import testAddons
import testDream
import testOptimization

grid = TasmanianSG.TasmanianSparseGrid()

ttc = testCommon.TestTasCommon()

# python-coverage run testTSG.py
# python-coverage html
# python-coverage report

class TestTasmanian(unittest.TestCase):
    def testBasicIO(self):
        print("\nTesting core I/O test")
        tester = testBasicIO.TestTasClass()
        tester.performIOTest()

    def testAcceleratedEvaluate(self):
        print("\nTesting accelerated evaluate consistency")
        tester = testAcceleration.TestTasClass()
        tester.performAccelerationTest()

    def testBasicException(self):
        print("\nTesting error handling")
        tester = testExceptions.TestTasClass()
        tester.performExceptionsTest()

    def testAMakeUpdate(self):
        print("\nTesting core make/update grid")
        tester = testMakeUpdate.TestTasClass()
        tester.performMakeUpdateTests()

    def testBRefinement(self):
        print("\nTesting core refine grid")
        tester = testRefinement.TestTasClass()
        tester.performRefinementTest()

    def testCUnsructuredData(self):
        print("\nTesting core learning from random samples")
        tester = testUnstructuredData.TestTasClass()
        tester.performUnstructuredDataTests()

    def testZMisc(self):
        print("\nTesting plotting and other misc")
        tester = testMisc.TestTasClass()
        tester.performMiscTests()

    def testAddons(self):
        print("\nTesting addon wrappers")
        tester = testAddons.TestTasClass()
        tester.performAddonTests()

    def testDream(self):
        print("\nTesting DREAM wrappers")
        tester = testDream.TestTasClass()
        tester.performDreamTests()

    def testOptimization(self):
        print("\nTesting Optimization Functions")
        tester = testOptimization.TestTasClass()
        tester.performOptTests()

if __name__ == '__main__':
    unittest.main()