G-Node / python-neo

Fork of python-neo for maintaining the NIX IO.
https://github.com/NeuralEnsemble/python-neo
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Dtype('O') error in common tests #21

Closed achilleas-k closed 5 years ago

achilleas-k commented 5 years ago

A dtype error occurs in the common IO tests on macOS only. I haven't had the chance to investigate in depth yet. Traceback from one occurrence is included below.

============================= test session starts ==============================
platform darwin -- Python 3.7.2, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /Users/achilleas/code/python-neo, inifile:
collected 1038 items / 1033 deselected

neo/test/iotest/test_nixio.py F

=================================== FAILURES ===================================
____________ CommonTests.test_assert_readed_neo_object_is_compliant ____________

self = <neo.test.iotest.test_nixio.CommonTests testMethod=test_assert_readed_neo_object_is_compliant>

    def setUp(self):
        '''
        Set up the test fixture.  This is run for every test
        '''
        self.files_to_test = copy(self.__class__.files_to_test)
        self.higher = self.ioclass.supported_objects[0]
        self.shortname = self.ioclass.__name__.lower().rstrip('io')
        # these objects can both be written and read
        self.io_readandwrite = list(set(self.ioclass.readable_objects) &
                                    set(self.ioclass.writeable_objects))
        # these objects can be either written or read
        self.io_readorwrite = list(set(self.ioclass.readable_objects) |
                                   set(self.ioclass.writeable_objects))
        self.create_local_dir_if_not_exists()
        self.download_test_files_if_not_present()
        self.files_generated = []
>       self.generate_files_for_io_able_to_write()

neo/test/iotest/common_io_test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
neo/test/iotest/common_io_test.py:428: in generate_files_for_io_able_to_write
    write_generic(ioobj, target=self.higher)
neo/test/iotest/tools.py:379: in write_generic
    obj_writer(obj)
neo/io/nixio.py:559: in write_block
    self._write_segment(seg, nixblock)
neo/io/nixio.py:661: in _write_segment
    self._write_epoch(epoch, nixblock, nixgroup)
neo/io/nixio.py:872: in _write_epoch
    "{}.times".format(nix_name), "neo.epoch.times", data=times
../nixpy/nixio/block.py:191: in create_data_array
    dtype, shape, compression)
../nixpy/nixio/data_array.py:46: in _create_new
    newentity._h5group.create_dataset("data", shape, data_type, datacompr)
../nixpy/nixio/hdf5/h5group.py:99: in create_dataset
    return H5DataSet(self.group, name, dtype, shape, compression)
../nixpy/nixio/hdf5/h5dataset.py:30: in __init__
    **comprargs
/usr/local/lib/python3.7/site-packages/h5py/_hl/group.py:189: in require_dataset
    return self.create_dataset(name, *(shape, dtype), **kwds)
/usr/local/lib/python3.7/site-packages/h5py/_hl/group.py:136: in create_dataset
    dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
/usr/local/lib/python3.7/site-packages/h5py/_hl/dataset.py:118: in make_new_dset
    tid = h5t.py_create(dtype, logical=1)
h5py/h5t.pyx:1630: in h5py.h5t.py_create
    ???
h5py/h5t.pyx:1652: in h5py.h5t.py_create
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: Object dtype dtype('O') has no native HDF5 equivalent

h5py/h5t.pyx:1707: TypeError
=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/__init__.py:266
  /usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/__init__.py:266: DeprecationWarning: invalid escape sequence \m
  /usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/__init__.py:266: DeprecationWarning: invalid escape sequence \m

/usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/markup.py:113
  /usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/markup.py:113: DeprecationWarning: invalid escape sequence \c
  /usr/local/lib/python3.7/site-packages/quantities-0.12.2-py3.7.egg/quantities/markup.py:113: DeprecationWarning: invalid escape sequence \c

neo/io/tools.py:82
  /Users/achilleas/code/python-neo/neo/io/tools.py:82: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    class LazyList(collections.MutableSequence):

neo/io/nixio.py:27
  /Users/achilleas/code/python-neo/neo/io/nixio.py:27: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    from collections import Iterable, OrderedDict

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============ 1 failed, 1033 deselected, 6 warnings in 1.85 seconds =============
achilleas-k commented 5 years ago

See NeuralEnsemble/python-neo#638