Skip to content

TST: cover Function unit conversions - #1157

Open
ting-hong-shieh wants to merge 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/test-units-coverage
Open

TST: cover Function unit conversions#1157
ting-hong-shieh wants to merge 1 commit into
RocketPy-Team:developfrom
ting-hong-shieh:codex/test-units-coverage

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Summary

Add two behavior tests for the Function branch of convert_units():

  • convert an input axis from seconds to minutes and verify the source data, axis labels, interpolation, and extrapolation metadata;
  • convert a temperature output from kelvin to degrees Celsius and verify the same returned-Function contract.

This changes tests only. It does not modify unit-conversion behavior.

Refs #709.

Revisions

  • Base: 62aa0f9be32eeccafbc1aefd6ac3d90306b257ce
  • Head: 2bd510ac7a5b93b10b8b03ca117feb75c6597380

Before and after

The same targeted test and coverage command was run at the base and head revisions.

Measurement Base Head
rocketpy/units.py statements 48 48
Covered statements 37 48
Missed statements 11 0
Coverage 77% 100%
tests/unit/test_units.py 19 passed 21 passed

Validation

$ python -m pytest tests/unit/test_units.py -q
21 passed in 0.02s

$ python -m pytest tests/unit/test_units.py -q --cov=rocketpy --cov-report=term-missing
21 passed in 1.32s
rocketpy/units.py  48  0  100%

$ python -m ruff check tests/unit/test_units.py
All checks passed!

$ python -m ruff format --check tests/unit/test_units.py
1 file already formatted

The array assertions use NumPy's assert_allclose defaults: rtol=1e-7 and atol=0.

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

Scope

The coverage comparison is limited to the targeted units test file. I did not use this focused run to claim a full non-slow-suite coverage increase.

@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 (2bd510a).
⚠️ Report is 59 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1157      +/-   ##
===========================================
+ 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 11:14
@ting-hong-shieh
ting-hong-shieh requested a review from a team as a code owner August 14, 2026 11:14
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.

1 participant