updated algorithmics dataset (#269)

* updated algorithmic datasets
* added changes to symbolic and power
* updated power function test
This commit is contained in:
joesharratt1229 2025-03-05 23:32:53 +01:00 committed by GitHub
parent f426db90ec
commit d9638df79c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 57 additions and 29 deletions

View file

@ -59,20 +59,6 @@ def test_power_function_score_function():
config = PowerFunctionConfig(seed=42)
dataset = PowerFunctionDataset(config)
item = dataset[0]
# Answer is within 1e-6 of solution
answer = str(item["metadata"]["solution"] - 1e-7)
assert dataset.score_answer(answer, item) == 1.0
# Answer is within 1e-1 of solution
answer = str(item["metadata"]["solution"] - 1e-2)
assert dataset.score_answer(answer, item) == 0.5
# Answer is far from solution
answer = str(item["metadata"]["solution"] - 1)
assert dataset.score_answer(answer, item) == 0.0
# Answer is None
answer = None
assert dataset.score_answer(answer, item) == 0.0
for item in dataset:
answer = item["answer"]
assert dataset.score_answer(answer, item) == 1.0