HDFGroup / h5pyd

h5py distributed - Python client library for HDF Rest API
Other
114 stars 38 forks source link

Shape inconsistency with h5py #26

Closed rayosborn closed 7 years ago

rayosborn commented 7 years ago

If I load a two-dimensional slab from a three-dimensional array, I get a numpy array with ndim=2 in h5py, but ndim=3 in h5pyd, with one of the dimensions of size 1.

The following accesses the same file on the remote server and stored locally:

>>> import h5pyd as h5d
>>> a=h5d.File('mullite_300K.mullite.exfac', mode='r', endpoint='http://some.server:5000')
>>> a['/entry/transform/v'][400].shape
(1, 901, 901)
>>> import h5py as h5
>>> b=h5.File('mullite/mullite_300K.nxs')
>>> b['/entry/transform/v'][400].shape
(901, 901)
jreadey commented 7 years ago

This should be fixed - just needed to use np.squeeze on the result.

rayosborn commented 7 years ago

Yes, that has fixed it. It's how I fixed it in my own code.

jreadey commented 7 years ago

ok - closing.