Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2RC1 - test failure in astropy.time.tests.test_ut1.TestTimeUT1 #5099

Closed
saimn opened this issue Jun 15, 2016 · 7 comments
Closed

1.2RC1 - test failure in astropy.time.tests.test_ut1.TestTimeUT1 #5099

saimn opened this issue Jun 15, 2016 · 7 comments
Assignees
Labels

Comments

@saimn
Copy link
Contributor

saimn commented Jun 15, 2016

Not sure if it is related to #5098 so I opened another issue.

________________________________________ TestTimeUT1.test_utc_to_ut1 _________________________________________

self = <astropy.time.tests.test_ut1.TestTimeUT1 instance at 0x7ff28f8325f0>

    def test_utc_to_ut1(self):
        "Test conversion of UTC to UT1, making sure to include a leap second"""
        t = Time(['2012-06-30 12:00:00', '2012-06-30 23:59:59',
                  '2012-06-30 23:59:60', '2012-07-01 00:00:00',
                  '2012-07-01 12:00:00'], scale='utc')
        t_ut1_jd = t.ut1.jd
        t_comp = np.array([2456108.9999932079,
                           2456109.4999816339,
                           2456109.4999932083,
                           2456109.5000047823,
                           2456110.0000047833])
        assert allclose_jd(t_ut1_jd, t_comp)
        t_back = t.ut1.utc
        assert allclose_jd(t.jd, t_back.jd)

        tnow = Time.now()

        # With internet off (which is the default for testing) then this will
        # fall back to the bundled IERS-B table and raise an exception.  But when
        # testing with --remote-data the IERS_Auto class will get the latest IERS-A
        # and this works.
        if INTERNET_OFF:
            with pytest.raises(IndexError):
                tnow.ut1
        else:
>           tnow.ut1

astropy/time/tests/test_ut1.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
astropy/time/core.py:1138: in __getattr__
    tm._set_scale(attr)
astropy/time/core.py:425: in _set_scale
    args.append(get_dt(jd1, jd2))
astropy/time/core.py:1260: in _get_delta_ut1_utc
    delta = iers_table.ut1_utc(jd1, jd2)
astropy/utils/iers/iers.py:215: in ut1_utc
    self.ut1_utc_source if return_status else None)
astropy/utils/iers/iers.py:312: in _interpolate
    self._check_interpolate_indices(i1, i, np.max(mjd))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <IERS_B length=19840>
 year month  day    MJD   ... e_UT1_UTC  e_LOD   e_dX_20... 2.8e-05
 2016     4    26 57504.0 ...   6.1e-06 1.95e-05      3e-05      3e-05
indices_orig = array([19839]), indices_clipped = array([19840]), max_input_mjd = 57554.0

    def _check_interpolate_indices(self, indices_orig, indices_clipped, max_input_mjd):
        """
            Check that the indices from interpolation match those after clipping
            to the valid table range.  This method gets overridden in the IERS_Auto
            class because it has different requirements.
            """
        if np.any(indices_orig != indices_clipped):
>           raise IERSRangeError('(some) times are outside of range covered '
                                 'by IERS table.')
E           IERSRangeError: (some) times are outside of range covered by IERS table.

astropy/utils/iers/iers.py:255: IERSRangeError
__________________________________ TestTimeUT1_IERS_Auto.test_ut1_iers_auto __________________________________

self = <astropy.time.tests.test_ut1.TestTimeUT1_IERS_Auto instance at 0x7ff2797c3bd8>

    def test_ut1_iers_auto(self):
        tnow = Time.now()
        iers_a = iers.IERS_Auto.open()
        tnow.delta_ut1_utc, status = iers_a.ut1_utc(tnow, return_status=True)
>       assert status == iers.FROM_IERS_A_PREDICTION
E       assert -2 == 2
E        +  where 2 = iers.FROM_IERS_A_PREDICTION

astropy/time/tests/test_ut1.py:97: AssertionError
===================== 4 failed, 11215 passed, 74 skipped, 42 xfailed in 2584.95 seconds ======================
@taldcroft
Copy link
Member

What configuration? --remote-data?

FWIW I cannot reproduce this or #5098 on mac with Py2.7 for remote and not remote data.

@astrofrog
Copy link
Member

Could it be a cache issue with the previously downloaded tables?

@saimn
Copy link
Contributor Author

saimn commented Jun 15, 2016

@taldcroft - Sorry, forgot to put some context indeed. Python 3.5, remote-data, full log here:
https://gist.github.com/saimn/98e8ca025b9ac8d09a22e3ff71688598

@saimn
Copy link
Contributor Author

saimn commented Jun 15, 2016

Cache content (seems unrelated ?):

❯ l ~/.astropy/cache/download/*
-rw------- 1 simon 1,6M 23 nov.   2015 /home/simon/.astropy/cache/download/2c9202ae878ecfcb60878ceb63837f5f

/home/simon/.astropy/cache/download/py2:
total 1,6M
-rw------- 1 simon 1,6M  3 juin  10:28 2c9202ae878ecfcb60878ceb63837f5f
-rw-r--r-- 1 simon   72  3 juin  11:01 urlmap.bak
-rw-r--r-- 1 simon   82  3 juin  10:28 urlmap.dat
-rw-r--r-- 1 simon   72  3 juin  11:01 urlmap.dir

/home/simon/.astropy/cache/download/py3:
total 1,6M
-rw------- 1 simon 1,6M  3 juin  10:54 2c9202ae878ecfcb60878ceb63837f5f
-rw-r--r-- 1 simon   72  3 juin  10:54 urlmap.bak
-rw-r--r-- 1 simon   82  3 juin  10:54 urlmap.dat
-rw-r--r-- 1 simon   72  3 juin  10:54 urlmap.dir

~/dev/astropy tox
❯ cat ~/.astropy/cache/download/py3/urlmap.bak
'http://data.astropy.org/tutorials/FITS-images/HorseHead.fits', (0, 82)

@eteq
Copy link
Member

eteq commented Jun 16, 2016

In theory the cache shouldn't matter, because the tests run in an environment that ignores the local cached copy.

@saimn - have you tried boosting the timeout as per what the thought in #5098? If that fixes it we know it's a download issue...

@astrofrog
Copy link
Member

@saimn - can you confirm that this is fixed by #5111, which is now merged?

@saimn
Copy link
Contributor Author

saimn commented Jun 20, 2016

Fixed with #5111 !

@saimn saimn closed this as completed Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants