Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexing inconsistency between h5pyd and h5py (and numpy) #69

Open
vsisl opened this issue Oct 11, 2019 · 0 comments
Open

indexing inconsistency between h5pyd and h5py (and numpy) #69

vsisl opened this issue Oct 11, 2019 · 0 comments
Assignees

Comments

@vsisl
Copy link

vsisl commented Oct 11, 2019

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

(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', '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

(2,)

Is this intended behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants