Repository navigation
Compare simulation data across all integrators - #122
Mikasa0503 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Extend finiteness checks to cover the omitted state tensors.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds parameterized smoke tests covering all supported simulation integrators.
Changes:
- Tests two simulation steps for each integrator.
- Verifies step advancement and finite state tensors.
| File | Summary |
|---|---|
tests/unit/test_sim.py |
Adds integrator smoke tests; force, torque, and rotor_vel are not included in finiteness checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
75e533c to
b83310f
Compare
|
Hi, sorry for the long wait, and thanks for contributing! test_sim.py is already extremely overloaded, and I think this is a great opportunity to split things up. Could you add this test in a new crazyflow/tests/unit/test_sim.py Lines 151 to 158 in d28ec70 |
amacati
left a comment
There was a problem hiding this comment.
See my feedback in the comment above
|
Hi Hugo, #134 has been merged, so you should be able to pull, rebase off of main, and then we can merge this. By the way, what is your use-case for testing the integrators? Are you working on drone research and want to use the semi-implicit Euler integrator? |
|
(Btw, this was closed automatically because the integration fix was merged. Just rebase and reopen) |
|
Yes, I’m doing drone research and wanted to get more familiar with crazyflow by contributing tests. |

Summary
Add
tests/unit/test_integrators.pyand compare the completesim.datapytree for every supported integrator against a separately stepped default-integratorSimafter two simulation steps. Require matching tree structures, compare floating-point arrays withrtol=0.02andatol=1e-4, and use strict comparisons for array shapes/dtypes and non-floating arrays. Compare PRNG key data exactly.Rebased onto
mainat62a3146a408c5fd5d0c2451de22e29bd74a71b18, which includes the merged #134 fix. The review diff contains only the new test file.Validation
On macOS arm64 / CPU:
pixi run --locked -e tests python -m pytest -q tests/unit/test_integrators.py: 3 passed.MPLBACKEND=Agg pixi run --locked -e tests tests: 746 passed, 50 skipped, 12 deselected, 6 warnings. Rendering exclusions follow the project configuration.pixi run --locked -e tests ruff check: passed.pixi run --locked -e tests ruff format --check --diff: 153 files already formatted.git diff --check: passed.Addresses #106.