-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cutout2D: Inconsistent array convention (needs documentation) #7414
Comments
This might be one of those "the ship has sailed" kind of things, but I'll let @mwcraig , @crawfordsm , or @MSeifert04 chime in. |
Adding the label as per the comment above. |
@larrybradley may have opinions here too... |
I agree that it's probably too late to change, but at least we should make it more obvious in the docs that this is inconsistent. (And add it to the list of things we'll break if we ever do a python2->python3 style backwards-breaking step). |
@hamogu , can you please clarify? What does |
@pllim It has nothing to do with the py2-> py3 transition itself. All I'm saying is that this is something we might want to change if we ever do an astropy release that breaks backwards-compatibility. I don't know if we ever get to that point in astropy, maybe astropy 10.x? ;-) |
Ah, gotcha! For now, I'll mark this as a documentation issue. |
I am extraordinarily new at this, but I would like to make a pull request for this, if you'd let me. |
As an aside, I've made a new wiki page which we could use to track non-ideal APIs we are stuck with (in case we do ever have an opportunity to break things in future): https://github.com/astropy/astropy/wiki/Future-API-considerations |
@SG004 - yes feel free to open a pull request! As noted in the comments above, this is about clarifying things in the documentation not changing the behavior of Cutout2D |
To play devil's advocate 😈 , what would you want to change? Input positions (not indices!), especially for a 2D array, are commonly expected to be in |
You're right that the position and shape orderings are not inconsistent with conventions in other libraries. However, the original reason for my post is that I can't remember any library where the orderings are mixed within the same function call. From the discussion here, it sounds like a potential solution is a very clear warning bubble or something. |
The ordered pair convention for Cutout2D is inconsistent and somewhat surprising. While the
position
argument is specified as(x, y)
, thesize
argument is reversed. From the documentation:While the
(y, x)
order is standard convention for most numpy/scipy functions, it is not intuitive to specify the position and size in reverse order from each other within the same function call.The text was updated successfully, but these errors were encountered: