def test_one_bin_test_intervals(self): t_start = 10 t_stop = 100 intervals = [[1, 11], [12, 15], [18, 20], [40, 70], [80, 90], [95, 130]] v, a = cv.get_visits_in_bins(intervals, t_start, t_stop, 90) self.assertEqual(v, [[1, 3, 2, 30, 10, 5]])
def test_one_bin_test_intervals_starting_before_the_bin_b(self): t_start = 10 t_stop = 100 intervals = [[1, 11], [12, 15], [18, 20], [40, 70], [80, 90], [110, 130]] v, a = cv.get_visits_in_bins(intervals, t_start, t_stop, 90) self.assertEqual(a, [True])
def test_more_bin_test_intervals_starting_before_the_bin(self): t_start = 0 t_stop = 100 intervals = [[1, 11], [12, 15], [18, 20], [40, 70], [80, 90], [110, 130]] v, a = cv.get_visits_in_bins(intervals, t_start, t_stop, 10) self.assertEqual( v, [[9], [1, 3, 2], [], [], [10], [10], [10], [], [10], []])
def test_more_bin_test_intervals_only_in_the_bin_b(self): t_start = 0 t_stop = 100 intervals = [[1, 5], [12, 15], [18, 20], [40, 70], [80, 90], [110, 130]] v, a = cv.get_visits_in_bins(intervals, t_start, t_stop, 10) self.assertEqual(a, [ False, False, False, False, False, True, True, False, False, False ])
def test_one_bin_test_intervals_ending_after_the_bin_b(self): t_start = 10 t_stop = 100 intervals = [[1, 4], [12, 15], [18, 20], [40, 70], [80, 90], [95, 130]] v, a = cv.get_visits_in_bins(intervals, t_start, t_stop, 90) self.assertEqual(a, [False])