__________________________ test_serialize_ecsv_masked __________________________
tmpdir = local('/tmp/pytest-of-buildd/pytest-0/test_serialize_ecsv_masked0')
@pytest.mark.skipif('not HAS_YAML')
def test_serialize_ecsv_masked(tmpdir):
tm = Time([1, 2, 3], format='cxcsec')
tm[1] = np.ma.masked
# Serializing in the default way for ECSV fails to round-trip
# because it writes out a "nan" instead of "". But for jd1/jd2
# this works OK.
tm.info.serialize_method['ecsv'] = 'jd1_jd2'
fn = str(tmpdir.join('tempfile.ecsv'))
t = Table([tm])
t.write(fn)
> t2 = Table.read(fn)
astropy/time/tests/test_mask.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
astropy/table/connect.py:52: in __call__
out = registry.read(cls, *args, **kwargs)
astropy/io/registry.py:523: in read
data = reader(*args, **kwargs)
astropy/io/ascii/connect.py:19: in io_read
return read(filename, **kwargs)
astropy/io/ascii/ui.py:323: in read
dat = reader.read(table)
astropy/io/ascii/core.py:1204: in read
table = self.outputter(cols, self.meta)
astropy/io/ascii/ecsv.py:202: in __call__
out = serialize._construct_mixins_from_columns(out)
astropy/table/serialize.py:302: in _construct_mixins_from_columns
_construct_mixin_from_columns(new_name, obj_attrs, out)
astropy/table/serialize.py:288: in _construct_mixin_from_columns
col = _construct_mixin_from_obj_attrs_and_info(obj_attrs, info)
astropy/table/serialize.py:217: in _construct_mixin_from_obj_attrs_and_info
mixin = cls.info._construct_from_dict(obj_attrs)
astropy/time/core.py:190: in _construct_from_dict
out = self._construct_from_dict_base(map)
astropy/time/core.py:182: in _construct_from_dict_base
out = self._parent_cls(**map)
astropy/time/core.py:428: in __init__
self._init_from_vals(val, val2, format, scale, copy,
astropy/time/core.py:483: in _init_from_vals
self._time = self._get_time_fmt(val, val2, format, scale,
astropy/time/core.py:534: in _get_time_fmt
return cls(val, val2, scale, precision, in_subfmt, out_subfmt)
astropy/time/formats.py:147: in __init__
self.set_jds(val1, val2)
astropy/time/formats.py:404: in set_jds
self.jd1, self.jd2 = day_frac(val1, val2)
astropy/time/utils.py:46: in day_frac
sum12, err12 = two_sum(val1, val2)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = array([2450815., 2450815., 2450815.])
b = array([-0.49998843, nan, -0.49996528])
def two_sum(a, b):
"""[…]"""
> x = a + b
E RuntimeWarning: invalid value encountered in add
astropy/time/utils.py:133: RuntimeWarning
This may be related to #9749 but is a bit different: The same test run gives also the following error: