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
Absence of representation comparison makes frame.is_equivalent_frame incorrectly fail #7793
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
Improve frame testing with one caveat
astrojuanlu commentedon Feb 10, 2019
This was closed in #8218.