You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Determine the root cause of the is_equivalent_frame change and document it #8138
astropy/astroplan#382 is showing a single test failure that appeared in astropy v3.1rc1. This is odd because it seems to be in a place that wasn't obviously modified in 3.1. But it could be some subtle thing related to some of the preformance improvements.
At any rate, whether it's a bug that needs fixing or a subtle behavior change, in either case it should be either fixed or documented in the changelog/what's new.
Turns out this may be a "real" failure: looking more deeply at astropy/astroplan#382, it turns out the real problem lies in is_equivalent_frame returning False in a case where it looks like it should return True. Trying to work up a simple test case of this...
Here's a test case demonstrating the core of the problem. This fails in 3.1rc2 and passes in 3.0.x:
>>> from astropy.coordinates import *
>>> from astropy import units as u
>>> sc = SkyCoord(1*u.deg, 2*u.deg)
>>> newframe = GCRS()
>>> sc2 = sc.transform_to(newframe)
>>> assert newframe.obsgeoloc == sc2.obsgeoloc
To summarize: something changed in the the frame initializer that makes it so that frame attributes are copied in transform_to instead of referenced. Arguable this is a feature... (although we should document it as an API change - I'll make a quick PR doing just that right now).
However, the problem that astropy/astroplan#382 reveals (and shown in the above) is that this now causes some counter-intuitive behavior, because is_equivalent_frame uses equality, which isn't implemented on representations (or more accurately, is using the object.__eq__, which is the same as "is the same object"). I think the fix is probably to implement a reasonable equality for representations.
Activity
eteq commentedon Dec 3, 2018
Turns out this may be a "real" failure: looking more deeply at astropy/astroplan#382, it turns out the real problem lies in
is_equivalent_framereturning False in a case where it looks like it should return True. Trying to work up a simple test case of this...cc @adrn
eteq commentedon Dec 3, 2018
Here's a test case demonstrating the core of the problem. This fails in 3.1rc2 and passes in 3.0.x:
To summarize: something changed in the the frame initializer that makes it so that frame attributes are copied in
transform_toinstead of referenced. Arguable this is a feature... (although we should document it as an API change - I'll make a quick PR doing just that right now).However, the problem that astropy/astroplan#382 reveals (and shown in the above) is that this now causes some counter-intuitive behavior, because
is_equivalent_frameuses equality, which isn't implemented on representations (or more accurately, is using theobject.__eq__, which is the same as "is the same object"). I think the fix is probably to implement a reasonable equality for representations.create regression test for astropy#8138
create regression test for astropy#8138
bsipocz commentedon Dec 6, 2018
@eteq - I suppose this has been fixed now, can you confirm and close or remilestone?
eteq commentedon Dec 6, 2018
Yes, fixed by #8218 (apparently my wording in the commit message was too ambiguous for github...)