Prevent unit equivalencies from interfering with an error message#19043
Prevent unit equivalencies from interfering with an error message#19043eerovaher wants to merge 2 commits into
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.
|
If a user tries to create a `SkyCoord` with positions and velocities that have incompatible units then normally they get an informative error message. The updated tests reveal that if the `u.doppler_redshift()` unit equivalency is enabled then they get a much more cryptic error message instead.
Previously trying to create a `SkyCoord` with positions and velocities that have incompatible units could cause the error message to be needlessly cryptic if unit equivalencies were enabled, but now the error message for incompatible units is the intended one regardless of equivalencies.
5f3a62b to
2148f34
Compare
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 5 months. I plan to close this in a month if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
Description
If a user tries to create a
SkyCoordwith positions and velocities that have incompatible units then normally they get an informative error message:But unit equivalencies can interfere with that, in which case the error message will be quite cryptic:
The problem can be solved by using physical types, which are not affected by unit equivalencies.