I posted this on cython-users and got not response. Any idea what is
wrong here? short test program is below:


#######test.py and testcython.pyx
import os
import h5py
import numpy
os.popen("rm myfile.hdf5")
f = h5py.File('myfile.hdf5')
dset = f.create_dataset("MyDataset", (10, 10), 'i')
dset[...] = 42
indexDest = f["MyDataset"]
index = numpy.zeros(dtype=indexDest.dtype, shape=indexDest.shape)
index = indexDest[:]
f.close()
print index



>>> import testcython

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "testcython.pyx", line 13, in init
modules.pytrade.db.h5py.testcython
(modules/pytrade/db/h5py/testcython.c:725)
    index = indexDest[:]
  File "/usr/lib/python2.6/dist-packages/h5py/highlevel.py", line
1200, in __getitem__
    selection = sel.select(self.shape, args, dsid=self.id)
  File "/usr/lib/python2.6/dist-packages/h5py/selections.py", line 94,
in select
    sel[args]
  File "/usr/lib/python2.6/dist-packages/h5py/selections.py", line
261, in __getitem__
    start, count, step, scalar = _handle_simple(self.shape,args)
  File "/usr/lib/python2.6/dist-packages/h5py/selections.py", line
512, in _handle_simple
    x,y,z = _translate_slice(arg, length)
  File "/usr/lib/python2.6/dist-packages/h5py/selections.py", line
564, in _translate_slice
    raise ValueError("Stop index %s out of range (1-%d)" % (stop, length))
ValueError: Stop index 9223372036854775807 out of range (1-10)




>>> import test

[[42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]
 [42 42 42 42 42 42 42 42 42 42]]
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to