Skip to content

Absence of representation comparison makes frame.is_equivalent_frame incorrectly fail #7793

Closed

Description

@astrojuanlu

Paraphrasing from #3182, at the moment one cannot compare whether representation objects are equivalent:

In [1]: from astropy.coordinates import CartesianRepresentation

In [2]: CartesianRepresentation(x=0, y=0, z=0, unit="km") == CartesianRepresentation(x=0, y=0, z=0, unit="km")
Out[2]: False

In [3]: CartesianRepresentation(x=0, y=0, z=0, unit="km") == CartesianRepresentation(x=1000, y=1000, z=1000, unit="km")
Out[3]: False

However, this issue is arguably more important because it makes is_equivalent_frame fail when it shouldn't:

In [4]: from astropy.coordinates import GCRS, HCRS

In [5]: from astropy.time import Time

In [6]: epoch = Time.now()

In [7]: HCRS(obstime=epoch).is_equivalent_frame(HCRS(obstime=epoch))
Out[7]: True

In [8]: GCRS(obstime=epoch).is_equivalent_frame(GCRS(obstime=epoch))
Out[8]: False

In [9]: GCRS(obstime=epoch).obsgeoloc
Out[9]: 
<CartesianRepresentation (x, y, z) in m
    (0., 0., 0.)>

In [10]: GCRS(obstime=epoch).obsgeoloc == GCRS(obstime=epoch).obsgeoloc
Out[10]: False

Activity

  1. astrojuanlu commented on Feb 10, 2019

    @astrojuanlu
    MemberAuthor

    This was closed in #8218.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions