Skip to content

Commit

Permalink
changed to np.testing.assert_allclose(a, b)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter230655 committed Jan 21, 2025
1 parent 29eaa2c commit 1516536
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions opty/tests/test_direct_collocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,9 +1647,9 @@ def obj_grad(free):
len(state_symbols), len(control_symbols), num_nodes)

states, controls, constants = prob.parse_free(initial_guess)
assert(np.allclose(states, statesu))
assert(np.allclose(controls, controlsu))
assert(np.allclose(constants, constantsu))
np.testing.assert_allclose(states, statesu)
np.testing.assert_allclose(controls, controlsu)
np.testing.assert_allclose(constants, constantsu)

# test with variable interval_value
interval_value = h
Expand Down Expand Up @@ -1683,7 +1683,7 @@ def obj_grad(free):
num_nodes, variable_duration=True)

states, controls, constants, times = prob.parse_free(initial_guess)
assert(np.allclose(states, statesu))
assert(np.allclose(controls, controlsu))
assert(np.allclose(constants, constantsu))
assert(np.allclose(timeu, times))
np.testing.assert_allclose(states, statesu)
np.testing.assert_allclose(controls, controlsu)
np.testing.assert_allclose(constants, constantsu)
np.testing.assert_allclose(timeu, times)

0 comments on commit 1516536

Please sign in to comment.