Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prediction refactoring #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions compare_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# @Author: jsgounot
# @Date: 2022-01-05 10:54:42
# @Last Modified by: jsgounot
# @Last Modified time: 2022-01-05 10:54:51

import sys

f1, f2 = sys.argv[1], sys.argv[2]

def load_result(fname):
r = {}
with open(fname) as f:
for idx, line in enumerate(f):
if idx == 0:
continue

line = line.strip().split()
name, res = line[0], tuple(line[1:])
r[name] = res

return r

r1 = load_result(f1)
r2 = load_result(f2)

# assert we have the same set of names
assert set(r1) == set(r2)

# assert we have the same results
for k1, v1 in r1.items():
assert v1 == r2[k1]

print ('Same results')
Loading