def test_PT_no_valid(self): np.random.seed(100) d = discrete.probThresh(task_responses=[0, 1, 2, 3], eta=0.8) correct_result = (None, collections.OrderedDict([(0, 0.2), (1, 0.8), (2, 0.3), (3, 0.5)])) result = d([0.2, 0.8, 0.3, 0.5], trial_responses=[]) assert result == correct_result
def test_PT_err(self): np.random.seed(100) d = discrete.probThresh(["A", "B", "C"]) correct_result = ('A', collections.OrderedDict([('A', 0.2), ('B', 0.3), ('C', 0.8)])) result = d([0.2, 0.3, 0.8], trial_responses=["A", "D"]) assert result == correct_result
def test_PT_normal_3(self): np.random.seed(101) d = discrete.probThresh(task_responses=[0, 1, 2, 3], eta=0.8) correct_result = (3, collections.OrderedDict([(0, 0.2), (1, 0.5), (2, 0.3), (3, 0.5)])) result = d([0.2, 0.5, 0.3, 0.5]) assert result == correct_result