Skip to content

Commit 3a662fe

Browse files
committed
Fixed exponential test failing
1 parent 827b485 commit 3a662fe

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/shard3/test_passive_torque.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
394394
pytest.skip("These tests do not pass on Windows.")
395395

396396
if with_passive_torque:
397-
model_filename = "/examples/getting_started/models/pendulum_with_passive_torque.bioMod"
397+
model_filename = "/examples/torque_driven_ocp/models/pendulum_with_passive_torque.bioMod"
398398
else:
399399
model_filename = "/examples/getting_started/models/pendulum.bioMod"
400400

@@ -420,6 +420,9 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
420420
controls = sol.decision_controls(to_merge=SolutionMerge.NODES)
421421
q, qdot, tau = states["q"], states["qdot"], controls["tau"]
422422

423+
# Check if the solution converged
424+
assert sol.status == 0
425+
423426
if with_passive_torque:
424427
# initial and final position
425428
npt.assert_almost_equal(q[:, 0], np.array([0.0, 0.0]))
@@ -430,12 +433,12 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
430433
# initial and final controls
431434
npt.assert_almost_equal(
432435
tau[:, 0],
433-
np.array([97.717082, 0.0]),
436+
np.array([6.1617263058229215, 0.0]),
434437
decimal=6,
435438
)
436439
npt.assert_almost_equal(
437440
tau[:, -1],
438-
np.array([-37.470441, 0.0]),
441+
np.array([-11.820810710498906, 0.0]),
439442
decimal=6,
440443
)
441444

tests/shard6/test_vector_layout.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ def test_vector_layout_multiple_phases():
530530

531531
assert (
532532
output == expected_output
533-
), f"The output does not match what was expected.\nExpected:{
534-
expected_output
535-
}\nGot: {output}"
533+
), f"The output does not match what was expected.\nExpected:{expected_output}\nGot: {output}"
536534

537535
v_bounds = OptimizationVectorHelper.bounds_vectors(ocp)
538536

0 commit comments

Comments
 (0)