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

HDF5 file reading error #56

Open
ndonyapour opened this issue Oct 19, 2022 · 5 comments
Open

HDF5 file reading error #56

ndonyapour opened this issue Oct 19, 2022 · 5 comments
Labels

Comments

@ndonyapour
Copy link
Contributor

Hello,

I recently installed wepy from pip. I had some issues when I tried to run my simulations so I updated h5py and networkx. I ran into "Type names and field names must be valid identifiers" error when I read from my HDF5 reporter file. I would appreciate it if you could help me out.

Thank you!

@salotz
Copy link
Collaborator

salotz commented Oct 20, 2022

You'll have to give me which versions you have installed of all of that and the full stack trace. Also clarify exactly the process you followed. Are you reading the HDF5 data from a different version than you wrote with etc.

@ndonyapour
Copy link
Contributor Author

Thank you for being so helpful. I had a discrepancy in the version of h5py. The HDF5 file was written with version 2.10, and I've been reading the data with version 3.10.

@salotz
Copy link
Collaborator

salotz commented Oct 25, 2022

There are compatibility problems with reading >=3 with things written in version 2, so I would try to read with <3 if you can.

@alexrd
Copy link
Collaborator

alexrd commented Mar 31, 2023

Following up on this, since I was about to post a separate issue. For anyone else who is interested, here are some more details:

Raises a ValueError: Type names and field names must be valid identifiers: "b'decision_id'"

Minimal code needed to reproduce:

we = WepyHDF5(h5name,'r')
we.open()
we.resampling_records([0])

It can also be observed with:

print(we.record_fields)

where byte strings are shown using the "b" character before string.

We can fix this in HDF5=3.10 by using the .asstr() function when reading the record fields.

@salotz
Copy link
Collaborator

salotz commented Aug 31, 2023

depends on #78

@salotz salotz added the bug label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants