-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Problem
When trying to write a test for getBounds and getBounds2 they both return [-inf, inf] even when they are bounded,
def test_getBounds():
recipe = FitRecipe("recipe")
recipe.create_new_variable("var1", 1)
recipe.restrain("var1", lb=-1, ub=1)
actual_bounds = recipe.getBounds()
expected_bounds = [(-1, 1)]
assert actual_bounds == expected_bounds
def test_getBounds2():
recipe = FitRecipe("recipe")
recipe.create_new_variable("var1", 1)
recipe.create_new_variable("var2", 2)
recipe.restrain("var1", lb=0, ub=5)
recipe.restrain("var2", lb=-1, ub=3)
actual_lower_bounds, actual_upper_bounds = recipe.getBounds2()
expected_lower_bounds = [0, -1]
expected_upper_bounds = [5, 3]
assert list(actual_lower_bounds) == expected_lower_bounds
assert list(actual_upper_bounds) == expected_upper_bounds
FAILED tests/test_fitrecipe.py::test_getBounds - assert [[-inf, inf]] == [(-1, 1)]
FAILED tests/test_fitrecipe.py::test_getBounds2 - assert [np.float64(-...float64(-inf)] == [0, -1]
Proposed solution
- Implement the above two tests and fix the code to get it passing.
- These functions are going to be deprecated so make sure we are testing both the new and deprecated ones
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels