Empty hdf5

This PR allows to read/write empty HDF5 biom tables.

Should be really fast to review
Ahh, I see -- that's annoying.  I don't really agree with this (why would
you ever want to write an empty table to disk?), but if it saves us dozens
of developer hours fixing old code then I guess we have to go with it.


On Tue, Aug 5, 2014 at 3:04 PM, josenavas <notifications@github.com> wrote:

> In tests/test_table.py:
>
> > +        if '/' in __file__:
> > +            os.chdir(__file__.rsplit('/', 1)[0])
> > +        t = Table.from_hdf5(h5py.File('test_data/empty.biom'))
> > +        os.chdir(cwd)
> > +
> > +        npt.assert_equal(t.ids(), [])
> > +        npt.assert_equal(t.ids(axis='observation'), [])
> > +        self.assertEqual(t._observation_metadata, None)
> > +        self.assertEqual(t._sample_metadata, None)
> > +        npt.assert_equal(list(t.iter_data(axis='observation')), [])
> > +
> > +    @npt.dec.skipif(HAVE_H5PY is False, msg='H5PY is not installed')
> > +    def test_to_hdf5_empty_table(self):
> > +        """Successfully writes an empty OTU table in HDF5 format"""
> > +        # Create an empty OTU table
> > +        t = Table([], [], [])
>
> When working on the parallel environment in QIIME, it is possible that
> some commands generate a completely empty OTU map, so there is no way of
> providing the samples or the observation ids.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/biocore/biom-format/pull/527/files#r15841686>.
>