Closed nherweg closed 6 years ago
See #216.
And curse @ctw.
I talked to Christoph and it seems this is actually a CML reader - ptsa compatibility problem. When constructing the time series object with .to_ptsa the dtype of the events looks like this:
dtype=(numpy.record, [('index', '<i8'), ('eegfile', 'O'), ('eegoffset', '<i8'), ('exp_version', '<f8'), ('experiment', 'O'), ('intrusion', '<i8'), ('is_stim', '?'), ('item_name', 'O'), ('item_num', '<i8'), ('list', '<i8'), ('montage', '<i8'), ('msoffset', '<i8'), ('mstime', '<i8'), ('protocol', 'O'), ('recalled', '?'), ('rectime', '<i8'), ('serialpos', '<i8'), ('session', '<i8'), ('stim_list', '?'), ('stim_params', 'O'), ('subject', 'O'), ('type', 'O')]))
ptsa's to_hdf method can not deal with the 'O' dtype.
That's a @ctw problem. He implemented the current version. I'm reverting to the previous way of doing things which require a lot fewer conditionals to make sure it works.
When trying to save a timeseries object (generated with the cmlreader .to_ptsa method) to disc, I get the following error:
TypeError Traceback (most recent call last) ~/anaconda2/envs/pythree/lib/python3.6/site-packages/ptsa/data/timeseries.py in to_hdf(self, filename, mode, compression, compression_opts, encode_string_arrays, encoding) 169 name, data=data, chunks=chunks, --> 170 **compression_kwargs) 171 except TypeError as e:
~/anaconda2/envs/pythree/lib/python3.6/site-packages/h5py/_hl/group.py in create_dataset(self, name, shape, dtype, data, kwds) 105 with phil: --> 106 dsid = dataset.make_new_dset(self, shape, dtype, data, kwds) 107 dset = dataset.Dataset(dsid)
~/anaconda2/envs/pythree/lib/python3.6/site-packages/h5py/_hl/dataset.py in make_new_dset(parent, shape, dtype, data, chunks, compression, shuffle, fletcher32, maxshape, compression_opts, fillvalue, scaleoffset, track_times) 99 dtype = numpy.dtype(dtype) --> 100 tid = h5t.py_create(dtype, logical=1) 101
h5py/h5t.pyx in h5py.h5t.py_create()
h5py/h5t.pyx in h5py.h5t.py_create()
h5py/h5t.pyx in h5py.h5t.py_create()
h5py/h5t.pyx in h5py.h5t._c_compound()
h5py/h5t.pyx in h5py.h5t.py_create()
h5py/h5t.pyx in h5py.h5t.py_create()
TypeError: Object dtype dtype('O') has no native HDF5 equivalent
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)