PlotPyStack / guiqwt

Efficient 2D plotting Python library based on PythonQwt
https://pypi.python.org/pypi/guiqwt
Other
80 stars 20 forks source link

issue around loadsaveitems_hdf5.py (may/may not be guiqwt's fault) #47

Closed stonebig closed 8 years ago

stonebig commented 8 years ago
Building items and add them to plotting canvas Saving items... Traceback (most r
ecent call last):
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_hdf5.py", line 37, in <module>
    test.run()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_pickle.py", line 76, in run
    self.save_items()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_hdf5.py", line 29, in save_items
    self.plot.serialize(writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\baseplot.py", line 607, in serialize
    io.save_items(writer, items)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\io.py", line 502, in save_items
    item.serialize(writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\image.py", line 1884, in serialize
    super(MaskedImageItem, self).serialize(writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\image.py", line 955, in serialize
    super(ImageItem, self).serialize(writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\image.py", line 822, in serialize
    writer.write(self.imageparam, group_name='imageparam')
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\userconfigio.py", line 99, in write
    val.serialize(self)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\dataset\datatypes.py", line 758, in serialize
    item.serialize(self, writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\dataset\datatypes.py", line 328, in serialize
    writer.write(value)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\userconfigio.py", line 102, in write
    (val, type(val)))
NotImplementedError: cannot serialize 999999 of type <class 'numpy.int32'>
stonebig commented 8 years ago

the second part is on loadsaveitems_hdf5.py

Restoring items... Traceback (most recent call last):
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_hdf5.py", line 37, in <module>
    test.run()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_pickle.py", line 73, in run
    self.add_items()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_pickle.py", line 91, in add_items
    self.restore_items()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\tests\loadsaveitems_hdf5.py", line 24, in restore_item
s
    self.plot.deserialize(reader)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\baseplot.py", line 616, in deserialize
    for item in io.load_items(reader):
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guiqwt\io.py", line 510, in load_items
    names = reader.read_sequence()
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\hdf5io.py", line 339, in read_sequence
    return list(group.attrs[self.option[-1]])
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (D:\Buil
d\h5py\h5py-2.5.x\h5py\_objects.c:2467)
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (D:\Buil
d\h5py\h5py-2.5.x\h5py\_objects.c:2424)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\h5py\_hl\attrs.py", line 52, in __getitem__
    attr = h5a.open(self._id, self._e(name))
  File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (D:\Buil
d\h5py\h5py-2.5.x\h5py\_objects.c:2467)
  File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (D:\Buil
d\h5py\h5py-2.5.x\h5py\_objects.c:2424)
  File "h5py\h5a.pyx", line 77, in h5py.h5a.open (D:\Build\h5py\h5py-2.5.x\h5py\
h5a.c:2071)
KeyError: "Can't open attribute (Can't locate attribute: 'plot_items')"
stonebig commented 8 years ago

hum, now I have that in guidata runing hdf5 test:

Settings saved in:  D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\settin
gs\.app.ini
Traceback (most recent call last):
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\tests\hdf5.py", line 44, in <module>
    e.serialize(writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\dataset\datatypes.py", line 758, in serialize
    item.serialize(self, writer)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\dataset\datatypes.py", line 328, in serialize
    writer.write(value)
  File "D:\WinPythonQt5\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64
\lib\site-packages\guidata\userconfigio.py", line 104, in write
    (val, type(val)))
NotImplementedError: cannot serialize datetime.datetime(2010, 10, 10, 0, 0) of t
ype <class 'datetime.datetime'>
PierreRaybaut commented 8 years ago

Actually this was a known "not yet implemented" feature but it's done now.