Skip to content

1.0rc1&2: test_eloc_attributes() fail on i386 #3496

Closed

Description

@olebole

This is another separation of #3380. test_eloc_attributes fails on i386:

    def test_eloc_attributes():
        from .. import AltAz, ITRS, GCRS, EarthLocation

        el = EarthLocation(lon=12.3*u.deg, lat=45.6*u.deg, height=1*u.km)
        it = ITRS(representation.SphericalRepresentation(lon=12.3*u.deg, lat=45.6*u.deg, distance=1*u.km))
        gc = GCRS(ra=12.3*u.deg, dec=45.6*u.deg, distance=6375*u.km)

        el1 = AltAz(location=el).location
        assert isinstance(el1, EarthLocation)
        assert el1.latitude == el.latitude
        assert el1.longitude == el.longitude
        assert el1.height == el.height

        el2 = AltAz(location=it).location
        assert isinstance(el2, EarthLocation)
        assert el2.latitude != it.spherical.lat
>       assert el2.longitude != it.spherical.lon
E       assert <Longitude [ 12.3] deg> != <Longitude 12.3 deg>
E        +  where <Longitude [ 12.3] deg> = <EarthLocation [(0.6836029704431764, 0.14904955169200265, 0.7144726796328034)] km>.longitude
E        +  and   <Longitude 12.3 deg> = <SphericalRepresentation lon=12.3 deg, lat=45.6 deg, distance=1.0 km>.lon
E        +    where <SphericalRepresentation lon=12.3 deg, lat=45.6 deg, distance=1.0 km> = <ITRS Coordinate (obstime=J2000.000): x=0.683602970443 km, y=0.149049551692 km, z=0.714472679633 km>.spherical
astropy/coordinates/tests/test_frames.py:531: AssertionError

(Update: I git confused with my logs. arm64 is not affected)

Activity

  1. changed the title [-]1.0rc1&2: test_eloc_attributes() fail on i386, arm64[/-] [+]1.0rc1&2: test_eloc_attributes() fail on i386[/+] on Feb 12, 2015
  2. astrofrog commented on Feb 14, 2015

    @astrofrog
    Member

    @eteq - I looked into this a bit, and it turns out that I think the test may only be passing by luck on 64-bit systems. The difference between el2.longitude and it.spherical.lon is 1e-11 arcseconds.

    A side note is that the values returned by el2 are arrays, so I think it's more strictly correct to do:

        assert el2.latitude[0] != it.spherical.lat
        assert el2.longitude[0] != it.spherical.lon
        assert el2.height[0] < -6000*u.km
    

    So I guess the question is, are the longitudes expected to be different?

    Also, this test could do with more comments to explain why values should or should not be equal.

  3. eteq commented on Feb 16, 2015

    @eteq
    Member

    #3507 should fix this - in fact, the logitudes should not be different, but the latitudes should. So #3507 changes to using np.allclose (or not np.allclose) and also changes lon to the correct behavior.

    @olebole - can you double-check that #3507 does indeed solve this on i386? (Or if someone else can test it on i386, that's fine too)

  4. olebole commented on Feb 16, 2015

    @olebole
    MemberAuthor

    I tested #3507 on i386, and it works.

  5. added this to the v1.0.0 milestone on Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions