Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tropter test cases and make sure all tests pass with casadi #3988

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

aymanhab
Copy link
Member

@aymanhab aymanhab commented Jan 13, 2025

Fixes issue #<issue_number>

Brief summary of changes

Testing I've completed

Looking for feedback on...

CHANGELOG.md (choose one)

  • updated.

This change is Reviewable

@nickbianco
Copy link
Member

Hey @aymanhab, I just noticed you started working on this. I think I misunderstood your message from last week; I was under the impression that you were going to disable the test suite for tropter when building the conda packages, and not remove them directly here. I was hoping to address all the tropter changes at once (i.e., remove the tropter libraries and the tests together). I'm a bit hesitant to gut out the tests while the tropter solver still exists as an option.

Is there a way to build the conda packages without tropter for now (i.e., by setting the OPENSIM_WITH_TROPTER flag)?

@aymanhab
Copy link
Member Author

No problem @nickbianco I actually have a conda package without tropter using the cmake option already (https://anaconda.org/opensim_admin/opensim/files)
I removed the tests from the tree on a branch to make sure there're no side effects on MocoTests since that's the most entangled piece, and I started removing the actual cmake flags. I agree they should all go together (tests and code removal). You can take the branch over if you want.

@aymanhab
Copy link
Member Author

@nickbianco I went ahead and removed references to tropter from the build system and ci, and the last remaining piece is that some python tests in test_moco.py are failing because they were using tropter without checking if available

self.assertAlmostEqual(sol.getParameter("sphere_mass") + sol.getParameter("sphere2_mass"),

When you have a chance let me know if I should remove some/all of these tests that use tropter or convert to casadi

Thank you

@nickbianco
Copy link
Member

@aymanhab it would be best to keep those tests and convert them all to use MocoCasADiSolver. All usages of initTropterSolver can be replaced with initCasADiSolver.

Were you planning on removing the tropter libraries as part of this PR too?

@aymanhab
Copy link
Member Author

@nickbianco My plan was to make the build/install/test all work first and removed from the make system on this branch and then remove the folders (in case something comes up that force a backtrack) but it can go in any order. Do you expect any results to change when swapping the solvers?

@nickbianco
Copy link
Member

That sounds like a good plan. Theoretically, the tests should pass with either solver, but it's possible that differences in each implementation could lead to different numerical results. I'm happy to debug any such cases that arise.

We will also need to eventually remove Tropter from all of the tests under the Moco test folder.

@aymanhab
Copy link
Member Author

@nickbianco I'll pass this on to you to do the internal cleanup of the Moco tests. The python test cases pass on linux but not on windows or osx though the failures are for reasons unrelated to this PR as far as I can tell. Just let me know if you want me to investigate these failures. Thank you.

@nickbianco
Copy link
Member

Sure @aymanhab. I'll pick this up starting next week.

@aymanhab
Copy link
Member Author

Thanks @nickbianco 👍
Something to keep in mind when looking into test failures, the moco python tests with casadi all succeed when run from dev/build environment directly but fail when run from install environments on windows/mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants