-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix a bug when using CoordinateFrame directly #311
Conversation
a88ca2d
to
00be820
Compare
There are inconsistencies in the way all this operates #269 |
I think you and I are pulling in different directions. I think As I note in #269, I think the |
This particular fix got the code to consistency with the other frames (spectral and celestial etc) in the easiest way I could see. I agree it is generally unclear though, and clearing it up is important. |
801a6fb
to
1e30a97
Compare
0911430
to
360f76e
Compare
@chris-simpson I have looked over this again today, and I think that your points in #269 are correct and should be implemented. That being said, I consider this a bugfix to the existing behaviour, one that is breaking my code! If @nden wants to weigh in on #269 I probably have a small amount of time to look at taking things in a different direction, but either way I would like to see this PR land. |
360f76e
to
9d0c42b
Compare
world_to_pixel passes through as a tuple.
9d0c42b
to
3ebaaa3
Compare
# If coords is a 1-tuple of quantity then return the element of the tuple | ||
# This aligns the behavior with the other implementations | ||
if not hasattr(coords, 'unit') and len(coords) == 1: | ||
return coords[0] |
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 trying to understand where this is a problem. Within gwcs there are two calls to coordinate_to_quantity
and both pass *coords
. Are you calling it outside gwcs?
Also the new test does not actually test this use case.
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.
If you can change the test I think it's good to go
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 have added a test exercising this. I also reproduced the scenario in which I was hitting it just to be safe 🤣
I think this fixes a real bug regardless of the general discussion in #269. |
I don't see any reason why CoordinateFrame should apply axes_order, I believe that's a global thing not per-frame?