Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test_serialize_hdf5_masked failed for 3.1rc1 #8134

Copy link
Copy link

Description

@aphearin
Issue body actions

I just tested astropy 3.1rc1 into a python 3.7.1 environment with numpy=1.15.4 and h5py=2.8.0.

1 failed, 11370 passed, 264 skipped, 67 xfailed, 3106 warnings, 2 error in 245.20 seconds

I show the output from the one failure below, but I posted the full testing log at this gist.

========================================================== FAILURES ==========================================================
_________________________________________________ test_serialize_hdf5_masked _________________________________________________

tbl = <Table length=3>
       col0
      object
------------------
0.9999999999969589
                --
 3.000000000000469

    def _encode_mixins(tbl):
        """Encode a Table ``tbl`` that may have mixin columns to a Table with only
        astropy Columns + appropriate meta-data to allow subsequent decoding.
        """
        from ...table import serialize
        from ...table.table import has_info_class
        from ... import units as u
        from ...utils.data_info import MixinInfo, serialize_context_as

        # If PyYAML is not available then check to see if there are any mixin cols
        # that *require* YAML serialization.  HDF5 already has support for
        # Quantity, so if those are the only mixins the proceed without doing the
        # YAML bit, for backward compatibility (i.e. not requiring YAML to write
        # Quantity).
        try:
>           import yaml
E           ModuleNotFoundError: No module named 'yaml'

/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/io/misc/hdf5.py:206: ModuleNotFoundError

During handling of the above exception, another exception occurred:

tmpdir = local('/private/var/folders/xj/6rkkv6w11vxg2ryy8whq850c0000gn/T/pytest-of-aphearin/pytest-0/test_serialize_hdf5_masked0')

    @pytest.mark.skipif('not HAS_H5PY')
    def test_serialize_hdf5_masked(tmpdir):
        tm = Time([1, 2, 3], format='cxcsec')
        tm[1] = np.ma.masked

        fn = str(tmpdir.join('tempfile.hdf5'))
        t = Table([tm])
>       t.write(fn, path='root', serialize_meta=True)

/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/time/tests/test_mask.py:178:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/table/table.py:2592: in write
    io_registry.write(self, *args, **kwargs)
/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/io/registry.py:560: in write
    writer(data, *args, **kwargs)
/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/io/misc/hdf5.py:298: in write_table_hdf5
    compatibility_mode=compatibility_mode)
/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/io/misc/hdf5.py:316: in write_table_hdf5
    table = _encode_mixins(table)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tbl = <Table length=3>
       col0
      object
------------------
0.9999999999969589
                --
 3.000000000000469

    def _encode_mixins(tbl):
        """Encode a Table ``tbl`` that may have mixin columns to a Table with only
        astropy Columns + appropriate meta-data to allow subsequent decoding.
        """
        from ...table import serialize
        from ...table.table import has_info_class
        from ... import units as u
        from ...utils.data_info import MixinInfo, serialize_context_as

        # If PyYAML is not available then check to see if there are any mixin cols
        # that *require* YAML serialization.  HDF5 already has support for
        # Quantity, so if those are the only mixins the proceed without doing the
        # YAML bit, for backward compatibility (i.e. not requiring YAML to write
        # Quantity).
        try:
            import yaml
        except ImportError:
            for col in tbl.itercols():
                if (has_info_class(col, MixinInfo) and
                        col.__class__ is not u.Quantity):
                    raise TypeError("cannot write type {} column '{}' "
                                    "to HDF5 without PyYAML installed."
>                                   .format(col.__class__.__name__, col.info.name))
E                   TypeError: cannot write type Time column 'col0' to HDF5 without PyYAML installed.

/anaconda3/envs/astropy_testing/lib/python3.7/site-packages/astropy/io/misc/hdf5.py:213: TypeError

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.