gazebosim / gz-mujoco

25 stars 4 forks source link

Refactor pose and frame resolution helpers. #30

Closed azeey closed 2 years ago

azeey commented 2 years ago

🎉 New feature

Summary

This adds GraphResolver which creates a more convenient interface for resolving poses and frames in a way that can be overridden by tests. A global instance graph_resolver is used by all functions so that we don't have to pass pose_resolver, axis_resolver and frame_resolver (in upcoming PRs) to all the add_* converter functions.

This also adds helpers.TestCase which sets up the test version of the graph resolver when tests start and resets it back to the regular/default graph resolver when the tests are done.

Test it

Existing unittests should cover this.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

codecov[bot] commented 2 years ago

Codecov Report

Merging #30 (7fcca3a) into main (28f4254) will decrease coverage by 0.17%. The diff coverage is 92.85%.

:exclamation: Current head 7fcca3a differs from pull request most recent head 573e9f4. Consider uploading reports for the commit 573e9f4 to get more accurate results

@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   94.61%   94.44%   -0.18%     
==========================================
  Files           8        8              
  Lines         223      234      +11     
==========================================
+ Hits          211      221      +10     
- Misses         12       13       +1     
Impacted Files Coverage Δ
sdformat_mjcf/sdformat_mjcf/sdf_utils.py 88.88% <88.00%> (+0.88%) :arrow_up:
sdformat_mjcf/sdformat_mjcf/converters/geometry.py 92.30% <100.00%> (ø)
sdformat_mjcf/sdformat_mjcf/converters/joint.py 96.92% <100.00%> (ø)
sdformat_mjcf/sdformat_mjcf/converters/light.py 100.00% <100.00%> (ø)
sdformat_mjcf/sdformat_mjcf/converters/link.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4c7ba9d...573e9f4. Read the comment docs.

azeey commented 2 years ago

Codecov is reporting a decrease because the original code, which wasn't covered, is now being modified. I think it's okay to override in this case.