Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5file.visititems(...) raises exception #9

Open
fmfreeze opened this issue Jan 9, 2020 · 2 comments
Open

h5file.visititems(...) raises exception #9

fmfreeze opened this issue Jan 9, 2020 · 2 comments

Comments

@fmfreeze
Copy link

fmfreeze commented Jan 9, 2020

Thank you Exteris for your great module wrapper.
What seems not to work is the h5file.visititems function.

Here is some minimal example code to reproduce this issue:
(it should print all given attributes of an h5 element,
replace "path_to_file" to any hdf5 file)

import h5pickle

def print_node_attributes(name, node):
        for k in node.attrs.keys():
            print(k)
                
with h5pickle.File(path_to_file, "r", skip_cache=False) as h5f:
    h5f.visititems(print_node_attributes)

I get this error:
RuntimeError: Object visitation failed (invalid object ID)

Do you have an idea on how to deal with that?
Thank you!

@DaanVanVugt
Copy link
Owner

Hi, I think this is because we do not wrap the visititems function in this module.
Doing that would probably enable this usecase. I might take a look in a few weeks, or I'd be happy to accept a pull request.

@DaanVanVugt
Copy link
Owner

Hi @fmfreeze,

I tried to look into your issue, but I cannot reproduce it with my (extremely simple) test HDF5 file.
Could you send me a sample file for which the above program fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants