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

Add support for transient HDF5 datatypes #2651

Closed
ZedThree opened this issue Mar 6, 2023 · 3 comments · Fixed by #2655
Closed

Add support for transient HDF5 datatypes #2651

ZedThree opened this issue Mar 6, 2023 · 3 comments · Fixed by #2655

Comments

@ZedThree
Copy link
Contributor

ZedThree commented Mar 6, 2023

As raised in #267 and #2650, with HDF5 it is possible to store user-defined datatypes within a variable, for example:

HDF5 "test.h5" {
GROUP "/" {
   DATASET "x" {
      DATATYPE  H5T_COMPOUND {
         H5T_IEEE_F64LE "r";
         H5T_IEEE_F64LE "i";
      }
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
      DATA {
      (0): {
            1,
            0
         }
      }
   }
}
}

or

HDF5 "test.nc" {
GROUP "/" {
   DATASET "foo" {
      DATATYPE  H5T_ENUM {
         H5T_STD_I8LE;
         "FALSE"            0;
         "TRUE"             1;
      }
      DATASPACE  SCALAR
      DATA {
      (0): TRUE
      }
   }
}
}

NetCDF can already read these datatypes if they have been committed to the file with a name (just in the root group, or in any group?), so presumably it's just the type-lookup logic that needs to be modified?

@edwardhartnett
Copy link
Contributor

Yes I believe you are correct. This is a the result of a mistake on my part, I just did not understand that these type definitions could exist.

Indeed the answer is to modify the metadata reading functions to spot these types and read them.

@DennisHeimbigner
Copy link
Collaborator

Does this require any specific HDF5 superblock number? We need to make sure that
netcdf-java can access such types.

@ZedThree
Copy link
Contributor Author

Nope, no requirement on the superblock version, this has been in HDF5 since at least 1.6, more than 15 years.

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.

3 participants