Unable to modify dataset attribute if it is a nested array


#1

Hello. I’m a new user of h5py and I have an issue with nested array as attribute.
I’m need to modify an attribute in a file generated by an external source but I’m not able to get the type of the attribute right.

When I open the file with HDFView the original type of the attribute is Array [3] of 64-bit floating point with an array size of 1 and value [1,2,3].

But when I do something like group.attrs[‘foo’] = group.attrs[‘foo’], the type is changed to 64-bit floating point with array size 1x3 and value [1,2,3]

My issue is very similar to This stackoverflow topic

Is there a solution to this issue ?

  • Operating System: Windows 10
  • Where Python was acquired: Anaconda on Windows)

'Summary of the h5py configuration---------------------------------
h5py 3.1.0
HDF5 1.12.0
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
sys.platform win32
sys.maxsize 9223372036854775807
numpy 1.19.2
cython (built with) 0.29.21
numpy (built against) 1.14.5
HDF5 (built against) 1.12.0


#2

Cross-linking so people can find it, this is also an issue on h5py.