Repository navigation
Closed
Labels
Affects-devPRs and issues that do not impact an existing Astropy releasePRs and issues that do not impact an existing Astropy releaseBugtestingutils.iers
Milestone
Description
Description
Possible cause: #10376
Expected behavior
Tests pass.
Actual behavior
Click to see traceback.
__________________________ TestIERS_Auto.test_simple ___________________________
self = <astropy.utils.iers.tests.test_iers.TestIERS_Auto object at 0x7f6b186ee630>
@pytest.mark.remote_data
def test_simple(self):
with iers.conf.set_temp('iers_auto_url', self.iers_a_url_1):
dat = iers.IERS_Auto.open()
assert dat['MJD'][0] == 57359.0 * u.d
assert dat['MJD'][-1] == 57539.0 * u.d
# Pretend we are accessing at a time 7 days after start of predictive data
predictive_mjd = dat.meta['predictive_mjd']
dat._time_now = Time(predictive_mjd, format='mjd') + 7 * u.d
# Look at times before and after the test file begins. 0.1292905 is
# the IERS-B value from MJD=57359. The value in
# finals2000A-2016-02-30-test has been replaced at this point.
> assert np.allclose(dat.ut1_utc(Time(50000, format='mjd').jd).value, 0.1292905)
E AssertionError: assert False
E + where False = <function allclose at 0x7f6b41651268>(0.1293286, 0.1292905)
E + where <function allclose at 0x7f6b41651268> = np.allclose
E + and 0.1293286 = <Quantity 0.1293286 s>.value
E + where <Quantity 0.1293286 s> = <bound method IERS.ut1_utc of <IERS_Auto length=181>\n year month day ... dX_2000A dY_2000A ... nan nan 0\n 16 7 30 ... nan nan 0>(2450000.5)
E + where <bound method IERS.ut1_utc of <IERS_Auto length=181>\n year month day ... dX_2000A dY_2000A ... nan nan 0\n 16 7 30 ... nan nan 0> = <IERS_Auto length=181>\n year month day ... dX_2000A dY_2000A NutFlag\n ...... nan nan 0\n 16 7 30 ... nan nan 0.ut1_utc
E + and 2450000.5 = <Time object: scale='utc' format='mjd' value=50000.0>.jd
E + where <Time object: scale='utc' format='mjd' value=50000.0> = Time(50000, format='mjd')
../../.tox/py37-test-devdeps/lib/python3.7/site-packages/astropy/utils/iers/tests/test_iers.py:269: AssertionError
________________ test_IERS_B_parameters_loading_into_IERS_Auto _________________
@pytest.mark.remote_data
def test_IERS_B_parameters_loading_into_IERS_Auto():
A = iers.IERS_Auto.open()
B = iers.IERS_B.open()
ok_A = A["MJD"] <= B["MJD"][-1]
assert not np.all(ok_A), "IERS B covers all of IERS A: should not happen"
i_B = np.searchsorted(B["MJD"], A["MJD"][ok_A])
assert np.all(np.diff(i_B) == 1), "Valid region not contiguous"
assert np.all(A["MJD"][ok_A] == B["MJD"][i_B])
# Check that values are copied correctly. Since units are not
# necessarily the same, we use allclose with very strict tolerance.
for name in ("UT1_UTC", "PM_x", "PM_y", "dX_2000A", "dY_2000A"):
assert_quantity_allclose(
A[name][ok_A], B[name][i_B], rtol=1e-15,
err_msg=("Bug #9206 IERS B parameter {} not copied over "
> "correctly to IERS Auto".format(name)))
../../.tox/py37-test-devdeps/lib/python3.7/site-packages/astropy/utils/iers/tests/test_iers.py:330:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = <Quantity [ 0.8078584, 0.8051525, 0.8024015, ..., -0.2382365, -0.2385745,
-0.2390142] s>
desired = <Quantity [ 0.8078584, 0.8051525, 0.8024015, ..., -0.2382558, -0.2385857,
-0.239021 ] s>
rtol = 1e-15, atol = None
kwargs = {'err_msg': 'Bug #9206 IERS B parameter UT1_UTC not copied over correctly to IERS Auto'}
np = <module 'numpy' from '/home/travis/build/astropy/astropy/.tox/py37-test-devdeps/lib/python3.7/site-packages/numpy/__init__.py'>
_unquantify_allclose_arguments = <function _unquantify_allclose_arguments at 0x7f6b3dd97a60>
def assert_quantity_allclose(actual, desired, rtol=1.e-7, atol=None,
**kwargs):
"""
Raise an assertion if two objects are not equal up to desired tolerance.
This is a :class:`~astropy.units.Quantity`-aware version of
:func:`numpy.testing.assert_allclose`.
"""
import numpy as np
from astropy.units.quantity import _unquantify_allclose_arguments
np.testing.assert_allclose(*_unquantify_allclose_arguments(
> actual, desired, rtol, atol), **kwargs)
E AssertionError:
E Not equal to tolerance rtol=1e-15, atol=0
E Bug #9206 IERS B parameter UT1_UTC not copied over correctly to IERS Auto
E Mismatched elements: 18 / 17275 (0.104%)
E Max absolute difference: 2.43e-05
E Max relative difference: 0.00010208
E x: array([ 0.807858, 0.805153, 0.802401, ..., -0.238236, -0.238574,
E -0.239014])
E y: array([ 0.807858, 0.805153, 0.802401, ..., -0.238256, -0.238586,
E -0.239021])
../../.tox/py37-test-devdeps/lib/python3.7/site-packages/astropy/tests/helper.py:483: AssertionError
_____________________________ [doctest] frames.rst _____________________________
230 ...
231 ValueError: operands could not be broadcast together...
232 >>> coo2.shape
233 (3,)
234 >>> lf.shape
235 (2,)
236 >>> lf2 = lf[:, np.newaxis]
237 >>> lf2.shape
238 (2, 1)
239 >>> coo2.transform_to(lf2) # doctest: +REMOTE_DATA +FLOAT_CMP
Differences (unified diff with -expected +actual):
@@ -2,7 +2,7 @@
'2012-03-21T00:00:00.000']
['2012-06-21T00:00:00.000' '2012-06-21T00:00:00.000'
- '2012-06-21T00:00:00.000']], location=(3980608.9024681724, -102.47522910648239, 4966861.273100675) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt) in deg
- [[( 93.09845202, 89.21613119), (126.85789652, 25.46600543),
- ( 51.37993229, 37.18532521)],
- [(307.71713699, 37.99437658), (231.37407871, 26.36768329),
- ( 85.42187335, 89.69297997)]]>
+ '2012-06-21T00:00:00.000']], location=(3980608.90246817, -102.47522911, 4966861.27310068) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt) in deg
+ [[( 93.09845185, 89.21613128), (126.85789663, 25.4660055 ),
+ ( 51.37993234, 37.18532527)],
+ [(307.71713698, 37.99437658), (231.3740787 , 26.36768329),
+ ( 85.4218724 , 89.69297998)]]>
/home/travis/build/astropy/astropy/docs/coordinates/frames.rst:239: DocTestFailure
Metadata
Metadata
Assignees
Labels
Affects-devPRs and issues that do not impact an existing Astropy releasePRs and issues that do not impact an existing Astropy releaseBugtestingutils.iers
Activity
astrofrog commentedon May 22, 2020
@mhvk - do you have any idea what could be going on with the
test_IERS_B_parameters_loading_into_IERS_Autotest? I think I can fix the two others.pllim commentedon Jun 17, 2020
Seem to pass nowadays.