Correct right ascension to hour angle conversion - #149
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
==========================================
- Coverage 97.39% 97.39% -0.00%
==========================================
Files 17 17
Lines 5897 5893 -4
==========================================
- Hits 5743 5739 -4
Misses 154 154
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
sylvesterkaczmarek
marked this pull request as ready for review
September 20, 2026 02:48
Contributor
Author
|
This has been open for about 11 days with no maintainer feedback. The branch is current, mergeable, and all current checks are green. Could a maintainer review it when convenient? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rightascension_to_hourangle()currently mixes HMS and DMS conversions. Numeric local times are converted withdd_to_dms(), and the final angular difference is also formatted as DMS even though the public API promises an HMS hour angle. The documented examples therefore return the wrong value, midnight wrapping is incorrect, andequatorial_to_horizontal()receives a string when using right ascension plus local time with its default options.Convert both inputs to decimal degrees, form the wrapped
local_time - right_ascensionangle, and format the result withdd_to_hms(). Convert that returned HMS value back to degrees insideequatorial_to_horizontal()before the trigonometric calculation.Validation
Python 3.12 on macOS arm64:
main(45730dc): 3 failed. After the fix: all 3 passed.test_utils.py.py_compileandgit diff --checkpassed.utils.pyretains only its pre-existing Flake8 findings.Regression coverage includes both documented input forms, wrap-through-midnight behavior, and the downstream
equatorial_to_horizontal()path.