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

Not able to read string attribute from dataset #40

Closed
mghh opened this issue Sep 6, 2018 · 0 comments · Fixed by #65
Closed

Not able to read string attribute from dataset #40

mghh opened this issue Sep 6, 2018 · 0 comments · Fixed by #65

Comments

@mghh
Copy link

mghh commented Sep 6, 2018

What are you trying to do?

I try to read a string attribute from a dataset.

What did you do?

Here is a code snippet:

    var version int64
    versionAttr, _ := dset.OpenAttribute("version")
    versionAttr.Read(&version, hdf5.T_STD_U64LE)
    fmt.Println(version)

    var start string
    startAttr, _ := dset.OpenAttribute("start")
    startAttr.Read(&start, hdf5.T_GO_STRING)
    fmt.Println(start)

Reading the version attribute is fine. Reading the 'start' attribute results in empty string.
Here the snippet from h5dump:

      ATTRIBUTE "start" {
         DATATYPE  H5T_STRING {
            STRSIZE H5T_VARIABLE;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_UTF8;
            CTYPE H5T_C_S1;
         }
         DATASPACE  SCALAR
         DATA {
         (0): "2018-09-04T02:27:43"
         }
      }
      ATTRIBUTE "version" {
         DATATYPE  H5T_STD_I64LE
         DATASPACE  SCALAR
         DATA {
         (0): 1
         }
      }

What did you expect to happen?

I am excepting a variable start with this content "2018-09-04T02:27:43".

What actually happened?

What version of Go, Gonum, Gonum/netlib and libhdf5 are you using?

go:
hdf5: master (c257073)

Problem occurs either with libhdf5: 1.8.20 and libhdf5: 1.10.2

Does this issue reproduce with the current master?

yes.

sbinet added a commit to sbinet-gonum/hdf5 that referenced this issue Nov 4, 2019
sbinet added a commit to sbinet-gonum/hdf5 that referenced this issue Nov 4, 2019
@sbinet sbinet closed this as completed in #65 Nov 4, 2019
sbinet added a commit that referenced this issue Nov 4, 2019
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

Successfully merging a pull request may close this issue.

1 participant