activepapers / activepapers-python

Python edition of ActivePapers
http://www.activepapers.org/python-edition/
Other
41 stars 11 forks source link

aptools refs bug #7

Closed pdebuyl closed 10 years ago

pdebuyl commented 10 years ago

Hi Konrad,

aptools refs

crashes on my computer. I tested it with lysozyme_diffusion.ap and water_diffusion.ap. From the backtrace, the issue seems to be the unpacking followed by a .flat method for paper_ref in ActivePaper.external_references

            paper_ref, ref_path = source
            refs[paper_ref.flat[0]][1].add(ref_path.flat[0])

in lib/activepapers/storage.py

Simply stripping .flat[0] for the two occurences solves [at least apparently :-) ] the problem.

pierre@pi-x230:~/Downloads/water_diffusion$ aptool refs Traceback (most recent call last): File "/home/pierre/.local/bin/aptool", line 5, in pkg_resources.run_script('ActivePapers.Py==0.1.1', 'aptool') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script execfile(script_filename, namespace, namespace) File "/home/pierre/.local/lib/python2.7/site-packages/ActivePapers.Py-0.1.1-py2.7.egg/EGG-INFO/scripts/aptool", line 251, in func(**args) File "/home/pierre/.local/lib/python2.7/site-packages/ActivePapers.Py-0.1.1-py2.7.egg/activepapers/cli.py", line 506, in refs refs = paper.external_references() File "/home/pierre/.local/lib/python2.7/site-packages/ActivePapers.Py-0.1.1-py2.7.egg/activepapers/storage.py", line 438, in external_references process(node, refs) File "/home/pierre/.local/lib/python2.7/site-packages/ActivePapers.Py-0.1.1-py2.7.egg/activepapers/storage.py", line 432, in process process(node[item], refs) File "/home/pierre/.local/lib/python2.7/site-packages/ActivePapers.Py-0.1.1-py2.7.egg/activepapers/storage.py", line 429, in process refs[paper_ref.flat[0]][1].add(ref_path.flat[0]) AttributeError: 'str' object has no attribute 'flat'

khinsen commented 10 years ago

Which version of h5py are you using? This looks like a change in the return type for reading attributes.

pdebuyl commented 10 years ago

The bug occurred with 2.3.0b1 (dev version). It is true that the bug disappears with h5py 2.2. Maybe I should stop updating this too often :-) You might face a change with further version of h5py.

khinsen commented 10 years ago

OK, I'll look into this and check with the h5py developers if this is an intentional change of return type or not.

pdebuyl commented 10 years ago

Feel free to close the issue. I don't know if you prefer it open (as a reminder) or closed for the project.

khinsen commented 10 years ago

h5py 2.3 has been released a while ago (the current release is 2.3.1, you don't update that often!), and it does have different behavior, so this issue requires some action. I have asked for advice on the h5py mailing list, in order to find a future-proof solution.