def test_to_file_from_file(self): data = np.array([[1, 0, 0, 1], [1, 1, 0, 0]]) sheet = EvaluationSheet(data) with temp_file() as fname: sheet.to_file(fname) newsheet = EvaluationSheet.from_file(fname) assert_array_equal(sheet.data, newsheet.data)
def test_CacheEvaluationListener(): l = CacheEvaluationListener() scores = BaseScoresheet({1: 10, 2: 5}) ev = EvaluationSheet(scores, {1}) smokesignal.emit("evaluation_finished", ev, "d", "p") ev2 = EvaluationSheet.from_file(l.fname) assert_array_equal(ev.data, ev2.data) smokesignal.clear_all() os.unlink(l.fname)
def test_CacheEvaluationListener(): l = CacheEvaluationListener() scores = BaseScoresheet({1: 10, 2: 5}) ev = EvaluationSheet(scores, {1}) smokesignal.emit('evaluation_finished', ev, 'd', 'p') ev2 = EvaluationSheet.from_file(l.fname) assert_array_equal(ev.data, ev2.data) smokesignal.clear_all() os.unlink(l.fname)