-
Notifications
You must be signed in to change notification settings - Fork 429
/
__init__.py
36 lines (28 loc) · 931 Bytes
/
__init__.py
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
from __future__ import print_function
from .sampler import *
from .mh import *
from .ensemble import *
from . import utils
__version__ = "1.1.2"
def test():
from .tests import Tests
test_names = [
("Parallel Sampler", "test_parallel"),
("Ensemble Sampler", "test_ensemble"),
("Metropolis-Hastings", "test_mh"),
]
print("Starting tests...")
failures = 0
tests = Tests()
for t in test_names:
tests.setUp()
try:
getattr(tests, t[1])()
except Exception as e:
print("Test: {0} failed with error:".format(t[0]))
print("\t{0}: {1}".format(e.__class__.__name__, e))
failures += 1
else:
print("Test: {0} passed.".format(t[0]))
print("{0} tests passed".format(len(test_names) - failures))
print("{0} tests failed".format(failures))