Skip to content

[#144] Correct noncircular orbit generation#277

Merged
Mark2000 merged 1 commit into
developfrom
feature/noncircular-orbits
Jun 12, 2025
Merged

[#144] Correct noncircular orbit generation#277
Mark2000 merged 1 commit into
developfrom
feature/noncircular-orbits

Conversation

@Mark2000

@Mark2000 Mark2000 commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

Description

Separate :class:random_circular_orbit and :class:random_orbit to avoid misleading
altitude argument.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

Updated tests.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copilot AI review requested due to automatic review settings June 12, 2025 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR separates the generation of circular orbits from noncircular ones to avoid confusion around the altitude argument and introduces the new function random_circular_orbit.

  • Added tests for random_circular_orbit and updated tests to use the new parameter a instead of alt.
  • Updated the random_orbit API in src/bsk_rl/utils/orbital.py to handle the deprecated alt and r_body parameters.
  • Updated documentation and release notes accordingly.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unittest/utils/test_orbital.py Added and updated tests to include random_circular_orbit.
tests/integration/obs/test_int_relative_observations.py Updated random_orbit calls to use parameter a instead of alt.
tests/integration/obs/test_int_observations.py Updated random_orbit call to use new API parameter naming.
tests/integration/act/test_int_actions_discrete.py Updated random_orbit call to use parameter a instead of alt.
src/bsk_rl/utils/orbital.py Modified API and implementation for separating orbit types.
docs/source/release_notes.rst Updated release notes to reflect the new orbit generation API.

@Mark2000
Mark2000 force-pushed the feature/noncircular-orbits branch from 48480b7 to ac953a0 Compare June 12, 2025 00:48

@dhutererprats dhutererprats left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make r_body optional argument, so one can create a random orbit with just setting altitude

Comment thread src/bsk_rl/utils/orbital.py
@dhutererprats

Copy link
Copy Markdown
Contributor

Also, I am seeing that we don't treat Omega and omega any differently in the random_orbit function when inclination is exactly i=0.0. Shouldn't we have some sort of reference, usually vernal equinox or so, to define the orbital elements of such an equatorial orbit?

@Mark2000

Copy link
Copy Markdown
Contributor Author

I think that's outside the scope of this issue, since we just inherit behavior from Basilisk for the oe to rv conversion. I think its up to the user to consider picking sensible observations, etc if they are using degenerate orbits.

@Mark2000
Mark2000 force-pushed the feature/noncircular-orbits branch 2 times, most recently from 0f3daa7 to bb398eb Compare June 12, 2025 19:57
@Mark2000

Copy link
Copy Markdown
Contributor Author

Ah, I think I see what the confusion is coming from. Optional[Type] is just a type hint alias for Union[None, Type]. The argument was already optional in the sense that it has a default value, but we never expect that value to be None.

@Mark2000
Mark2000 requested a review from dhutererprats June 12, 2025 19:58
@Mark2000
Mark2000 force-pushed the feature/noncircular-orbits branch from bb398eb to cf31ab8 Compare June 12, 2025 21:28

@dhutererprats dhutererprats left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@Mark2000
Mark2000 merged commit 8872831 into develop Jun 12, 2025
5 checks passed
@Mark2000
Mark2000 deleted the feature/noncircular-orbits branch June 12, 2025 22:51
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.

3 participants