uvemas/ViTables

Migrate to PyTables 3 API

Closed this issue · 12 comments

Since PyTables-3.3, the PyTables 2 API is removed. It breaks ViTables like:

$ vitables
Creating the Query results file...

Traceback (most recent call last):
  File "/fefs/disk/usr100/gentoo/usr/lib64/python2.7/site-packages/vitables/h5db/dbDoc.py", line 115, in openH5File
    h5file = tables.openFile(self.filepath, self.mode)
AttributeError: 'module' object has no attribute 'openFile'


Please, if you think it is a bug, report it to developers.

File creation failed due to unknown reasons!
Please, have a look to the last error displayed in the logger. If you think it's a bug, please report it to developers.

Reference: http://www.pytables.org/MIGRATING_TO_3.x.html
Downstream bug: https://bugs.gentoo.org/show_bug.cgi?id=610636

I've created a branch in my repo and it looks to be working. It's by no means properly tested. Not sure what the workflow is in this repo, but feel free to pull/merge/whatever.

Thanks for the bug report and for the new branch. I'm trying to find some spare time to work on ViTables but it is not an easy task.

I Have run pt2to3 tool on the sources and according to that, branch no_focus_on_click from #60 (aa44849) is completely migrated.

I've just tested (not in depth) the master branch on Windows 10 with python-3.6, tables-3.4 and PyQt5.8 and the problem seems to be fixed so I close the bug.

Thanks a lot guys!

Does it make sense to make a new release? The latest version 2.1 was released in 2011.

I believe it is about time release it, since it is installable with pip.

I would recommend a new release also for other reasons:

  • @stonebig has started vendorizing QT5/4.
  • I have started (8cf74e4) adding functionality as a new plugin(?) to use pandas to read from tables that have been saved from dataframes.

So it seems there is a momentum building for this project.
It makes sense to have a release without exotic stuff, just what has been lurking in the codebase for the last 6(!) years.

For pure egotistical reasons, I would also like a new release.
I've upgraded my linux distro (ubuntu) and the newer pytables in the packaging system broke vitables.

@heroxbd also mentioned that it was broken on the gentoo distro. So by releasing you'll help users from at least 2 distros. (probably more)

I'm really sorry for making you wait. I want a new release as well. And I want it ASAP. But as I've already said in #63 and #42 I prefer to do some testing before the release and try to fix most important or annoying bugs I find.

How can I help in testing?
(ie. get this branch and see if it works)

@Nocturnals I don't know if you're very kind or very impatient :-) but THANKS for your offer. I'm currently testing on Windows 10. So maybe you could test the master branch on Linux? Unfortunately I cannot find my testing howto so I cannot give you detailed instructions. What I'm doing is simply testing the menus of the menu bar one at a time (first the File menu, then the Nodes menu, then Dataset,,,). Doing that would be a great help.

Running:

I did find a minor error when testing. When I click help->about vitables I get:

2017-05-13 20:38:17,678 - vitables - ERROR -   File "/usr/local/lib/python2.7/dist-packages/ViTables-2.2.2-py2.7.egg/vitables/vtapp.py", line 1193, in helpAbout
    license_text = vitables.utils.getLicense()
  File "/usr/local/lib/python2.7/dist-packages/ViTables-2.2.2-py2.7.egg/vitables/utils.py", line 659, in getLicense
    return str(license_text, 'UTF-8')
str() takes at most 1 argument (2 given)

I'm testing it on ubuntu 17.01 with:

Version Numbers 
Python 2.7.13
PyTables 3.4.1
NumPy 1.12.1
HDF5 1.8.18
Zlib 1.2.8
LZO 2.09
BZIP2 1.0.6
Qt 4.8.7
PyQt 4.11.4
ViTables 2.2.2

Everything else appears to be working. I didn't test dataset->calculate because I don't know how to use it and was also missing from the docs.

Installing:

I don't have enough experience with python so I maybe I did several things wrong.

I can build the documentation (using make in the doc dir) and seems ok but the html documentation wasn't installed and maybe it's just an issue of moving the 'compiled' output of the docs in the right dir. If I use help->user guide it can't find the docs.

I saw in setup.py that qtpy was required but it didn't check for qtpy during installation. The first time I ran it I got the message that qtpy was missing. I installed it manually and ran fine after that.

Great to know you're testing on Python2 because currently I don't have such environment available.

Yes, str() in Python 2 takes only one argument and in Python 3 can take two more arguments. You can try to remove the second argument but I don't think it works properly. I think your best bet is to do license_text.decode('UTF-8') as license_text is a bytes object.

Now for the documentation. It is not automatically installed after the build. IIRC you have to create a directory called htmldocs under the vitables directory (but see vtsite.py for being sure). I'm updating the documentation as I fix bugs.

The calculator is a code contributed by Alexey Naydenov. Don't know very well how it works. Ask him if you can. Or wait and I'll contact him ASAP (but I'm really bussy at the moment).