Repository navigation
Change argument order in AngularSeparation from (lat, lon) to (lon, lat) - #902
Conversation
|
Good catch - I missed that when I submitted a pull request before to change the argument order. I'm not sure what the best way is to proceed. I don't think this is a class users are going to be initializing directly, so maybe we can have a warning that gets emitted only if initialized directly? @eteq @iguananaut - do you have any thoughts? |
|
As @astrofrog said, I doubt anyone is actually initializing from this directly, aside from the code actually in However, it is technically part of the "public" API, so if we are actually going to be consistent about deprecating we should put up a warning for 0.3 and then actually do it in 0.4. I think that might be counter-productive, though, if no one is using it yet, because they might start in 0.2. We could switch it for 0.3, but put up a warning that says something like "FYI, these have been swapped, if you were actually using this code in 0.2". We would want to silence this where it's used in the astropy core, of course. |
|
@eteq I'm not sure why you say that probably no-one is using this directly. I frequently compute the angular separation between two points on the sphere in my scripts. Should I be using some other class / function? Like @eteq said, I also think keeping the wrong order for the 0.3 release is bad. Attached find a commit that simply fixes the order. Acceptable? Should I add an entry to some document where we accumulate deprecations and API changes for the 0.3 release notes? |
|
@cdeil - the intent when writing this was for it to be used as it is shown in http://docs.astropy.org/en/v0.2.1/coordinates/separations.html - that is, use coordinate objects, and get the separation between the objects, instead of explicitly creating an Regardless, though, it was made public partly because we probably can't forsee all use cases, so people should have the option of using it. So it's probably true we should make it consistent. @cdeil - we definitely need to have some sort of deprecation warning pop up when this happens. I'll issue a PR against your branch to do what I'm thinking here. You're also right that we may want to have somewhere where we note API changes. @iguananaut @astrofrog - do you think we should add this to the "what's new" page in a section called "API incompatibilities" or something like that? |
|
@eteq - yes to your question about adding this to the what's new page. |
|
@eteq Yes. 100x yes. |
|
Alright, I added a PR in cdeil#2 that implements this warning and adds a doc section about version-incompatible changes, @iguananaut, you might want to check that out either there or after it gets merged here. |
|
It looks like this needs to be rebased? |
|
Thanks for the tip. Rebased. travis-ci scheduled a check of the right commit: 0e4318a |
|
The travis-ci results were weird ... half of the configs worked and others failed in different ways. See e.g.: I rebased and force pushed again. Let's see... |
There was a problem hiding this comment.
Should this be lon1, lat1, ...?
|
@cdeil - FYI, the reason why some of them succeeded is because the Anyway, I think the item @astrofrog pointed out is the problem. That's my fault, but it's probably easier if you just fix it seeing as how it's your branch here. |
|
@eteq In ae5513f you made a change that meant that in the case
6415688 fixes this case and covers it with a unit test. What is the motivation for this special case anyways? I think it's not needed and we should remove it to simplify the code a bit? |
|
@cdeil - that's actually meant for something different - the idea is that we want to allow |
|
@eteq - maybe for that it should be using |
|
@astrofrog - we could do that, but it's actually still completely correct as-is, because having Now that you mention it, though, I think this was originally intended to allow usage like |
fix for AngularSeparation initializer oddities
|
I think this is ready? @eteq Concerning the issue of howto initialize I don't see the need for an If you like this idea we can simply close this PR, because this change / deprecation process for |
|
@cdeil - the reason for
I propose we merge this, and then revisit removing AngularSeparation after #837 is in and |
|
@eteq As you like ... merge or simply close as irrelevant. Concerning the question whether to remove the |
|
Well, that's exactly the point of the distinction between separating Consider the case of points Anyway, I'll create another issue to discuss this after |
At the moment the argument order of the AngularSeparation constructor is
latfirst:As far as I can tell everywhere else in astropy (and in most other software) the order is
lonfirst.I think it would be worth changing the argument order to
lonfirst to be consistent.It's a trivial change in the
__init__and class docstring (see here) ... I didn't make a pull request because I don't know what the deprecation process is in astropy at the moment.