Exemple #1
0
 def test_unique(self):
     self.assertEqual(calc_overlap(10, 0.5, None, None, True), 0)
Exemple #2
0
 def test_order(self):
     self.assertEqual(calc_overlap(10, 0.5, 11, 0.4, False),
                      calc_overlap(11, 0.4, 10, 0.5, False))
Exemple #3
0
 def test_far(self):
     self.assertEqual(calc_overlap(0, 0.5, 1000, 0.5, False), 0)
     self.assertEqual(calc_overlap(10, 0.0001, 20, 0.0001, False), 0)
Exemple #4
0
 def test_exact(self):
     self.assertEqual(calc_overlap(5, 1, 10, 1, False),
                      NormalDist(10, 1).cdf(7.5) * 2)
     self.assertEqual(calc_overlap(5, 0.25, 5.1, 0.2, False),
                      NormalDist(5, 0.25).overlap(NormalDist(5.1, 0.2)))
Exemple #5
0
 def test_same(self):
     self.assertEqual(calc_overlap(10, 0.5, 10, 0.5, False), 1)