-
Notifications
You must be signed in to change notification settings - Fork 33
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
test-go-cpxcmpd: output does not match with h5ls/h5dump/h5py #81
Comments
It looks like the inc between elements is wrong for integers.. Notice that in all cases we see the Go data [a, b, c] end up being written out as [a, 0, b]. My guess would be that Yes, looking further, Go Now experimentally confirmed, using explicit integer widths fixes the problem. This also lead me to suspect that field
|
After a quick read of The Datatype Interface (H5T), I think it might not be a good idea to drop such native types. It's clear that anybody caring of the .h5 portability should avoid such implicitly sized types but even then, why h5ls and gonum/hdf5 should disagree if running on the same machine? There seems to be some assumption misalignment which IMHO is worth fixing. |
C The reason h5ls and gonum/hdf5 and don't agree is because h5ls is a C program and gonum/hdf5 is a Go program that interfaces to C with a mapping The underlying assumption is that there is a direct memory modelling between C and Go which does not hold for Go's |
I've my doubts that any .h5 file with int/uint implicit sizes can be moved across architectures in a reliable way, therefore I would not care too much of this case. Anyway, it's your call and I surely don't see anything wrong in staying on the safe side and not supporting native Go int/uint types. Are you going to enforce this on both read and write cases? Any possibility of manually overriding such limitation? I don't have any use case at the moment but I'd like to recognize .h5 data files that cannot be safely read in Go. |
What are you trying to do?
I'm examining the test-go-cpxcmpd code and the generated SDScompound.h5 file so to understand how things work.
What did you do?
I run the example:
What did you expect to happen?
What actually happened?
Note how the arrays of integers are completely wrong, ex. [1,0,2] instead of [1,2,3]. h5dump is consistent with h5ls but also h5py (the Python bindings) is. Hence my suspects on gonum/hdf5.
What version of Go, Gonum, Gonum/netlib and libhdf5 are you using?
Go: 1.16
gonum/hdf5.git: 496fefe
Does this issue reproduce with the current master?
Yes.
I locally removed the string from the dataset so to work around #12.
These are the local changes:
The text was updated successfully, but these errors were encountered: