Closed melmar99 closed 6 months ago
Thanks for reporting that issue, I will check it now!
It works if I try to read the attribute like this:
using PureHDF;
using PureHDF.VOL.Native;
var file = H5File
.OpenRead("/home/vincent/Downloads/invest/NUTS_0_sp_historical.h5.nc");
var attribute = file
.Dataset("/NUTS_keys")
.Attribute("DIMENSION_LIST");
var objectReferences = attribute.Read<NativeObjectReference1[][]>();
var firstObjectReference = objectReferences[0][0];
var dataset = (NativeDataset)file.Get(firstObjectReference);
var isNuts = dataset.Name == "NUTS";
Yes it works. Thank you very much for your help.
Perfect :-)
Hello, reading the variable-length attribute is causing the following exception: Exception: Variable-length sequence data can only be decoded as array (incompatible type: System.String). The exception says that type System.String is incompatible even though a type string[] has been used. The code below successfully reads the variable-length type dataset, but reading the variable-length type attribute fails.
A copy of the HDF5 file used is here
If attribute.Read<string[][]>() is used the exception is: Bitfield data can only be decoded as NativeObjectReference1 (incompatible type: System.String) If NativeObjectReference1 is used the exception is: Unable to decode a reference type as value type.
Any help would be greatly appreciated.