Open vsisl opened 4 years ago
There is an inconsistency in the shape of the returned array when querying slice of numpy ndarray from an HDF5 file using h5py and h5pyd.
Imagine 3D numpy ndarray my_ary stored in my_file.h5
my_ary = np.zeros((5, 5, 5)) select = (slice(0,1), slice(0,2), slice(0,1)) my_ary[select].shape
my_ary = np.zeros((5, 5, 5))
select = (slice(0,1), slice(0,2), slice(0,1))
my_ary[select].shape
(1, 2 ,1)
my_file = h5py.File('my_file.h5', 'w') my_file.create_dataset(name='my_ary', data=my_ary) my_file.close()
my_file = h5py.File('my_file.h5', 'w')
my_file.create_dataset(name='my_ary', data=my_ary)
my_file.close()
my_file = h5py.File('my_file.h5', 'r') my_file['my_ary'][select].shape
my_file = h5py.File('my_file.h5', 'r')
my_file['my_ary'][select].shape
(1, 2, 1)
my_file.close() my_file = h5pyd.File('my_file.hdfgroup.org', 'r', endpoint='xxx:yyy') my_file['my_ary'][select].shape
my_file = h5pyd.File('my_file.hdfgroup.org', 'r', endpoint='xxx:yyy')
(2,)
Is this intended behavior?
There is an inconsistency in the shape of the returned array when querying slice of numpy ndarray from an HDF5 file using h5py and h5pyd.
Imagine 3D numpy ndarray my_ary stored in my_file.h5
my_ary = np.zeros((5, 5, 5))
select = (slice(0,1), slice(0,2), slice(0,1))
my_ary[select].shape
my_file = h5py.File('my_file.h5', 'w')
my_file.create_dataset(name='my_ary', data=my_ary)
my_file.close()
my_file = h5py.File('my_file.h5', 'r')
my_file['my_ary'][select].shape
my_file.close()
my_file = h5pyd.File('my_file.hdfgroup.org', 'r', endpoint='xxx:yyy')
my_file['my_ary'][select].shape
Is this intended behavior?