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
Allow initializing Distance from angle-like parallax #15712
Allow initializing Distance from angle-like parallax #15712
Conversation
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
03d46b7
to
288d07e
Compare
@eerovaher - thanks for the great suggestions, I applied them all and tests are running now. I rebased on main hoping that docs will build OK. |
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.
The updates to the code look good, but I would like bugfix pull requests to have two commits. The first would add the regression test, the second the fix itself and the change log entry. Checking out the first commit would then allow to very easily verify both that the bug exists and that the new regression test catches it. I am willing to rebase the pull request myself to get the commit structure I'd like.
@eerovaher - go ahead on the rebase if you like. Personally I think that is not the most productive use of your valuable time since we have the original bug report which I have independently confirmed. As a general policy I don't think that splitting tests and code updates is going to be workable. |
The new test reveals that passing in an angle-like object as parallax to `coordinates.Distance` does not always work. Most notable example is `table.Column`.
288d07e
to
c16a408
Compare
The `parallax` argument to `Distance` can now be any object that can be converted to an angular `Quantity`, most notably `table.Column`.
c16a408
to
38f10a3
Compare
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.
Great, thanks!
…712-on-v6.0.x Backport PR #15712 on branch v6.0.x (Allow initializing Distance from angle-like parallax)
Description
This pull request is to allow initializing
Distance
from an angle-likeparallax
which is not aQuantity
. In particular any numeric object with an angularunit
will work.Fixes #15693
- [ ] By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.