Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix how coordinates handles negative or nan parallaxes/distances #7988
Hi there @adrn
Everything looks good from my point of view!
If there are any issues with this message, please report them here.
Failures are real! Apparently, in master, you can do:
>>> rep = coord.SphericalRepresentation(160*u.deg, 10*u.deg, 10*u.pc) >>> -rep <SphericalRepresentation (lon, lat, distance) in (deg, deg, pc) ( 160., 10., -10.)>
Because of this change, that no longer works:
>>> rep = coord.SphericalRepresentation(160*u.deg, 10*u.deg, 10*u.pc) >>> -rep NotImplemented
I actually feel like the behavior in this PR is more "correct", in the sense that a negative distance doesn't mean anything, so we might want to either not allow this operation (i.e. raise a
Just a few minor suggestions. They're straightforward enough I'll just implement myself and then merge