コード例 #1
0
    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)
コード例 #2
0
ファイル: test_listeners.py プロジェクト: wct1998/linkpred
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)
コード例 #3
0
ファイル: test_listeners.py プロジェクト: TythonLee/linkpred
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)