- Notifications
You must be signed in to change notification settings - Fork 90
Fix km -> m error and add type hints #1158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
src/utilities/orbitalMotion.py Outdated
| === ========================= ======= | ||
| a semi-major axis km | ||
| a semi-major axis m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see how this might be confusing, But, this is not strictly true. The distance units of 'a' and 'mu' must be the same. If both use km or m we are ok. Can we change this to discuss this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is true for the specific function, the mu provided from the gravfactory are in m^3s^-2, and thus the general use in functions like orbitalMotion.elem2rv(mu, oe) would be in m, right?. Maybe it would be more clear for the user to have everything in meters there.
Also, if we want to set initial positions from the orbital elements with scObject.hub.r_CN_NInit = rN, they expect to be in m, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your statement is true for mu from gravFactory. Maybe then say in the units
m, needs to have the same distance unit as used in mu variable That should clarify this, as well as have a better default unit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a line like that in each docstring, do you think is more clear now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this approach. However, the CI tests are failing at the documentation stage. We are getting this warning:
/Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.elem2rv_parab:12: WARNING: Inline emphasis start-string without end-string. [docutils] looking for now-outdated files... none found /Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.rv2elem:16: WARNING: Inline emphasis start-string without end-string. [docutils] /Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.rv2elem_parab:16: WARNING: Inline emphasis start-string without end-string. [docutils] Could you please test build the documentation and resolve this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem with an asterisk in the docstring. The new commit should fix that.
schaubh left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- made suggested edit to the unit statement
- need to rebase on latest develop
src/utilities/orbitalMotion.py Outdated
| === ========================= ======= | ||
| a semi-major axis km | ||
| a semi-major axis m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your statement is true for mu from gravFactory. Maybe then say in the units
m, needs to have the same distance unit as used in mu variable That should clarify this, as well as have a better default unit?
schaubh left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I like how you clarified the unit issue. Can you please squash these commits now to two commits. One to update the units, one to add the method hints? This was we have a clean branch that does change prior commits.
src/utilities/orbitalMotion.py Outdated
| === ========================= ======= | ||
| a semi-major axis km | ||
| a semi-major axis m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this approach. However, the CI tests are failing at the documentation stage. We are getting this warning:
/Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.elem2rv_parab:12: WARNING: Inline emphasis start-string without end-string. [docutils] looking for now-outdated files... none found /Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.rv2elem:16: WARNING: Inline emphasis start-string without end-string. [docutils] /Users/runner/work/basilisk/basilisk/src/utilities/orbitalMotion.py:docstring of orbitalMotion.rv2elem_parab:16: WARNING: Inline emphasis start-string without end-string. [docutils] Could you please test build the documentation and resolve this issue?
The type hints were added in the same initial commit where I updated the units, so I cannot divide all commits in these two. Anyway, what about squash and merge the full PR in a single commit? |
| There are ways to split a commit if needed. But here, I'm ok to have them be one commit that that helps you. However, we should not be having several incremental commits. Also, instead of merging your branch with the latest develop, we ask contributors to do a rebase process instead. |
| Tried to rebase but I messed up something and now there are a bunch of commits in the commit history. We can remove them from the PR description when merged. Is it ok now? |
| @PabloVD , agreed, this branch is a mess now. Not sure what happened here, but I can't accept this branch. Are you able to fix this? Or, I can cherry pick your PR related commits into a new branch and push from my side with a new PR? |
Description
Verification
Units verified by example codes.
Documentation
Documentation about orbital elements.