mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-30 17:40:45 +00:00
adapt answer format to numbering in board output display
This commit is contained in:
parent
18a9f3343e
commit
6883a5b8c6
2 changed files with 12 additions and 9 deletions
|
|
@ -100,7 +100,10 @@ def test_liberties_and_move():
|
|||
def test_score_answer():
|
||||
config = TsumegoConfig(min_board_size=9, max_board_size=9, max_stones=10, size=5)
|
||||
dataset = TsumegoDataset(config)
|
||||
entry = {"metadata": {"board_size": 9, "solution": (4, 4)}}
|
||||
|
||||
# prepare dummy
|
||||
entry = dataset[0].copy()
|
||||
entry["metadata"]["solution"] = (4, 4)
|
||||
|
||||
# Correct letter-number answer (E corresponds to 5)
|
||||
assert dataset.score_answer("E5", entry) == 1.0
|
||||
|
|
@ -120,7 +123,9 @@ def test_score_answer():
|
|||
# Out-of-bound letter-number move: 'J' corresponds to 10 which is greater than board size = 9
|
||||
assert dataset.score_answer("J9", entry) == 0.01
|
||||
|
||||
# test optimal score for answers
|
||||
for x in dataset:
|
||||
assert len(x["metadata"]["board"]) == x["metadata"]["difficulty"]["board_size"]
|
||||
assert dataset.score_answer(x["answer"], entry=x) == 1.0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue