Skip to content

Determine the root cause of the is_equivalent_frame change and document it #8138

Closed

Description

@eteq

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.

Activity

  1. added this to the v3.1 milestone on Nov 16, 2018
  2. eteq commented on Dec 3, 2018

    @eteq
    MemberAuthor

    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...

    cc @adrn

  3. eteq commented on Dec 3, 2018

    @eteq
    MemberAuthor

    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.

  4. added
    Affects-devPRs and issues that do not impact an existing Astropy release
    on Dec 3, 2018
  5. self-assigned this
    on Dec 5, 2018
  6. bsipocz commented on Dec 6, 2018

    @bsipocz
    Member

    @eteq - I suppose this has been fixed now, can you confirm and close or remilestone?

  7. eteq commented on Dec 6, 2018

    @eteq
    MemberAuthor

    Yes, fixed by #8218 (apparently my wording in the commit message was too ambiguous for github...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Affects-devPRs and issues that do not impact an existing Astropy releaseBugcoordinates

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions