Skip to content

Conversation

@JaskRendix
Copy link
Contributor

PR improves the OrbitElements class by adding several new methods and properties to make it more functional and easier to use. It also introduces a full pytest test suite to verify the correctness of the class (before and after) and its behavior under different conditions.

The changes include:

  • new properties: apogee, is_circular, and is_retrograde
  • new methods: position_vector(), velocity_at_perigee(), velocity_at_apogee() and to_tle_dict()
  • a set of unit tests using pytest to cover both the original and new functionality

These additions were made as part of a satellite tracking project where I needed access to derived orbital parameters and a reliable way to validate them. The test suite ensures the class behaves correctly and can be extended in future work.

  • Tests added
  • Fully documented

@JaskRendix JaskRendix force-pushed the orbit-elements branch 4 times, most recently from 6422ebc to a5a2791 Compare September 30, 2025 16:10
Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks pretty good. I have one important question and one small request.

@djhoese djhoese requested review from mraspaud and pnuu September 30, 2025 16:18
@JaskRendix JaskRendix force-pushed the orbit-elements branch 4 times, most recently from cdef8d4 to 51fa3ac Compare October 1, 2025 10:02
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 99.53917% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.43%. Comparing base (c9e2909) to head (b10cfeb).
⚠️ Report is 50 commits behind head on main.

Files with missing lines Patch % Lines
pyorbital/tlefile.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
+ Coverage   89.78%   90.43%   +0.65%     
==========================================
  Files          17       18       +1     
  Lines        2809     3011     +202     
==========================================
+ Hits         2522     2723     +201     
- Misses        287      288       +1     
Flag Coverage Δ
unittests 90.43% <99.53%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@coveralls
Copy link

coveralls commented Oct 2, 2025

Coverage Status

coverage: 90.396% (+0.7%) from 89.742%
when pulling b10cfeb on JaskRendix:orbit-elements
into ce9856a on pytroll:main.

@djhoese
Copy link
Member

djhoese commented Oct 2, 2025

👀 oh I like the 0.8% increase in test coverage. Nice.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more requests for the test code. Thanks again for working on this.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is running at I type this so if they fail you may need to give some of the equality checks a little less precision. Otherwise, looks good to me! Thanks.

@mraspaud @adybbroe @pnuu any other opinions? I definitely shouldn't be the primary voice of approval/reason here.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the new features and the bug fix!

I've added one refactoring suggestion, but I'm not sure it really helps the code 😅

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution! I'm really grateful for the nice cleanups and refactors along with a bug fix on top of the added functionality.
I have a minor improvement suggestion inline, but this looks ready otherwise I think.

JaskRendix and others added 2 commits October 3, 2025 13:24
@JaskRendix JaskRendix force-pushed the orbit-elements branch 3 times, most recently from 827f749 to ee88a15 Compare October 3, 2025 19:26
@JaskRendix JaskRendix force-pushed the orbit-elements branch 2 times, most recently from 3f89c57 to e19dfc1 Compare October 7, 2025 07:24
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot for taking the time to improve pyorbital!

@mraspaud mraspaud merged commit b64197b into pytroll:main Oct 7, 2025
16 checks passed
@JaskRendix JaskRendix deleted the orbit-elements branch October 7, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants