HDFGroup / h5pyd

h5py distributed - Python client library for HDF Rest API
Other
110 stars 39 forks source link

`hsload --link` fails for chunked datasets #96

Closed loichuder closed 3 years ago

loichuder commented 3 years ago

I create a simple file with a single chunked dataset

import h5py

with h5py.File("chunked.h5", "w") as h5file:
    h5file.create_dataset("chunked", (1000, 1000), chunks=(100, 100))

Then, when running hsload --link on chunked.h5, I get an error:

  File ".../h5pyd/h5pyd/_apps/utillib.py", line 341, in create_dataset
    num_chunks = dsetid.get_num_chunks(spaceid)
AttributeError: 'h5py.h5d.DatasetID' object has no attribute 'get_num_chunks'

get_num_chunks is part of the API of h5py only since 3.0 (https://docs.h5py.org/en/stable/whatsnew/3.0.html?highlight=get_num_chunks#new-features) but h5pyd needs version 2.9 (https://github.com/HDFGroup/h5pyd/commit/a9eb75bd8ce71953b464f3e28efdd8153d2d79ee) ?

loichuder commented 3 years ago

Using hsload --link with h5py==3.0.0 works without problem.

jreadey commented 3 years ago

Yes, the change of the h5py major version number was tripping up my version checking. This should be working now with either h5py 2.9.0 or >3.0, see: https://github.com/HDFGroup/h5pyd/commit/5cfaa5badd01d2cd359104ca652bb0527697d00d.