gonum / hdf5

hdf5 is a wrapper for the HDF5 library
BSD 3-Clause "New" or "Revised" License
131 stars 33 forks source link

Add group attributes #50

Closed delaneyj closed 5 years ago

delaneyj commented 5 years ago

When porting access of an hdf5 file from Python to Go similar to

import h5py

f = h5py.File('./examples/hdf5/data00000100.h5', 'r')
g = f['data/100']

for a in g.attrs:
    print(a, g.attrs[a])

# dumps...
# (u'dt', 3.2847121452090093e-16)
# (u'time', 3.2847121452090077e-14)
# (u'timeUnitSI', 1.0)

I noticed while Groups can have attributes and has same access pattern as Datasets the Go wrapper did not support them. A simple c/p from Datasets appears to be working well.

kortschak commented 5 years ago

Would you please send a PR to gonum/gonum adding yourself to AUTHORS and CONTRIBUTORS with the commit message "A+C: add Delaney Gillilan". Then I'll approve this.

kortschak commented 5 years ago

Thanks