From 6a96c4f15a36aef0ca5bbc3d2c91a58c9d041683 Mon Sep 17 00:00:00 2001 From: Andreas Koepf Date: Fri, 24 Jan 2025 19:15:27 +0100 Subject: [PATCH] fix: Increase max attempts and improve operator validation in simple equations --- reasoning_gym/algebra/simple_equations.py | 2 +- tests/test_simple_equations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reasoning_gym/algebra/simple_equations.py b/reasoning_gym/algebra/simple_equations.py index 5fe9d088..f6c27256 100644 --- a/reasoning_gym/algebra/simple_equations.py +++ b/reasoning_gym/algebra/simple_equations.py @@ -81,7 +81,7 @@ class SimpleEquationsDataset(ProceduralDataset): Returns: Tuple of (equation string, solution integer) """ - max_attempts = 100 # Prevent infinite loops + max_attempts = 1000 # Prevent infinite loops for _ in range(max_attempts): x = Symbol(variable) diff --git a/tests/test_simple_equations.py b/tests/test_simple_equations.py index 93a89f88..d4ba8740 100644 --- a/tests/test_simple_equations.py +++ b/tests/test_simple_equations.py @@ -133,4 +133,4 @@ def test_simple_equations_operators(): # Verify only allowed operators are used for op in "+-*": if op in equation: - assert op in operators + assert op in operators, str(equation)