We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Original author: fal...@gmail.com (February 20, 2009 12:06:41)
Here it is a script showing the problem:
{{{ import numpy as np import h5py
SHAPE = (4,5) DTYPE = np.dtype('i') SIZE = np.product(SHAPE)
f = h5py.File('/tmp/test.hdf5','w') mydata = np.arange(SIZE,dtype=DTYPE).reshape(SHAPE) dset = f.create_dataset("mydata", data=mydata) f.flush()
keys = (slice(None), [0,1,2,3,4]) a = mydata[keys] print "numpy-->", a b = dset[keys] print "h5py-->", b assert np.alltrue(a == b) f.close() }}}
which raise the next error:
{{{ numpy--> [[ 0 1 2 3 4] [ 5 6 7 8 9] [10 11 12 13 14] [15 16 17 18 19]] Traceback (most recent call last): File "multidim.py", line 16, in <module> b = dset[keys] File "/home/faltet/python/h5py/trunk/h5py/highlevel.py", line 889, in getitem selection = sel.select(self.shape, args) File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 42, in select sel[args] File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 338, in getitem validate_number(select_idx, length) File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 295, in validate_number raise IndexError('Index out of bounds: %d' % num) IndexError: Index out of bounds: 5 }}}
Attached is a fix for this.
Original issue: http://code.google.com/p/h5py/issues/detail?id=31
The text was updated successfully, but these errors were encountered:
From fal...@gmail.com on February 20, 2009 12:08:54 Ops. I missed to comment that the patch here should be applied after issue #29.
Sorry, something went wrong.
From andrew.c...@gmail.com on February 23, 2009 21:52:58 Patch applied; needs unit tests
From andrew.c...@gmail.com on June 16, 2009 23:45:06 Add test for 1.2
No branches or pull requests
Original author: fal...@gmail.com (February 20, 2009 12:06:41)
Here it is a script showing the problem:
{{{
import numpy as np
import h5py
SHAPE = (4,5)
DTYPE = np.dtype('i')
SIZE = np.product(SHAPE)
f = h5py.File('/tmp/test.hdf5','w')
mydata = np.arange(SIZE,dtype=DTYPE).reshape(SHAPE)
dset = f.create_dataset("mydata", data=mydata)
f.flush()
keys = (slice(None), [0,1,2,3,4])
a = mydata[keys]
print "numpy-->", a
b = dset[keys]
print "h5py-->", b
assert np.alltrue(a == b)
f.close()
}}}
which raise the next error:
{{{
numpy--> [[ 0 1 2 3 4]
[ 5 6 7 8 9]
[10 11 12 13 14]
[15 16 17 18 19]]
Traceback (most recent call last):
File "multidim.py", line 16, in <module>
b = dset[keys]
File "/home/faltet/python/h5py/trunk/h5py/highlevel.py", line 889, in
getitem
selection = sel.select(self.shape, args)
File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 42, in select
sel[args]
File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 338, in
getitem
validate_number(select_idx, length)
File "/home/faltet/python/h5py/trunk/h5py/selections.py", line 295, in
validate_number
raise IndexError('Index out of bounds: %d' % num)
IndexError: Index out of bounds: 5
}}}
Attached is a fix for this.
Original issue: http://code.google.com/p/h5py/issues/detail?id=31
The text was updated successfully, but these errors were encountered: