grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
59 stars 22 forks source link

Error in h5checktype(). H5Identifier not valid. #139

Closed TomVuod closed 5 months ago

TomVuod commented 5 months ago

Hello, I have the following error from rhdf5 version 2.47.3 when a single-column data frame is written to the h5 file:

rhdf5::h5errorHandling(type = "verbose")
df <- data.frame(a=1:10)
file = tempfile()
rhdf5::h5createFile(file)
rhdf5::h5write(
    obj = df,
    file = file,
    name = "df")

res <- rhdf5::h5read(file, "df")

Error in H5Dread(h5dataset = h5dataset, h5spaceFile = h5spaceFile, h5spaceMem = h5spaceMem,  : 
  libhdf5
    error #000: H5Tfields.c in H5T__get_member_name(): line 175
        class: HDF5
        major: Invalid arguments to routine
        minor: Bad value
    error #001: H5Tfields.c in H5Tget_member_name(): line 138
        class: HDF5
        major: Invalid arguments to routine
        minor: Inappropriate type
Error: Error in h5checktype(). H5Identifier not valid.

If second column is added there is no error.

grimbough commented 5 months ago

Thanks for the report and reproducible example. I think this must be a regression I inadvertently caused when trying to add support for complex numbers. I'll take a look at what's happened and try to find a fix.

grimbough commented 5 months ago

This was a logic fail, where I was trying to check the name of the second column in a compound dataset, even if there was only one column actually present. It should be fixed in version 2.47.4

TomVuod commented 5 months ago

Thank you for investigating it. I will be waiting for the new version because this issue generates a build error in our package submitted to Bioconductor.

grimbough commented 5 months ago

I presume this has now propagated and the issue is resolved. Please re-open if that's not the case.