Skip to content

TST: cover attitude conversion helpers - #1159

Merged
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/test-tools-attitude-coverage
Aug 15, 2026
Merged

TST: cover attitude conversion helpers#1159
Gui-FernandesBR merged 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/test-tools-attitude-coverage

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Summary

  • add direct coverage for quaternion-to-precession, nutation, and spin conversions using array inputs, matching how Flight evaluates recorded quaternion data
  • cover normalization for both scaled and zero-magnitude quaternions
  • leave production code unchanged

This is one focused coverage slice for #709.

Before and after

Merge base Head
Full SHA 1d04bcc3b6339bc16f3daf34195943cf9a73f2fa cb11b9e280fe4dc374df0cd46f8090c4a8706c63
tests/unit/test_tools.py 28 passed 30 passed
rocketpy/tools.py coverage 48% (149/313 statements) 50% (157/313 statements)
Missed statements 164 156

Both measurements used:

python -m coverage erase
python -m coverage run --source=rocketpy -m pytest tests/unit/test_tools.py -q
python -m coverage report -m rocketpy/tools.py

The angle and normalization assertions use pytest.approx defaults (rel=1e-6, abs=1e-12). The five existing weather-data warnings were unchanged between the base and head runs.

Validation

python -m coverage run --source=rocketpy -m pytest tests/unit/test_tools.py -q
# 30 passed, 5 warnings

python -m ruff check tests/unit/test_tools.py
# All checks passed!

python -m ruff format --check tests/unit/test_tools.py
# 1 file already formatted

Environment

  • Python 3.12.6
  • RocketPy 1.13.0
  • NumPy 2.5.2
  • SciPy 1.18.0
  • pytest 9.1.1
  • macOS 26.5.2 (arm64)

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.51%. Comparing base (e0ff281) to head (cb11b9e).
⚠️ Report is 61 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1159      +/-   ##
===========================================
+ Coverage    82.18%   83.51%   +1.33%     
===========================================
  Files          122      130       +8     
  Lines        16355    17082     +727     
===========================================
+ Hits         13441    14266     +825     
+ Misses        2914     2816      -98     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ting-hong-shieh
ting-hong-shieh marked this pull request as ready for review August 14, 2026 16:16
@ting-hong-shieh
ting-hong-shieh requested a review from a team as a code owner August 14, 2026 16:16
@Gui-FernandesBR Gui-FernandesBR linked an issue Aug 15, 2026 that may be closed by this pull request
@Gui-FernandesBR
Gui-FernandesBR merged commit f8b6a5e into RocketPy-Team:develop Aug 15, 2026
17 checks passed
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.

TST: Increase code coverage to 90%

2 participants